PHP 클래스 DNProject

상속: extends DataObject
파일 보기 프로젝트 열기: silverstripe/deploynaut 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_current_member_cache boolean | Member
$relation_cache array In-memory cache for currentBuilds per environment since fetching them from disk is pretty resource hungry.

공개 메소드들

메소드 설명
APILink ( string $action ) : string
CreateEnvironmentLink ( ) : string | null
CurrentMenu ( ) : DataObject Return the current object from $this->Menu() Good for making titles and things
DNBranchList ( ) : DNBranchList Provides a list of the branches in this project.
DNBuildList ( ) : DNReferenceList Provides a DNBuildList of builds found in this project.
DNData ( ) : DNData
DNEnvironmentList ( ) : ArrayList Provides a list of environments found in this project.
DNTagList ( ) : DNReferenceList Provides a list of the tags in this project.
DataArchives ( ) : DataList
DiskQuotaUsagePercent ( ) : integer Returns the current disk quota usage as a percentage
EnvironmentsByUsage ( string $usage ) : ArrayList
HasDiskQuota ( ) : boolean Is there a disk quota set for this project?
HasExceededDiskQuota ( ) : boolean Has the disk quota been exceeded?
IsStarred ( ) : boolean
Link ( $action = '' ) : string
Menu ( ) : ArrayList Get the menu to be shown on projects
PendingManualUploadDataArchives ( ) : DataList Return all archives which are "manual upload requests", meaning they don't have a file attached to them (yet).
ToggleStarLink ( ) : string
allowed ( string $code, Member | null $member = null ) : boolean Convenience wrapper for a single permission code.
allowedAny ( array | string $codes, Member | null $member = null ) : boolean Check if member has a permission code in this project.
canBackup ( Member | null $member = null ) : boolean
canCreate ( Member $member = null ) : boolean
canCreateEnvironments ( Member | null $member = null ) : boolean This is a permission check for the front-end only.
canDownloadArchive ( Member | null $member = null ) : boolean
canRestore ( Member | null $member = null ) : boolean
canUploadArchive ( Member | null $member = null ) : boolean
canView ( Member | null $member = null ) : boolean Restrict access to viewing this project
clearGitCache ( ) This will clear the cache for the git getters and should be called when the local git repo is updated
cloneRepo ( ) : string Setup a job to clone a git repository.
create_from_path ( string $path ) : DNProject Used by the sync task
currentBuilds ( ) : false | DNDeployment Returns a map of envrionment name to build name
getCMSFields ( ) : FieldList
getCommit ( string $sha ) : false | Gitonomy\Git\Commit This is a proxy call to gitonmy that caches the information per project and sha
getCommitMessage ( Gitonomy\Git\Commit $commit ) : string
getCommitSubjectMessage ( Gitonomy\Git\Commit $commit ) : string get the commit "subject", getCommitMessage get the full message
getCommitTags ( Gitonomy\Git\Commit $commit ) : mixed
getCompleteInitialEnvironmentCreations ( ) : DataList Returns a list of completed initial environment creations. This includes failed tasks.
getDiskQuotaMB ( ) : string | integer Getter for DiskQuotaMB field to provide a default for existing records that have no quota field set, as it will need to default to a globally set size.
getInitialEnvironmentCreations ( ) : DataList Returns a list of initial environments created for this project.
getKeyDir ( ) : string | null Returns the location of the projects key dir if one exists.
getLocalCVSPath ( ) : string
getPrivateKeyPath ( ) : string | null This returns that path of the private key if a key directory is set. It doesn't check whether the file exists.
getProcessEnv ( ) : array Build an environment variable array to be used with this project.
getPublicKey ( ) : string | void Fetch the public key for this project.
getPublicKeyPath ( ) : string | null This returns that path of the public key if a key directory is set. It doesn't check whether the file exists.
getRepository ( ) : false | Gitonomy\Git\Repository
getRepositoryInterface ( ) : ArrayData Get a ViewableData structure describing the UI tool that lets the user view the repository code
getRepositoryURL ( ) : void | string Provide current repository URL to the users.
getRunningEnvironmentCreations ( ) : SS_List Returns a list of environments still being created.
getRunningInitialEnvironmentCreations ( ) : DataList Only returns initial environments that are being created.
getUsedQuotaMB ( integer $round = 2 ) : double Return the used quota in MB.
getViewersList ( ) : string Get a string of people allowed to view this project
get_git_cache ( ) : Zend_Cache_Frontend_Output
groupAllowed ( string $permissionCode, Group $group ) : boolean Checks if a group is allowed to the project and the permission code
isCurrent ( ) : boolean Is this project currently at the root level of the controller that handles it?
isProjectReady ( ) : boolean Checks if the environment has been fully built.
isSection ( ) : boolean Is this project currently in a controller that is handling it or performing a sub-task?
onAfterDelete ( ) Delete related environments and folders
onAfterWrite ( )
onBeforeWrite ( )
projectFolderExists ( ) : boolean
repoExists ( ) : boolean
resolveRevision ( $value ) : boolean | string Resolve a git reference like a branch or tag into a SHA.
setCreateProjectFolderField ( FieldList &$fields ) If there isn't a capistrano env project folder, show options to create one
whoIsAllowed ( string $code ) : SS_List Convenience wrapper for a single permission code.
whoIsAllowedAny ( array | string $codes ) : SS_List List members who have $codes on this project.

