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
파일 보기 프로젝트 열기: silverstripe/deploynaut 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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.

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