PHP Класс DNProject

Наследование: extends DataObject
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_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