PHP Класс DNEnvironment

This dataobject represents a target environment that source code can be deployed to. Permissions are controlled by environment, see the various many-many relationships.
Наследование: extends DataObject
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$db array
$has_many array
$has_one array
$many_many array
$searchable_fields array
$summary_fields array

Открытые методы

Метод Описание
Backend ( ) : DeploymentBackend Get the deployment backend used for this environment.
CurrentBuild ( ) : false | DNDeployment Get the current deployed build for this environment
CurrentMenu ( ) Return the current object from $this->Menu() Good for making titles and things
DNData ( ) : DNData
DeployHistory ( string $orderBy = '' ) : ArrayList A list of past deployments.
DeploymentsLink ( ) : string This provides the link to the deployments depending on whether the feature flag for the new deployment is enabled.
IsNewDeployEnabled ( ) : boolean Check if the new deployment form is enabled by whether the project has it, falling back to environment variables on whether it's enabled.
Link ( string $action = '' ) : string
Menu ( )
array_to_viewabledata ( array $array ) : object Helper function to convert a multi-dimensional array (associative or indexed) to an {@link ArrayList} or {@link ArrayData} object structure, so that values can be used in templates.
canBackup ( Member | null $member = null ) : boolean Allows only selected {@link Member} objects to backup this {@link DNEnvironment} to a {@link DNDataArchive} file.
canDeleteArchive ( Member | null $member = null ) : boolean Allows only selected {@link Member} objects to delete {@link DNDataArchive} objects from this {@link DNEnvironment}.
canDeploy ( Member | null $member = null ) : boolean Allow deploy only to some people.
canDownloadArchive ( Member | null $member = null ) : boolean Allows only selected {@link Member} objects to download {@link DNDataArchive} objects from this {@link DNEnvironment}.
canRestore ( Member | null $member = null ) : boolean Allows only selected {@link Member} objects to restore {@link DNDataArchive} objects into this {@link DNEnvironment}.
canUploadArchive ( Member | null $member = null ) : boolean Allows only selected {@link Member} objects to upload {@link DNDataArchive} objects linked to this {@link DNEnvironment}.
canView ( Member | null $member = null ) : boolean Environments are only viewable by people that can view the environment.
create_from_path ( string $path ) : DNEnvironment Used by the sync task
getArchiveDeletersList ( ) : string Get a string of groups/people that are allowed to delete {@link DNDataArchive} objects from this environment.
getArchiveDownloadersList ( ) : string Get a string of groups/people that are allowed to download {@link DNDataArchive} objects from this environment.
getArchiveUploadersList ( ) : string Get a string of groups/people that are allowed to upload {@link DNDataArchive} objects linked to this environment.
getBareDefaultURL ( )
getBareURL ( )
getCMSFields ( ) : FieldList
getCanBackupMembersList ( ) : string Get a string of groups/people that are allowed to backup {@link DNDataArchive} objects from this environment.
getCanRestoreMembersList ( ) : string Get a string of groups/people that are allowed to restore {@link DNDataArchive} objects into this environment.
getCannotDeployMessage ( ) : string Provide reason why the user cannot deploy.
getCommit ( string $sha ) : Gitonomy\Git\Commit This is a proxy call to gitonmy that caches the information per project and sha
getCommitMessage ( Gitonomy\Git\Commit $commit )
getCommitSubjectMessage ( Gitonomy\Git\Commit $commit )
getCommitTags ( Gitonomy\Git\Commit $commit )
getConfigFilename ( ) : string Returns the path to the ruby config file
getDefaultURL ( ) URL for the environment that can be used if no explicit URL is set.
getDeployStrategy ( SS_HTTPRequest $request ) : DeploymentStrategy
getDeployersList ( ) : string Get a string of groups/people that are allowed to deploy to this environment.
getFullName ( string $separator = ':' ) : string Return a name for this environment.
getSupportedOptions ( ) : ArrayList Return the supported options for this environment.
isCurrent ( ) : boolean Is this environment currently at the root level of the controller that handles it?
isSection ( ) : boolean Is this environment currently in a controller that is handling it or performing a sub-task?
onAfterDelete ( ) Delete any related config files
onAfterWrite ( )
onBeforeWrite ( )
runningDeployments ( ) : DataList Fetchs all deployments in progress. Limits to 1 hour to prevent deployments if an old deployment is stuck.

Защищенные методы

Метод Описание
buildPermissionField ( string $groupField, string $memberField, array $groups, array $members ) : FieldGroup Build a set of multi-select fields for assigning permissions to a pair of group and member many_many relations
checkEnvironmentPath ( ) Ensure that environment paths are setup on the local filesystem
envFileExists ( ) : boolean
getCommitData ( string $sha ) : array
getEnvironmentConfig ( ) : string
setDeployConfigurationFields ( FieldList &$fields )
validate ( )
writeConfigFile ( ) Write the deployment config file to filesystem