보호된 메소드들

메소드 설명
getProjectFolderPath ( ) : string
setEnvironmentFields ( FieldList &$fields, GridField $environments ) Setup a gridfield for the environment configs
validate ( ) : ValidationResult

메소드 상세

CurrentMenu() 공개 메소드

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

DNBranchList() 공개 메소드

Provides a list of the branches in this project.
public DNBranchList ( ) : DNBranchList
리턴 DNBranchList

DNBuildList() 공개 메소드

Provides a DNBuildList of builds found in this project.
public DNBuildList ( ) : DNReferenceList
리턴 DNReferenceList

DNData() 공개 메소드

public DNData ( ) : DNData
리턴 DNData

DNEnvironmentList() 공개 메소드

CAUTION: filterByCallback will change this into an ArrayList!
public DNEnvironmentList ( ) : ArrayList
리턴 ArrayList

DNTagList() 공개 메소드

Provides a list of the tags in this project.
public DNTagList ( ) : DNReferenceList
리턴 DNReferenceList

DataArchives() 공개 메소드

public DataArchives ( ) : DataList
리턴 DataList

DiskQuotaUsagePercent() 공개 메소드

Returns the current disk quota usage as a percentage
public DiskQuotaUsagePercent ( ) : integer
리턴 integer

EnvironmentsByUsage() 공개 메소드

public EnvironmentsByUsage ( string $usage ) : ArrayList
$usage string
리턴 ArrayList

HasDiskQuota() 공개 메소드

Is there a disk quota set for this project?
public HasDiskQuota ( ) : boolean
리턴 boolean

HasExceededDiskQuota() 공개 메소드

Has the disk quota been exceeded?
public HasExceededDiskQuota ( ) : boolean
리턴 boolean

IsStarred() 공개 메소드

public IsStarred ( ) : boolean
리턴 boolean

Menu() 공개 메소드

Get the menu to be shown on projects
public Menu ( ) : ArrayList
리턴 ArrayList

PendingManualUploadDataArchives() 공개 메소드

Return all archives which are "manual upload requests", meaning they don't have a file attached to them (yet).
public PendingManualUploadDataArchives ( ) : DataList
리턴 DataList

allowed() 공개 메소드

Convenience wrapper for a single permission code.
public allowed ( string $code, Member | null $member = null ) : boolean
$code string
$member Member | null
리턴 boolean

allowedAny() 공개 메소드

Check if member has a permission code in this project.
public allowedAny ( array | string $codes, Member | null $member = null ) : boolean
$codes array | string
$member Member | null
리턴 boolean

canBackup() 공개 메소드

public canBackup ( Member | null $member = null ) : boolean
$member Member | null
리턴 boolean

