final class PackPackageCommand extends Command (View source)

Constants

RETURN_CODE_ON_FAILURE

The return code we should return when an exception is thrown while running the command.

ALLOWASROOT_OPTION

The name of the CLI option that allows running CLI commands as root without confirmation.

ALLOWASROOT_ENV

The name of the environment variable that allows running CLI commands as root without confirmation.

PACKAGEFORMAT_LEGACY

PACKAGEFORMAT_CURRENT

SHORTTAGS_ALL

SHORTTAGS_KEEPECHO

SHORTTAGS_NO

KEEP_DOT

KEEP_SOURCES

YNA_YES

YNA_AUTO

YNA_NO

ZIPOUT_AUTO

Properties

protected InputInterface $input from  Command
protected OutputStyle $output from  Command
protected string $name from  Command
protected string $description from  Command
protected bool $hidden from  Command
protected string $signature

The command signature

from  Command
protected bool $canRunAsRoot

Can this command be executed as root? If set to false, the command can be executed if one of these conditions is satisfied:

  • the users is not root
  • the --allow-as-root option is set
  • the C5_CLI_ALLOW_AS_ROOT environment variable is set
  • the console is interactive and the user explicitly confirm the operation.
from  Command

Methods

__construct($name = null)

No description

from  Command
void
configureUsingFluentDefinition()

Configure the console command using a fluent definition.

from  Command
void
specifyParameters()

Specify the arguments and options on the command.

from  Command
array
getArguments()

Get the arguments for this command

from  Command
array
getOptions()

Get the options for this command

from  Command
run(InputInterface $input, OutputInterface $output)

{@inheritdoc}

from  Command
initialize(InputInterface $input, OutputInterface $output)

{@inheritdoc}

from  Command
writeError(OutputInterface $output, Exception|Throwable $error) deprecated

Write an exception.

from  Command
addEnvOption()

Add the "env" option to the command options.

from  Command
$this
setCanRunAsRoot(bool $canRunAsRoot)

Allow/disallow running this command as root without confirmation.

from  Command
bool|null
isRunningAsRoot()

Is the current user root?

from  Command
confirmRunningAsRoot(InputInterface $input, OutputInterface $output)

No description

from  Command
mixed
execute(InputInterface $input, OutputInterface $output)

This method is overridden to pipe execution to the handle method hiding input and output

int
call(string $command, array $arguments = [])

Call another console command.

from  Command
int
callSilent(string $command, array $arguments = [])

Call another console command silently.

from  Command
bool
hasArgument(string|int $name)

Determine if the given argument is present.

from  Command
string|array
argument(string|null $key = null)

Get the value of a command argument.

from  Command
array
arguments()

Get all of the arguments passed to the command.

from  Command
bool
hasOption(string $name)

Determine if the given option is present.

from  Command
string|array
option(string $key = null)

Get the value of a command option.

from  Command
array
options()

Get all of the options passed to the command.

from  Command
bool
confirm(string $question, bool $default = false)

Confirm a question with the user.

from  Command
string
ask(string $question, string $default = null)

Prompt the user for input.

from  Command
string
askWithCompletion(string $question, array $choices, string $default = null, null $attempts = null, null $strict = null)

Prompt the user for input with auto completion.

from  Command
string
secret(string $question, bool $fallback = true)

Prompt the user for input but hide the answer from the console.

from  Command
string
choice(string $question, array $choices, string $default = null, mixed $attempts = null, bool $multiple = null)

Give the user a single choice from an array of answers.

from  Command
void
table(array $headers, array $rows, string $tableStyle = 'default', array $columnStyles = [])

Format input to textual table.

from  Command
Application|Application
getApplication()

No description

from  Command
configure()

No description

static stdClass
parseInput(InputInterface $input)

No description

static 
processDirectory($state, OutputInterface $output, $dirAbs, $dirRel)

No description

static string|null
expandShortTags($phpFile, $expandShortEcho)

No description

Details

__construct($name = null)

No description

Parameters

$name

protected void configureUsingFluentDefinition()

Configure the console command using a fluent definition.

Return Value

void

protected void specifyParameters()

Specify the arguments and options on the command.

Return Value

void

protected array getArguments()

Get the arguments for this command

If $this->signature is specified, this method has no effect.

Return Value

array

[[$name, $mode = null, $description = '', $default = null], ...]

protected array getOptions()

Get the options for this command

If $this->signature is specified, this method has no effect.

Return Value

array

[[$name, $shortcut = null, $mode = null, $description = '', $default = null], ...]

run(InputInterface $input, OutputInterface $output)

