\DNProject
DNProject represents a project that relates to a group of target environments.
Synopsis
class DNProject
extends DataObject
{
- // members
- public static array $db = ;
- public static array $has_many = ;
- public static array $many_many = ;
- public static array $summary_fields = ;
- public static array $searchable_fields = ;
- private static string $singular_name = 'Project';
- private static string $plural_name = 'Projects';
- private static string $default_sort = 'Name';
- private static bool $show_repository_url = false;
- protected static array $relation_cache = ;
- // methods
- public static DNProject create_from_path()
- public string|int getUsedQuotaMB()
- public string|int getDiskQuotaMB()
- public boolean HasExceededDiskQuota()
- public boolean HasDiskQuota()
- public ArrayList Menu()
- public boolean canView()
- public void canRestore()
- public void canBackup()
- public void canUploadArchive()
- public void canDownloadArchive()
- public void DataArchives()
- public ArrayList PendingManualUploadDataArchives()
- public array getProcessEnv()
- public string getViewersList()
- public DNData DNData()
- public void DNBuildList()
- public void DNBranchList()
- public void DNTagList()
- public Repository getRepository()
- public ArrayList DNEnvironmentList()
- public void currentBuilds()
- public string Link()
- public string APILink()
- public FieldList getCMSFields()
- public void setCreateProjectFolderField()
- public boolean projectFolderExists()
- public bool repoExists()
- public void cloneRepo()
- public string getLocalCVSPath()
- public void onBeforeWrite()
- protected void checkProjectPath()
- protected void checkCVSPath()
- public void onAfterDelete()
- public void getPublicKey()
- public string|null getPublicKeyPath()
- public string|null getPrivateKeyPath()
- public string|null getKeyDir()
- protected void setEnvironmentFields()
- public void getRepositoryURL()
- protected string getProjectFolderPath()
Hierarchy
Extends
- DataObject
Members
private
- $default_sort — string
- $plural_name
- $show_repository_url
—
bool
Display the repository URL on the project page. - $singular_name
protected
- $relation_cache
—
array
In-memory cache for currentBuilds per environment since fetching them from disk is pretty resource hungry.
public
- $db — array
- $has_many — array
- $many_many — array
- $searchable_fields — array
- $summary_fields — array
Methods
protected
- checkCVSPath() — Check if the CVSPath has been changed, and if so, ensure the repository has been updated
- checkProjectPath() — Ensure the path for this project has been created
- getProjectFolderPath()
- setEnvironmentFields() — Setup a gridfield for the environment configs
public
- APILink()
- DNBranchList() — Provides a list of the branches in this project.
- DNBuildList() — Provides a DNBuildList of builds found in this project.
- DNData()
- DNEnvironmentList() — Provides a list of environments found in this project.
- DNTagList() — Provides a list of the tags in this project.
- DataArchives()
- HasDiskQuota() — Is there a disk quota set for this project?
- HasExceededDiskQuota() — Has the disk quota been exceeded?
- Link()
- Menu() — Get the menu to be shown on projects
- PendingManualUploadDataArchives() — Return all archives which are "manual upload requests", meaning they don't have a file attached to them (yet).
- canBackup()
- canDownloadArchive()
- canRestore()
- canUploadArchive()
- canView() — Restrict access to viewing this project
- cloneRepo() — Setup a asyncronous resque job to clone a git repository
- create_from_path() — Used by the sync task
- currentBuilds() — Returns a map of envrionment name to build name
- getCMSFields()
- 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.
- getKeyDir() — Returns the location of the projects key dir if one exists.
- getLocalCVSPath()
- getPrivateKeyPath() — This returns that path of the private key if a key directory is set. It doesn't check whether the file exists.
- getProcessEnv() — Build an environment variable array to be used with this project.
- getPublicKey() — Fetch the public key for this project.
- getPublicKeyPath() — This returns that path of the public key if a key directory is set. It doesn't check whether the file exists.
- getRepository()
- getRepositoryURL() — Provide current repository URL to the users.
- getUsedQuotaMB() — Return the used quota in MB.
- getViewersList() — Get a string of people allowed to view this project
- onAfterDelete() — Delete related environments and folders
- onBeforeWrite() — Checks for missing folders folder and schedules a git clone if the necessary
- projectFolderExists()
- repoExists()
- setCreateProjectFolderField() — If there isn't a capistrano env project folder, show options to create one