canCreate() 공개 메소드

public canCreate ( Member $member = null ) : boolean
$member Member
리턴 boolean

canCreateEnvironments() 공개 메소드

Only admins can create environments for now. Also, we need to check the value of AllowedEnvironmentType which dictates which backend to use to render the form.
public canCreateEnvironments ( Member | null $member = null ) : boolean
$member Member | null
리턴 boolean

canDownloadArchive() 공개 메소드

public canDownloadArchive ( Member | null $member = null ) : boolean
$member Member | null
리턴 boolean

canRestore() 공개 메소드

public canRestore ( Member | null $member = null ) : boolean
$member Member | null
리턴 boolean

canUploadArchive() 공개 메소드

public canUploadArchive ( Member | null $member = null ) : boolean
$member Member | null
리턴 boolean

canView() 공개 메소드

Restrict access to viewing this project
public canView ( Member | null $member = null ) : boolean
$member Member | null
리턴 boolean

clearGitCache() 공개 메소드

This will clear the cache for the git getters and should be called when the local git repo is updated
public clearGitCache ( )

cloneRepo() 공개 메소드

Setup a job to clone a git repository.
public cloneRepo ( ) : string
리턴 string resque token

create_from_path() 공개 정적인 메소드

Used by the sync task
public static create_from_path ( string $path ) : DNProject
$path string
리턴 DNProject

currentBuilds() 공개 메소드

Returns a map of envrionment name to build name
public currentBuilds ( ) : false | DNDeployment
리턴 false | DNDeployment

getCMSFields() 공개 메소드

public getCMSFields ( ) : FieldList
리턴 FieldList

getCommit() 공개 메소드

This is a proxy call to gitonmy that caches the information per project and sha
public getCommit ( string $sha ) : false | Gitonomy\Git\Commit
$sha string
리턴 false | Gitonomy\Git\Commit

getCommitMessage() 공개 메소드

public getCommitMessage ( Gitonomy\Git\Commit $commit ) : string
$commit Gitonomy\Git\Commit
리턴 string

getCommitSubjectMessage() 공개 메소드

get the commit "subject", getCommitMessage get the full message
public getCommitSubjectMessage ( Gitonomy\Git\Commit $commit ) : string
$commit Gitonomy\Git\Commit
리턴 string

getCommitTags() 공개 메소드

public getCommitTags ( Gitonomy\Git\Commit $commit ) : mixed
$commit Gitonomy\Git\Commit
리턴 mixed

getCompleteInitialEnvironmentCreations() 공개 메소드

Returns a list of completed initial environment creations. This includes failed tasks.
public getCompleteInitialEnvironmentCreations ( ) : DataList
리턴 DataList

getDiskQuotaMB() 공개 메소드

Getter for DiskQuotaMB field to provide a default for existing records that have no quota field set, as it will need to default to a globally set size.
public getDiskQuotaMB ( ) : string | integer
리턴 string | integer The quota size in MB

getInitialEnvironmentCreations() 공개 메소드

Returns a list of initial environments created for this project.
public getInitialEnvironmentCreations ( ) : DataList
리턴 DataList

getKeyDir() 공개 메소드

Returns the location of the projects key dir if one exists.
public getKeyDir ( ) : string | null
리턴 string | null

getLocalCVSPath() 공개 메소드

public getLocalCVSPath ( ) : string
리턴 string

getPrivateKeyPath() 공개 메소드

This returns that path of the private key if a key directory is set. It doesn't check whether the file exists.
public getPrivateKeyPath ( ) : string | null
리턴 string | null

getProcessEnv() 공개 메소드

This is relevant if every project needs to use an individual SSH pubkey. Include this with all Gitonomy\Git\Repository, and \Symfony\Component\Process\Processes.
public getProcessEnv ( ) : array
리턴 array

getProjectFolderPath() 보호된 메소드

protected getProjectFolderPath ( ) : string
리턴 string

getPublicKey() 공개 메소드

Fetch the public key for this project.
public getPublicKey ( ) : string | void
리턴 string | void

