PHP Класс Platformsh\Cli\Command\CommandBase

Наследование: extends Symfony\Component\Console\Command\Command, implements Platformsh\Cli\Command\CanHideInListInterface, use trait Platformsh\Cli\Command\HasExamplesTrait
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$canBeRunMultipleTimes
$config Platformsh\Cli\CliConfig
$envArgName
$hiddenInList
$interactive boolean
$local
$localProject Platformsh\Cli\Local\LocalProject | null
$output Symfony\Component\Console\Output\OutputInterface | null
$runningViaMulti
$stdErr Symfony\Component\Console\Output\OutputInterface | null

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

Метод Описание
__construct ( $name = null )
canBeRunMultipleTimes ( )
getCurrentEnvironment ( Platformsh\Client\Model\Project $expectedProject = null, boolean | null $refresh = null ) : Platformsh\Client\Model\Environment | false Get the current environment if the user is in a project directory.
getCurrentProject ( ) : Platformsh\Client\Model\Project | false Get the current project if the user is in a project directory.
getHelper ( $name )
getProcessedHelp ( )
getProjectRoot ( ) : string | false
getSynopsis ( $short = false )
getVisibleAliases ( ) : array Get aliases that should be visible in help.
isHiddenInList ( )
isLocal ( ) : boolean Is this a local command? (if it does not make API requests)
login ( ) Log in the user.
setRunningViaMulti ( $runningViaMulti = true )
updateDrushAliases ( EnvironmentsChangedEvent $event ) Update the user's local Drush aliases.

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

Метод Описание
addAppOption ( ) : CommandBase Add the --app option.
addEnvironmentOption ( ) : CommandBase Add the --environment option.
addNoWaitOption ( string $description = 'Do not wait for the operation to complete' ) : CommandBase Add the --no-wait option.
addProjectOption ( ) : CommandBase Add the --project and --host options.
api ( ) : Api Set up the API object.
checkUpdates ( boolean $reset = false ) Check for updates.
debug ( string $message ) Print a message if debug output is enabled.
getHomeDir ( ) : string
getSelectedEnvironment ( ) : Platformsh\Client\Model\Environment Get the environment selected by the user.
getSelectedProject ( ) : Platformsh\Client\Model\Project Get the project selected by the user.
getSessionsDir ( ) : string
hasSelectedEnvironment ( ) : boolean Check whether a single environment is selected.
hasSelectedProject ( ) : boolean Check whether a project is selected.
initialize ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
interact ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
isTerminal ( Symfony\Component\Console\Output\OutputInterface $output ) : boolean Detect automatically whether the output is a TTY terminal.
parseProjectId ( string $url ) : array Parse the project ID and possibly other details from a provided URL.
promptLegacyMigrate ( ) Prompt the user to migrate from the legacy project file structure.
rebuildWarning ( ) Warn the user that the remote environment needs rebuilding.
runOtherCommand ( string $name, array $arguments = [], Symfony\Component\Console\Output\OutputInterface $output = null ) : integer Run another CLI command.
selectApp ( Symfony\Component\Console\Input\InputInterface $input, callable $filter = null ) : string | null Find the name of the app the user wants to use for an SSH command.
selectEnvironment ( string | null $environmentId = null ) : Platformsh\Client\Model\Environment Select the current environment for the user.
selectProject ( string $projectId = null, string $host = null ) : Platformsh\Client\Model\Project Select the project for the user, based on input or the environment.
selectedProjectIsCurrent ( ) : boolean
setHiddenAliases ( array $hiddenAliases ) : CommandBase Add aliases that should be hidden from help.
setProjectRoot ( string $root )
validateInput ( Symfony\Component\Console\Input\InputInterface $input, boolean $envNotRequired = false )

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

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

public __construct ( $name = null )

addAppOption() защищенный метод

Add the --app option.
protected addAppOption ( ) : CommandBase
Результат CommandBase

addEnvironmentOption() защищенный метод

Add the --environment option.
protected addEnvironmentOption ( ) : CommandBase
Результат CommandBase

addNoWaitOption() защищенный метод

Add the --no-wait option.
protected addNoWaitOption ( string $description = 'Do not wait for the operation to complete' ) : CommandBase
$description string
Результат CommandBase

addProjectOption() защищенный метод

Add the --project and --host options.
protected addProjectOption ( ) : CommandBase
Результат CommandBase

api() защищенный метод

Set up the API object.
protected api ( ) : Api
Результат Platformsh\Cli\Api

canBeRunMultipleTimes() публичный метод

checkUpdates() защищенный метод

Check for updates.
protected checkUpdates ( boolean $reset = false )
$reset boolean

debug() защищенный метод

Print a message if debug output is enabled.
protected debug ( string $message )
$message string

getCurrentEnvironment() публичный метод

Get the current environment if the user is in a project directory.
public getCurrentEnvironment ( Platformsh\Client\Model\Project $expectedProject = null, boolean | null $refresh = null ) : Platformsh\Client\Model\Environment | false
$expectedProject Platformsh\Client\Model\Project The expected project.
$refresh boolean | null Whether to refresh the environments or projects cache.
Результат Platformsh\Client\Model\Environment | false The current environment.

getCurrentProject() публичный метод

Get the current project if the user is in a project directory.
public getCurrentProject ( ) : Platformsh\Client\Model\Project | false
Результат Platformsh\Client\Model\Project | false The current project

getHelper() публичный метод

public getHelper ( $name )

getHomeDir() защищенный метод

protected getHomeDir ( ) : string
Результат string

getProcessedHelp() публичный метод

