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 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

run(InputInterface $input, OutputInterface $output)

{@inheritdoc}

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

{@inheritdoc}

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

Write an exception.

from Command
$this
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
configure()

No description

execute(InputInterface $input, OutputInterface $output)

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

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)

Write an exception.

Parameters

OutputInterface $output
Exception|Throwable $error

protected $this addEnvOption()

Add the "env" option to the command options.

Return Value

$this

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)

Parameters

InputInterface $input
OutputInterface $output

Exceptions

UserMessageException

protected configure()

protected execute(InputInterface $input, OutputInterface $output)

Parameters

InputInterface $input
OutputInterface $output

static protected stdClass parseInput(InputInterface $input)

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)

Parameters

$state
OutputInterface $output
$dirAbs
$dirRel

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

Parameters

$phpFile
$expandShortEcho

Return Value

string|null