Drupal 8 configuration management
Video of the presentation: http://2014.drupalcampmsk.ru/node/44 (Russian)
You can also check my article on this topic: http://amazeelabs.com/node/1093 (English)
Alexander Tkachev @ Amazee Labs
DrupalConf Moscow 2014
6. Background:
types of information
• Content
• Session
• State
• Configuration
• Simple Configuration
• Configuration Entities
7. Where configuration lives
// file: settings.php
$config_directories['active'] =
'sites/default/files/config_XXXX/active';
$config_directories['staging'] =
'sites/default/files/config_XXXX/staging';
Directories are empty by default. Active configuration is stored in
the database for security and speed reasons.
How to move under Git:
simplest way -> remove "/files"
best practice -> outside Drupal root
16. The same with Drush
$ drush config-export
The current contents of your export directory (sites/default/config_XXXX/staging) will be
deleted. (y/n): y
Configuration successfully exported to sites/default/config_XXXX/staging. [success]
$ drush config-import
Collection Config Operation
system.site update
Import the listed configuration changes? (y/n): y
The configuration was imported successfully. [success]
29. # file: core/modules/system/config/install/system.maintenance.yml
message: '@site is currently under maintenance. We should be back shortly. langcode: en
# file: core/modules/system/config/schema/system.schema.yml
system.maintenance:
type: mapping
label: 'Maintenance mode'
mapping:
message:
type: text
label: 'Message to display when in maintenance mode'
langcode:
type: string
label: 'Default language'
30. # file: core/modules/system/config/install/system.maintenance.yml
message: '@site is currently under maintenance. We should be back shortly. langcode: en
# file: core/modules/system/config/schema/system.schema.yml
system.maintenance:
type: mapping
label: 'Maintenance mode'
mapping:
message:
type: text
label: 'Message to display when in maintenance mode'
langcode:
type: string
label: 'Default language'
# file: core/config/schema/core.data_types.schema.yml
text:
type: string
label: 'Text'
translatable: true
# ...
string:
class: 'DrupalCoreTypedDataPluginDataTypeString'
label: 'String'
31. # file: core/modules/system/config/install/system.maintenance.yml
message: '@site is currently under maintenance. We should be back shortly. langcode: en
# file: core/modules/system/config/schema/system.schema.yml
system.maintenance:
type: mapping
label: 'Maintenance mode'
mapping:
message:
type: text
label: 'Message to display when in maintenance mode'
langcode:
type: string
label: 'Default language'
# file: core/config/schema/core.data_types.schema.yml
text:
type: string
label: 'Text'
translatable: true
# ...
string:
class: 'DrupalCoreTypedDataPluginDataTypeString'
label: 'String'
32. # file: core/modules/system/config/install/system.maintenance.yml
message: '@site is currently under maintenance. We should be back shortly. langcode: en
# file: core/modules/system/config/schema/system.schema.yml
system.maintenance:
type: mapping
label: 'Maintenance mode'
mapping:
message:
type: text
label: 'Message to display when in maintenance mode'
langcode:
type: string
label: 'Default language'
# file: core/config/schema/core.data_types.schema.yml
text:
type: string
label: 'Text'
translatable: true
# ...
string:
class: 'DrupalCoreTypedDataPluginDataTypeString'
label: 'String'