Описание методов

Backend() публичный Метод

Enforces compliance with the allowed_backends setting; if the DNEnvironment.BackendIdentifier value is illegal then that value is ignored.
public Backend ( ) : DeploymentBackend
Результат DeploymentBackend

CurrentBuild() публичный Метод

Dear people of the future: If you are looking to optimize this, simply create a CurrentBuildSHA(), which can be a lot faster. I presume you came here because of the Project display template, which only needs a SHA.
public CurrentBuild ( ) : false | DNDeployment
Результат false | DNDeployment

CurrentMenu() публичный Метод

Return the current object from $this->Menu() Good for making titles and things
public CurrentMenu ( )

DNData() публичный Метод

public DNData ( ) : DNData
Результат DNData

DeployHistory() публичный Метод

A list of past deployments.
public DeployHistory ( string $orderBy = '' ) : ArrayList
$orderBy string - the name of a DB column to sort in descending order
Результат ArrayList

IsNewDeployEnabled() публичный Метод

Check if the new deployment form is enabled by whether the project has it, falling back to environment variables on whether it's enabled.
public IsNewDeployEnabled ( ) : boolean
Результат boolean

Menu() публичный Метод

public Menu ( )

array_to_viewabledata() публичный статический Метод

Helper function to convert a multi-dimensional array (associative or indexed) to an {@link ArrayList} or {@link ArrayData} object structure, so that values can be used in templates.
public static array_to_viewabledata ( array $array ) : object
$array array The (single- or multi-dimensional) array to convert
Результат object Either an {@link ArrayList} or {@link ArrayData} object, or the original item ($array) if $array isn't an array.

buildPermissionField() защищенный Метод

Build a set of multi-select fields for assigning permissions to a pair of group and member many_many relations
protected buildPermissionField ( string $groupField, string $memberField, array $groups, array $members ) : FieldGroup
$groupField string Group field name
$memberField string Member field name
$groups array List of groups
$members array List of members
Результат FieldGroup

canBackup() публичный Метод

Allows only selected {@link Member} objects to backup this {@link DNEnvironment} to a {@link DNDataArchive} file.
public canBackup ( Member | null $member = null ) : boolean
$member Member | null The {@link Member} object to test against. If null, uses Member::currentMember();
Результат boolean true if $member can backup, and false if they can't.

canDeleteArchive() публичный Метод

Allows only selected {@link Member} objects to delete {@link DNDataArchive} objects from this {@link DNEnvironment}.
public canDeleteArchive ( Member | null $member = null ) : boolean
$member Member | null The {@link Member} object to test against. If null, uses Member::currentMember();
Результат boolean true if $member can delete archives from this environment, false if they can't.

canDeploy() публичный Метод

Allow deploy only to some people.
public canDeploy ( Member | null $member = null ) : boolean
$member Member | null
Результат boolean

canDownloadArchive() публичный Метод

Allows only selected {@link Member} objects to download {@link DNDataArchive} objects from this {@link DNEnvironment}.
public canDownloadArchive ( Member | null $member = null ) : boolean
$member Member | null The {@link Member} object to test against. If null, uses Member::currentMember();
Результат boolean true if $member can download archives from this environment, false if they can't.

canRestore() публичный Метод

Allows only selected {@link Member} objects to restore {@link DNDataArchive} objects into this {@link DNEnvironment}.
public canRestore ( Member | null $member = null ) : boolean
$member Member | null The {@link Member} object to test against. If null, uses Member::currentMember();
Результат boolean true if $member can restore, and false if they can't.

canUploadArchive() публичный Метод

Note: This is not uploading them to the actual environment itself (e.g. uploading to the live site) - it is the process of uploading a *.sspak file into Deploynaut for later 'restoring' to an environment. See {@link self::canRestore()}.
public canUploadArchive ( Member | null $member = null ) : boolean
$member Member | null The {@link Member} object to test against. If null, uses Member::currentMember();
Результат boolean true if $member can upload archives linked to this environment, false if they can't.

canView() публичный Метод

Environments are only viewable by people that can view the environment.
public canView ( Member | null $member = null ) : boolean
$member Member | null
Результат boolean

checkEnvironmentPath() защищенный Метод

Ensure that environment paths are setup on the local filesystem
protected checkEnvironmentPath ( )

create_from_path() публичный статический Метод

Used by the sync task
public static create_from_path ( string $path ) : DNEnvironment
$path string
Результат DNEnvironment

envFileExists() защищенный Метод

