PHP Class Platformsh\Cli\Local\LocalApplication

Show file Open project: commerceguys/platform-cli Class Usage Examples

Protected Properties

Property Type Description
$appRoot
$cliConfig
$config
$sourceDir

Public Methods

Method Description
__construct ( string $appRoot, CliConfig $cliConfig = null, string | null $sourceDir = null )
getApplication ( string | null $name, string $directory, CliConfig $config = null ) : LocalApplication Get a single application by name.
getApplications ( string $directory, CliConfig $config = null ) : LocalApplication[] Get a list of applications in a directory.
getConfig ( ) : array Get the application's configuration, parsed from its YAML definition.
getDocumentRoot ( ) : string Get the configured document root for the application, as a relative path.
getId ( ) : string Get a unique identifier for this app.
getName ( ) : string | null
getRoot ( ) : string
getSharedFileMounts ( ) : array Get a list of shared file mounts configured for the app.
getToolstack ( ) : Platformsh\Cli\Local\Toolstack\ToolstackInterface | false Get the toolstack for the application.
getToolstacks ( ) : Platformsh\Cli\Local\Toolstack\ToolstackInterface[]
setConfig ( array $config ) Override the application config.
shouldMoveToRoot ( ) : string Check whether the whole app should be moved into the document root.

Protected Methods

Method Description
getPath ( ) : string
normalizeConfig ( array $config ) : array Normalize an application's configuration.

Method Details

__construct() public method

public __construct ( string $appRoot, CliConfig $cliConfig = null, string | null $sourceDir = null )
$appRoot string
$cliConfig Platformsh\Cli\CliConfig
$sourceDir string | null

getApplication() public static method

Get a single application by name.
public static getApplication ( string | null $name, string $directory, CliConfig $config = null ) : LocalApplication
$name string | null The application name.
$directory string The absolute path to a directory.
$config Platformsh\Cli\CliConfig CLI configuration.
return LocalApplication

getApplications() public static method

Get a list of applications in a directory.
public static getApplications ( string $directory, CliConfig $config = null ) : LocalApplication[]
$directory string The absolute path to a directory.
$config Platformsh\Cli\CliConfig CLI configuration.
return LocalApplication[]

getConfig() public method

Get the application's configuration, parsed from its YAML definition.
public getConfig ( ) : array
return array

getDocumentRoot() public method

Get the configured document root for the application, as a relative path.
public getDocumentRoot ( ) : string
return string

getId() public method

Get a unique identifier for this app.
public getId ( ) : string
return string

getName() public method

public getName ( ) : string | null
return string | null

getPath() protected method

protected getPath ( ) : string
return string

getRoot() public method

public getRoot ( ) : string
return string

getSharedFileMounts() public method

Get a list of shared file mounts configured for the app.
public getSharedFileMounts ( ) : array
return array An array of shared file mount paths, keyed by the path in the app. Leading and trailing slashes are stripped.

getToolstack() public method

Get the toolstack for the application.
public getToolstack ( ) : Platformsh\Cli\Local\Toolstack\ToolstackInterface | false
return Platformsh\Cli\Local\Toolstack\ToolstackInterface | false

getToolstacks() public method

public getToolstacks ( ) : Platformsh\Cli\Local\Toolstack\ToolstackInterface[]
return Platformsh\Cli\Local\Toolstack\ToolstackInterface[]

normalizeConfig() protected method

Normalize an application's configuration.
protected normalizeConfig ( array $config ) : array
$config array
return array

setConfig() public method

Override the application config.
public setConfig ( array $config )
$config array

shouldMoveToRoot() public method

Check whether the whole app should be moved into the document root.
public shouldMoveToRoot ( ) : string
return string

Property Details

$appRoot protected property

protected $appRoot

$cliConfig protected property

protected $cliConfig

$config protected property

protected $config

$sourceDir protected property

protected $sourceDir