PHP Class DNData

Inheritance: extends ViewableData
Mostra file Open project: silverstripe/deploynaut Class Usage Examples

Protected Properties

Property Type Description
$dataTransferDir string Needs to be relative to webroot, and start with assets/ since all files are also referenced in the SilverStripe database through {@link File}.
$environmentDir string Path where the environment configurations can be found.
$gitUser string | null .."
$keyDir string Path where the keys are stored.
$signalDir string Path where the signal files are created.

Public Methods

Method Description
DNProjectList ( ) : DataList Provide a list of all projects.
__construct ( $environmentDir = null, $keyDir = null, $signalDir = null, $dataTransferDir = null, $gitUser = null )
getDataTransferDir ( ) : string Get the directory where data transfers should be saved
getEnvironmentDir ( ) : string Get the directory environment code is saved
getEnvironmentPaths ( $project ) Scan the directory and enumerate all envs founds within.
getGitUser ( ) : string Get the username that git commands should be run as
getKeyDir ( ) : string Get the directory where ssh are stored
getProjectPaths ( ) : array Grabs a list of projects from the env directory. The projects in the builds directory alone will not be picked up.
getSignalDir ( ) : string
inst ( ) : DNData Gets the DNData singleton
setDataTransferDir ( string $transferDir ) Set the directory where data transfers should be saved
setEnvironmentDir ( string $environmentDir ) Set the directory environment code is saved
setGitUser ( string $user ) Get the username that git commands should be run as
setKeyDir ( string $keyDir ) Set the directory where ssh are stored
setSignalDir ( string $signalDir )

Method Details

DNProjectList() public method

Provide a list of all projects.
public DNProjectList ( ) : DataList
return DataList

__construct() public method

public __construct ( $environmentDir = null, $keyDir = null, $signalDir = null, $dataTransferDir = null, $gitUser = null )

getDataTransferDir() public method

Get the directory where data transfers should be saved
public getDataTransferDir ( ) : string
return string

getEnvironmentDir() public method

Get the directory environment code is saved
public getEnvironmentDir ( ) : string
return string

getEnvironmentPaths() public method

Returns an array of paths
public getEnvironmentPaths ( $project )

getGitUser() public method

Get the username that git commands should be run as
public getGitUser ( ) : string
return string

getKeyDir() public method

Get the directory where ssh are stored
public getKeyDir ( ) : string
return string

getProjectPaths() public method

Returns an array of paths
public getProjectPaths ( ) : array
return array

getSignalDir() public method

public getSignalDir ( ) : string
return string

inst() public static method

Gets the DNData singleton
public static inst ( ) : DNData
return DNData

setDataTransferDir() public method

This should either be an absolute path (beginning with /) or a path that can be appended to the web root safely
public setDataTransferDir ( string $transferDir )
$transferDir string

setEnvironmentDir() public method

Set the directory environment code is saved
public setEnvironmentDir ( string $environmentDir )
$environmentDir string

setGitUser() public method

Get the username that git commands should be run as
public setGitUser ( string $user )
$user string

setKeyDir() public method

Set the directory where ssh are stored
public setKeyDir ( string $keyDir )
$keyDir string

setSignalDir() public method

public setSignalDir ( string $signalDir )
$signalDir string

Property Details

$dataTransferDir protected_oe property

Needs to be relative to webroot, and start with assets/ since all files are also referenced in the SilverStripe database through {@link File}.
protected string $dataTransferDir
return string

$environmentDir protected_oe property

Path where the environment configurations can be found.
protected string $environmentDir
return string

$gitUser protected_oe property

.."
protected string|null $gitUser
return string | null

$keyDir protected_oe property

Path where the keys are stored.
protected string $keyDir
return string

$signalDir protected_oe property

Path where the signal files are created.
protected string $signalDir
return string