{@inheritdoc}

Parameters

InputInterface $input
OutputInterface $output

protected initialize(InputInterface $input, OutputInterface $output)

{@inheritdoc}

Parameters

InputInterface $input
OutputInterface $output

See also

\Symfony\Component\Console\Command\Command::initialize()

protected writeError(OutputInterface $output, Exception|Throwable $error) deprecated

deprecated Use $this->output to manage your output

Write an exception.

Parameters

OutputInterface $output
Exception|Throwable $error

See also

\Concrete\Core\Console\OutputStyle::error()

protected Command addEnvOption()

Add the "env" option to the command options.

Return Value

Command

protected $this setCanRunAsRoot(bool $canRunAsRoot)

Allow/disallow running this command as root without confirmation.

Parameters

bool $canRunAsRoot

if false the command can be executed if one of these conditions is satisfied:

  • the users is not root
  • the --allow-as-root option is set
  • the C5_CLI_ALLOW_AS_ROOT environment variable is set
  • the console is interactive and the user explicitly confirm the operation

Return Value

$this

protected bool|null isRunningAsRoot()

Is the current user root?

Return Value

bool|null

NULL if unknown, or boolean if determined

protected confirmRunningAsRoot(InputInterface $input, OutputInterface $output)

No description

Parameters

InputInterface $input
OutputInterface $output

Exceptions

UserMessageException

protected mixed execute(InputInterface $input, OutputInterface $output)

This method is overridden to pipe execution to the handle method hiding input and output

Parameters

InputInterface $input
OutputInterface $output

Return Value

mixed

int call(string $command, array $arguments = [])

Call another console command.

Parameters

string $command
array $arguments

Return Value

int

int callSilent(string $command, array $arguments = [])

Call another console command silently.

Parameters

string $command
array $arguments

Return Value

int

bool hasArgument(string|int $name)

Determine if the given argument is present.

Parameters

string|int $name

Return Value

bool

string|array argument(string|null $key = null)

Get the value of a command argument.

Parameters

string|null $key

Return Value

string|array

array arguments()

Get all of the arguments passed to the command.

Return Value

array

bool hasOption(string $name)

Determine if the given option is present.

Parameters

string $name

Return Value

bool

string|array option(string $key = null)

Get the value of a command option.

Parameters

string $key

Return Value

string|array

array options()

Get all of the options passed to the command.

Return Value

array

bool confirm(string $question, bool $default = false)

Confirm a question with the user.

Parameters

string $question
bool $default

Return Value

bool

string ask(string $question, string $default = null)

Prompt the user for input.

Parameters

string $question
string $default

Return Value

string

string askWithCompletion(string $question, array $choices, string $default = null, null $attempts = null, null $strict = null)

Prompt the user for input with auto completion.

Parameters

string $question
array $choices
string $default
null $attempts
null $strict

Return Value

string

string secret(string $question, bool $fallback = true)

Prompt the user for input but hide the answer from the console.

Parameters

string $question
bool $fallback

Return Value

string

string choice(string $question, array $choices, string $default = null, mixed $attempts = null, bool $multiple = null)

Give the user a single choice from an array of answers.

Parameters

string $question
array $choices
string $default
mixed $attempts
bool $multiple

Return Value

string

void table(array $headers, array $rows, string $tableStyle = 'default', array $columnStyles = [])

Format input to textual table.

Parameters

array $headers
array $rows
string $tableStyle
array $columnStyles

Return Value

void

Application|Application getApplication()

No description

Return Value

Application|Application

protected configure()

No description

static protected stdClass parseInput(InputInterface $input)

No description

Parameters

InputInterface $input

Return Value

stdClass

{

@var string $packageHandle The package handle @var string $packageDirectory The package directory @var string|null $packageVersion The package version (if retrieved) @var string|null $packageFormat The package format (if retrieved) - One of the PackPackageCommand::PACKAGEFORMAT constants @var string $shortTags One of the PackPackageCommand::SHORTTAGS constants @var string $compileIcons One of the PackPackageCommand::YNA constants @var string $compileTranslations One of the PackPackageCommand::YNA constants @var array $keep List of PackPackageCommand::KEEP_ constants @var bool $updateSourceDirectory @var string|null $zipFilename }

static private processDirectory($state, OutputInterface $output, $dirAbs, $dirRel)

No description

Parameters

$state
OutputInterface $output
$dirAbs
$dirRel

static protected string|null expandShortTags($phpFile, $expandShortEcho)

No description

Parameters

$phpFile
$expandShortEcho

Return Value

string|null