getPublicKeyPath() 공개 메소드

This returns that path of the public key if a key directory is set. It doesn't check whether the file exists.
public getPublicKeyPath ( ) : string | null
리턴 string | null

getRepository() 공개 메소드

public getRepository ( ) : false | Gitonomy\Git\Repository
리턴 false | Gitonomy\Git\Repository

getRepositoryInterface() 공개 메소드

Get a ViewableData structure describing the UI tool that lets the user view the repository code
public getRepositoryInterface ( ) : ArrayData
리턴 ArrayData

getRepositoryURL() 공개 메소드

Provide current repository URL to the users.
public getRepositoryURL ( ) : void | string
리턴 void | string

getRunningEnvironmentCreations() 공개 메소드

Returns a list of environments still being created.
public getRunningEnvironmentCreations ( ) : SS_List
리턴 SS_List

getRunningInitialEnvironmentCreations() 공개 메소드

Only returns initial environments that are being created.
public getRunningInitialEnvironmentCreations ( ) : DataList
리턴 DataList

getUsedQuotaMB() 공개 메소드

Return the used quota in MB.
public getUsedQuotaMB ( integer $round = 2 ) : double
$round integer Number of decimal places to round to
리턴 double The used quota size in MB

getViewersList() 공개 메소드

Get a string of people allowed to view this project
public getViewersList ( ) : string
리턴 string

get_git_cache() 공개 정적인 메소드

public static get_git_cache ( ) : Zend_Cache_Frontend_Output
리턴 Zend_Cache_Frontend_Output

groupAllowed() 공개 메소드

Checks if a group is allowed to the project and the permission code
public groupAllowed ( string $permissionCode, Group $group ) : boolean
$permissionCode string
$group Group
리턴 boolean

isCurrent() 공개 메소드

Is this project currently at the root level of the controller that handles it?
public isCurrent ( ) : boolean
리턴 boolean

isProjectReady() 공개 메소드

Checks if the environment has been fully built.
public isProjectReady ( ) : boolean
리턴 boolean

isSection() 공개 메소드

Is this project currently in a controller that is handling it or performing a sub-task?
public isSection ( ) : boolean
리턴 boolean

onAfterDelete() 공개 메소드

Delete related environments and folders
public onAfterDelete ( )

onAfterWrite() 공개 메소드

public onAfterWrite ( )

onBeforeWrite() 공개 메소드

public onBeforeWrite ( )

projectFolderExists() 공개 메소드

public projectFolderExists ( ) : boolean
리턴 boolean

repoExists() 공개 메소드

public repoExists ( ) : boolean
리턴 boolean

resolveRevision() 공개 메소드

Resolve a git reference like a branch or tag into a SHA.
public resolveRevision ( $value ) : boolean | string
리턴 boolean | string

setCreateProjectFolderField() 공개 메소드

If there isn't a capistrano env project folder, show options to create one
public setCreateProjectFolderField ( FieldList &$fields )
$fields FieldList

setEnvironmentFields() 보호된 메소드

Setup a gridfield for the environment configs
protected setEnvironmentFields ( FieldList &$fields, GridField $environments )
$fields FieldList
$environments GridField

validate() 보호된 메소드

protected validate ( ) : ValidationResult
리턴 ValidationResult

whoIsAllowed() 공개 메소드

Convenience wrapper for a single permission code.
public whoIsAllowed ( string $code ) : SS_List
$code string
리턴 SS_List

whoIsAllowedAny() 공개 메소드

Does not support Permission::DENY_PERMISSION malarky, same as Permission::get_groups_by_permission anyway...
public whoIsAllowedAny ( array | string $codes ) : SS_List
$codes array | string
리턴 SS_List

프로퍼티 상세

$_current_member_cache 보호되어 있는 정적으로 프로퍼티

protected static bool|Member $_current_member_cache
리턴 boolean | Member

$relation_cache 보호되어 있는 정적으로 프로퍼티

In-memory cache for currentBuilds per environment since fetching them from disk is pretty resource hungry.
protected static array $relation_cache
리턴 array