Skip to content

state:set

Set a state value.

Examples

  • state:set sset system.maintenance_mode 1 --input-format=integer
  • state:set system.cron_last 1406682882 --input-format=integer
  • state:set php -r "print json_encode(array('drupal', 'simpletest'));" | drush state-set --input-format=json foo.name -
  • state:set twig_debug TRUE
  • state:set twig_autoreload TRUE
  • state:set twig_cache_disable TRUE
  • state:set disable_rendered_output_cache_bins TRUE

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]

Global Options

  • -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
  • -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
  • -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
  • To see all global options, run drush core:global-options.

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.