PHP Класс Platformsh\Cli\Local\LocalProject

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

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

Свойство Тип Описание
$config
$fs
$projectConfigs

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
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

Описание методов

__construct() публичный Метод

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

ensureGitRemote() публичный Метод

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

ensureLocalDir() публичный Метод

public ensureLocalDir ( string $projectRoot )
$projectRoot string

findTopDirectoryContaining() защищенный статический Метод

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.
Результат string | false The path to the directory, or false if the file is not found.

getGitRemoteUrl() защищенный Метод

protected getGitRemoteUrl ( string $dir ) : string | false
$dir string
Результат string | false The Git remote URL.

getLegacyProjectRoot() публичный Метод

Find the legacy root of the current project, from CLI versions <3.
public getLegacyProjectRoot ( ) : string | false
Результат string | false

getProjectConfig() публичный Метод

Get the configuration for the current project.
public getProjectConfig ( string $projectRoot = null ) : array | null
$projectRoot string
Результат array | null The current project's configuration.

getProjectRoot() публичный Метод

Find the root of the current project.
public getProjectRoot ( ) : string | false
Результат string | false

parseGitUrl() защищенный Метод

protected parseGitUrl ( string $gitUrl ) : array | false
$gitUrl string
Результат array | false An array containing 'id' and 'host', or false on failure.

writeCurrentProjectConfig() публичный Метод

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.
Результат array The updated project configuration.

writeGitExclude() публичный Метод

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

Описание свойств

$config защищенное свойство

protected $config

$fs защищенное свойство

protected $fs

$projectConfigs защищенное статическое свойство

protected static $projectConfigs