Overrides the default method so that the description is not repeated twice.
public getProcessedHelp ( )

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

public getProjectRoot ( ) : string | false
Результат string | false

getSelectedEnvironment() защищенный метод

The project is selected via validateInput(), if there is an --environment option in the command.
protected getSelectedEnvironment ( ) : Platformsh\Client\Model\Environment
Результат Platformsh\Client\Model\Environment

getSelectedProject() защищенный метод

The project is selected via validateInput(), if there is a --project option in the command.
protected getSelectedProject ( ) : Platformsh\Client\Model\Project
Результат Platformsh\Client\Model\Project

getSessionsDir() защищенный метод

protected getSessionsDir ( ) : string
Результат string

getSynopsis() публичный метод

public getSynopsis ( $short = false )

getVisibleAliases() публичный метод

Get aliases that should be visible in help.
public getVisibleAliases ( ) : array
Результат array

hasSelectedEnvironment() защищенный метод

Check whether a single environment is selected.
protected hasSelectedEnvironment ( ) : boolean
Результат boolean

hasSelectedProject() защищенный метод

Check whether a project is selected.
protected hasSelectedProject ( ) : boolean
Результат boolean

initialize() защищенный метод

protected initialize ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface

interact() защищенный метод

protected interact ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface

isHiddenInList() публичный метод

public isHiddenInList ( )

isLocal() публичный метод

Is this a local command? (if it does not make API requests)
public isLocal ( ) : boolean
Результат boolean

isTerminal() защищенный метод

Detect automatically whether the output is a TTY terminal.
protected isTerminal ( Symfony\Component\Console\Output\OutputInterface $output ) : boolean
$output Symfony\Component\Console\Output\OutputInterface
Результат boolean

login() публичный метод

This is called via the 'login_required' event.
См. также: Api::getClient()
public login ( )

parseProjectId() защищенный метод

Parse the project ID and possibly other details from a provided URL.
protected parseProjectId ( string $url ) : array
$url string A web UI, API, or public URL of the project.
Результат array An array of containing at least a 'projectId'. Keys 'host', 'environmentId', and 'appId' will be either null or strings.

promptLegacyMigrate() защищенный метод

If the input is interactive, the user will be asked to migrate up to once per hour. The time they were last asked will be stored in the project configuration. If the input is not interactive, the user will be warned (on every command run) that they should run the 'legacy-migrate' command.
protected promptLegacyMigrate ( )

rebuildWarning() защищенный метод

Warn the user that the remote environment needs rebuilding.
protected rebuildWarning ( )

runOtherCommand() защищенный метод

Run another CLI command.
protected runOtherCommand ( string $name, array $arguments = [], Symfony\Component\Console\Output\OutputInterface $output = null ) : integer
$name string The name of the other command.
$arguments array Arguments for the other command.
$output Symfony\Component\Console\Output\OutputInterface The output for the other command. Defaults to the current output.
Результат integer

selectApp() защищенный метод

Find the name of the app the user wants to use for an SSH command.
protected selectApp ( Symfony\Component\Console\Input\InputInterface $input, callable $filter = null ) : string | null
$input Symfony\Component\Console\Input\InputInterface The user input object.
$filter callable A filter callback that takes one argument: a LocalApplication object.
Результат string | null The application name, or null if it could not be found.

selectEnvironment() защищенный метод

Select the current environment for the user.
protected selectEnvironment ( string | null $environmentId = null ) : Platformsh\Client\Model\Environment
$environmentId string | null The environment ID specified by the user, or null to auto-detect the environment.
Результат Platformsh\Client\Model\Environment

selectProject() защищенный метод

Select the project for the user, based on input or the environment.
protected selectProject ( string $projectId = null, string $host = null ) : Platformsh\Client\Model\Project
$projectId string
$host string
Результат Platformsh\Client\Model\Project

selectedProjectIsCurrent() защищенный метод

protected selectedProjectIsCurrent ( ) : boolean
Результат boolean

setHiddenAliases() защищенный метод

Add aliases that should be hidden from help.
См. также: parent::setAliases()
protected setHiddenAliases ( array $hiddenAliases ) : CommandBase
$hiddenAliases array
Результат CommandBase

setProjectRoot() защищенный метод

protected setProjectRoot ( string $root )
$root string

setRunningViaMulti() публичный метод

public setRunningViaMulti ( $runningViaMulti = true )

updateDrushAliases() публичный метод

This is called via the 'environments_changed' event.
См. также: Api::getEnvironments()
public updateDrushAliases ( EnvironmentsChangedEvent $event )
$event Platformsh\Cli\Event\EnvironmentsChangedEvent

validateInput() защищенный метод

protected validateInput ( Symfony\Component\Console\Input\InputInterface $input, boolean $envNotRequired = false )
$input Symfony\Component\Console\Input\InputInterface
$envNotRequired boolean

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

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

protected $canBeRunMultipleTimes

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

protected static CliConfig,Platformsh\Cli $config
Результат Platformsh\Cli\CliConfig

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

protected $envArgName

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

protected $hiddenInList

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

protected static bool $interactive
Результат boolean

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

protected $local

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

protected LocalProject,Platformsh\Cli\Local|null $localProject
Результат Platformsh\Cli\Local\LocalProject | null

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

protected OutputInterface,Symfony\Component\Console\Output|null $output
Результат Symfony\Component\Console\Output\OutputInterface | null

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

protected $runningViaMulti

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

protected OutputInterface,Symfony\Component\Console\Output|null $stdErr
Результат Symfony\Component\Console\Output\OutputInterface | null