PHP Class Platformsh\Cli\Local\LocalProject

Afficher le fichier Open project: commerceguys/platform-cli Class Usage Examples

Protected Properties

Свойство Type Description
$config
$fs
$projectConfigs

Méthodes publiques

Méthode Description
__construct ( CliConfig $config = null )
ensureGitRemote ( string $dir, string $url ) Ensure there are appropriate Git remotes in the repository.
ensureLocalDir ( string $projectRoot )
getLegacyProjectRoot ( ) : string | false Find the legacy root of the current project, from CLI versions <3.
getProjectConfig ( string $projectRoot = null ) : array | null Get the configuration for the current project.
getProjectRoot ( ) : string | false Find the root of the current project.
writeCurrentProjectConfig ( array $config, string $projectRoot = null, boolean $merge = false ) : array Write configuration for a project.
writeGitExclude ( string $dir ) Write to the Git exclude file.

Méthodes protégées

Méthode Description
findTopDirectoryContaining ( string $file, callable $callback = null ) : string | false Find the highest level directory that contains a file.
getGitRemoteUrl ( string $dir ) : string | false
parseGitUrl ( string $gitUrl ) : array | false

Method Details

__construct() public méthode

public __construct ( CliConfig $config = null )
$config Platformsh\Cli\CliConfig

ensureGitRemote() public méthode

Ensure there are appropriate Git remotes in the repository.
public ensureGitRemote ( string $dir, string $url )
$dir string
$url string

ensureLocalDir() public méthode

public ensureLocalDir ( string $projectRoot )
$projectRoot string

findTopDirectoryContaining() protected static méthode

Find the highest level directory that contains a file.
protected static findTopDirectoryContaining ( string $file, callable $callback = null ) : string | false
$file string The filename to look for.
$callback callable A callback to validate the directory when found. Accepts one argument (the directory path). Return true to use the directory, or false to continue traversing upwards.
Résultat string | false The path to the directory, or false if the file is not found.

getGitRemoteUrl() protected méthode

protected getGitRemoteUrl ( string $dir ) : string | false
$dir string
Résultat string | false The Git remote URL.

getLegacyProjectRoot() public méthode

Find the legacy root of the current project, from CLI versions <3.
public getLegacyProjectRoot ( ) : string | false
Résultat string | false

getProjectConfig() public méthode

Get the configuration for the current project.
public getProjectConfig ( string $projectRoot = null ) : array | null
$projectRoot string
Résultat array | null The current project's configuration.

getProjectRoot() public méthode

Find the root of the current project.
public getProjectRoot ( ) : string | false
Résultat string | false

parseGitUrl() protected méthode

protected parseGitUrl ( string $gitUrl ) : array | false
$gitUrl string
Résultat array | false An array containing 'id' and 'host', or false on failure.

writeCurrentProjectConfig() public méthode

Configuration is stored as YAML, in the location configured by 'local.project_config'.
public writeCurrentProjectConfig ( array $config, string $projectRoot = null, boolean $merge = false ) : array
$config array The configuration.
$projectRoot string The project root.
$merge boolean Whether to merge with existing configuration.
Résultat array The updated project configuration.

writeGitExclude() public méthode

Write to the Git exclude file.
public writeGitExclude ( string $dir )
$dir string

Property Details

$config protected_oe property

protected $config

$fs protected_oe property

protected $fs

$projectConfigs protected_oe static_oe property

protected static $projectConfigs