class StateCommands extends DrushCommands implements StdinAwareInterface (View source)

Traits

StdinAwareTrait
ProcessManagerAwareTrait
LoggerAwareTrait
IO
ConfigAwareTrait

Constants

REQ

OPT

EXIT_SUCCESS

EXIT_FAILURE

Properties

protected $state

Methods

getConfig()

Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.

__construct(StateInterface $state)

No description

io()

Override Robo's IO function with our custom style.

LoggerInterface
logger()

Returns a logger object.

printFile(string $file)

Print the contents of a file.

StateInterface
getState()

No description

PropertyList
get($key, $options = ['format' => 'string'])

Display a state value.

void
set($key, $value, $options = ['input-format' => 'auto', 'value' => self::REQ])

Set a state value.

void
delete(string $key)

Delete a state entry.

static 
format($value, $format)

No description

Details

DrushConfig getConfig()

Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.

__construct(StateInterface $state)

Parameters

StateInterface $state

protected io()

Override Robo's IO function with our custom style.

protected LoggerInterface logger()

Returns a logger object.

Return Value

LoggerInterface

protected printFile(string $file)

Print the contents of a file.

Parameters

string $file Full path to a file.

StateInterface getState()

Return Value

StateInterface

PropertyList get($key, $options = ['format' => 'string'])

Display a state value.

Parameters

$key
$options

Return Value

PropertyList

void set($key, $value, $options = ['input-format' => 'auto', 'value' => self::REQ])

Set a state value.

Parameters

$key
$value
$options

Return Value

void

void delete(string $key)

Delete a state entry.

Parameters

string $key The state key, for example "system.cron_last".

Return Value

void

static format($value, $format)

Parameters

$value
$format