HasCacheOption
Provides the standard cache option used by cache-writing commands.
Methods
Adds the standard cache directory option to the current command.
Adds the standard cache control option to the current command.
Resolves whether cache writes SHOULD be enabled for the current invocation.
Returns the explicit cache flag that SHOULD be forwarded to nested commands.
Resolves a nested cache directory for a child command.
Determines whether the current invocation explicitly passed `--cache-dir`.
Determines whether cache writes were explicitly disabled for the current invocation.
Adds the standard cache directory option to the current command.
protected
addCacheDirOption(
string
$description,
string
$default) : static
Parameters
$description
:
string
Description
the cache directory option description
$default
:
string
Description
the command-specific default cache directory
Return values
Adds the standard cache control option to the current command.
protected
addCacheOption(
string
$description) : static
Parameters
$description
:
string
Description
the cache option description
Return values
Resolves whether cache writes SHOULD be enabled for the current invocation.
protected
isCacheEnabled(InputInterface
$input[,
bool
$default = true]) : bool
Parameters
$input
:
InputInterface
Description
the current command input
$default
:
bool
=
true
Description
the command-specific default cache behavior when the option is omitted
Return values
Returns the explicit cache flag that SHOULD be forwarded to nested commands.
protected
resolveCacheArgument(InputInterface
$input) : string|null
Parameters
$input
:
InputInterface
Description
the current command input
Return values
Resolves a nested cache directory for a child command.
protected
resolveCacheDirArgument(InputInterface
$input[,
string
$path = '']) : string|null
Parameters
$input
:
InputInterface
Description
the current command input
$path
:
string
=
''
Description
the child cache path relative to the current command cache root
Return values
Determines whether the current invocation explicitly passed `--cache-dir`.
private
hasExplicitCacheDirArgument(InputInterface
$input) : bool
Parameters
$input
:
InputInterface
Description
the current command input
Return values
Determines whether cache writes were explicitly disabled for the current invocation.
private
isNoCacheRequested(InputInterface
$input) : bool
Description
The Composer application already provides a global --no-cache flag, so commands
SHALL reuse that switch instead of redefining a local negated variant.
Parameters
$input
:
InputInterface
Description
the current command input