Drupal Configuration Management
// D7
variable_set('my_data', 'foo');
$data = variable_get('my_data', 'bar');
variable_del('my_data');
// D8
\Drupal::state()->set('my_data', 'foo');
$data = \Drupal::state()->get('my_data') ?: 'bar';
\Drupal::state()->delete('my_data');
// See https://www.drupal.org/node/1787318
Configuration management
/**
* EXPORT
*/
$ drupal config:export [options]
$ ce
/**
* IMPORT
*/
$ drupal config:import [options]
$ ci
/**
* Override config value in active configuration.
*/
$ drupal config:override [arguments]
$ co
Ex: $ drupal config:override contact.settings flood.limit 10
/**
* Drupal settings.php configuration
* see https://www.drupal.org/docs/8/configuration-management/changing-the-storage-location-of-the-sync-directory
*/
$config_directories[CONFIG_SYNC_DIRECTORY] = 'sites/default/sync';