protected envFileExists ( ) : boolean
Результат boolean

getArchiveDeletersList() публичный Метод

Get a string of groups/people that are allowed to delete {@link DNDataArchive} objects from this environment.
public getArchiveDeletersList ( ) : string
Результат string

getArchiveDownloadersList() публичный Метод

Get a string of groups/people that are allowed to download {@link DNDataArchive} objects from this environment.
public getArchiveDownloadersList ( ) : string
Результат string

getArchiveUploadersList() публичный Метод

Get a string of groups/people that are allowed to upload {@link DNDataArchive} objects linked to this environment.
public getArchiveUploadersList ( ) : string
Результат string

getBareDefaultURL() публичный Метод

public getBareDefaultURL ( )

getBareURL() публичный Метод

public getBareURL ( )

getCMSFields() публичный Метод

public getCMSFields ( ) : FieldList
Результат FieldList

getCanBackupMembersList() публичный Метод

Get a string of groups/people that are allowed to backup {@link DNDataArchive} objects from this environment.
public getCanBackupMembersList ( ) : string
Результат string

getCanRestoreMembersList() публичный Метод

Get a string of groups/people that are allowed to restore {@link DNDataArchive} objects into this environment.
public getCanRestoreMembersList ( ) : string
Результат string

getCannotDeployMessage() публичный Метод

Provide reason why the user cannot deploy.
public getCannotDeployMessage ( ) : string
Результат string

getCommit() публичный Метод

This is a proxy call to gitonmy that caches the information per project and sha
public getCommit ( string $sha ) : Gitonomy\Git\Commit
$sha string
Результат Gitonomy\Git\Commit

getCommitData() защищенный Метод

protected getCommitData ( string $sha ) : array
$sha string
Результат array

getCommitMessage() публичный Метод

public getCommitMessage ( Gitonomy\Git\Commit $commit )
$commit Gitonomy\Git\Commit

getCommitSubjectMessage() публичный Метод

public getCommitSubjectMessage ( Gitonomy\Git\Commit $commit )
$commit Gitonomy\Git\Commit

getCommitTags() публичный Метод

public getCommitTags ( Gitonomy\Git\Commit $commit )
$commit Gitonomy\Git\Commit

getConfigFilename() публичный Метод

Returns the path to the ruby config file
public getConfigFilename ( ) : string
Результат string

getDefaultURL() публичный Метод

URL for the environment that can be used if no explicit URL is set.
public getDefaultURL ( )

getDeployStrategy() публичный Метод

public getDeployStrategy ( SS_HTTPRequest $request ) : DeploymentStrategy
$request SS_HTTPRequest
Результат DeploymentStrategy

getDeployersList() публичный Метод

Used in DNRoot_project.ss to list {@link Member}s who have permission to perform this action.
public getDeployersList ( ) : string
Результат string

getEnvironmentConfig() защищенный Метод

protected getEnvironmentConfig ( ) : string
Результат string

getFullName() публичный Метод

Return a name for this environment.
public getFullName ( string $separator = ':' ) : string
$separator string The string used when concatenating project with env name
Результат string

getSupportedOptions() публичный Метод

Return the supported options for this environment.
public getSupportedOptions ( ) : ArrayList
Результат ArrayList

isCurrent() публичный Метод

Is this environment currently at the root level of the controller that handles it?
public isCurrent ( ) : boolean
Результат boolean

isSection() публичный Метод

Is this environment currently in a controller that is handling it or performing a sub-task?
public isSection ( ) : boolean
Результат boolean

onAfterDelete() публичный Метод

Delete any related config files
public onAfterDelete ( )

onAfterWrite() публичный Метод

public onAfterWrite ( )

onBeforeWrite() публичный Метод

public onBeforeWrite ( )

runningDeployments() публичный Метод

Fetchs all deployments in progress. Limits to 1 hour to prevent deployments if an old deployment is stuck.
public runningDeployments ( ) : DataList
Результат DataList

setDeployConfigurationFields() защищенный Метод

protected setDeployConfigurationFields ( FieldList &$fields )
$fields FieldList

validate() защищенный Метод

protected validate ( )

writeConfigFile() защищенный Метод

Write the deployment config file to filesystem
protected writeConfigFile ( )

Описание свойств

$db публичное статическое свойство

public static array $db
Результат array

$has_many публичное статическое свойство

public static array $has_many
Результат array

$has_one публичное статическое свойство

public static array $has_one
Результат array

$many_many публичное статическое свойство

public static array $many_many
Результат array

$searchable_fields публичное статическое свойство

public static array $searchable_fields
Результат array

$summary_fields публичное статическое свойство

public static array $summary_fields
Результат array