Skip to content

state:set

Set a state value.

Examples

  • drush sset system.maintenance_mode 1 --input-format=integer. Put site into Maintenance mode.
  • drush state:set system.cron_last 1406682882 --input-format=integer. Sets a timestamp for last cron run.
  • php -r "print json_encode(array(\'drupal\', \'simpletest\'));" | drush state-set --input-format=json foo.name -. Set a key to a complex value (e.g. array)

Arguments

  • --key. The state key, for example: system.cron_last.
  • --value. The value to assign to the state key. Use - to read from STDIN.

Options

  • --input-format[=INPUT-FORMAT]. Type for the value. Other recognized values: string, integer, float, boolean, json, yaml. [default: auto]
  • --value=VALUE. For internal use only.

Aliases

  • sset
  • state-set

Legend

  • An argument or option with square brackets is optional.
  • Any default value is listed at end of arg/option description.
  • An ellipsis indicates that an argument accepts multiple values separated by a space.