SlideShare a Scribd company logo
1 of 34
Download to read offline
http://bit.ly/d8config
Drupal 8 
configuration management
Alexander Tkachev (Leksat) 
Drupal developer @ Amazee Labs
Overview
Background: 
types of information 
• Content 
• Session 
• State 
• Configuration
Background: 
types of information 
• Content 
• Session 
• State 
• Configuration 
• Simple Configuration 
• Configuration Entities
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
# file: system.site.yml 
uuid: c78fd9aa-b327-4514-9d00-bc72a1f40f27 
name: 'My cool site' 
mail: mailbox@example.com 
slogan: 'Drupal 8 rules!' 
page: 
403: '' 
404: '' 
front: node 
admin_compact_mode: false 
weight_select_max: 100 
langcode: en
A minute of horror 
What would be if they chose XML
Export/import
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]
Basic API
# file: system.site.yml 
uuid: c78fd9aa-b327-4514-9d00-bc72a1f40f27 
name: 'My cool site' 
mail: mailbox@example.com 
slogan: 'Drupal 8 rules!' 
page: 
403: '' 
404: '' 
front: node 
admin_compact_mode: false 
weight_select_max: 100 
langcode: en
$config = Drupal::config('system.site'); 
// Instance of DrupalCoreConfigConfig
$config = Drupal::config('system.site'); 
// Instance of DrupalCoreConfigConfig 
$front_page = $config->get('page.front'); 
// 'node'
$config = Drupal::config('system.site'); 
// Instance of DrupalCoreConfigConfig 
$front_page = $config->get('page.front'); 
// 'node' 
$page_settings = $config->get('page'); 
// array( 
// '403' => '', 
// '404' => '', 
// 'front' => 'node', 
// )
$config = Drupal::config('system.site'); 
// Instance of DrupalCoreConfigConfig 
$front_page = $config->get('page.front'); 
// 'node' 
$page_settings = $config->get('page'); 
// array( 
// '403' => '', 
// '404' => '', 
// 'front' => 'node', 
// ) 
$config->set('page.front', 'my-front-page'); 
$config->save();
Module/theme defaults 
your_module 
config 
install 
your_module.settings.yml
Module/theme defaults 
your_module 
config 
install 
your_module.settings.yml 
views.view.my_cool_view.yml
Configuration override levels: 
1. settings.php 
2. modules: 
• overrides are provided by services tagged as 
config.factory.override (implementing 
ConfigFactoryOverrideInterface) 
Get raw (not overridden) data: 
1. ConfigFormBase::config() Drupal::config() 
2. Config::getRawData() 
3. Drupal::configFactory()->setOverrideState(FALSE);
React on simple config changes: 
• ConfigEvents 
(SAVE, DELETE, IMPORT etc.) 
• hook_config_import_steps_alter() 
(for complicated workflows like fields)
Configuration schema 
(metadata)
# 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/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/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'
# 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'
# 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'
Modules: 
https://www.drupal.org/project/config_tools 
https://www.drupal.org/project/config_devel 
https://www.drupal.org/project/config_readonly 
https://www.drupal.org/project/config_inspector
Вопросы? 
Leksat@AmazeeLabs*DrupalCampMsk2014 
• This presentation 
http://bit.ly/d8-configuration 
• Configuration API docs 
https://www.drupal.org/developing/api/8/configuration 
• Drupal core updates 
https://groups.drupal.org/core/updates

More Related Content

What's hot

Boosting MongoDB performance
Boosting MongoDB performanceBoosting MongoDB performance
Boosting MongoDB performanceAlexei Panin
 
Resource Routing in ExpressionEngine
Resource Routing in ExpressionEngineResource Routing in ExpressionEngine
Resource Routing in ExpressionEngineMichaelRog
 
Scaling in Mind (Case study of Drupal Core)
Scaling in Mind (Case study of Drupal Core)Scaling in Mind (Case study of Drupal Core)
Scaling in Mind (Case study of Drupal Core)jimyhuang
 
Drupal 8 Services And Dependency Injection
Drupal 8 Services And Dependency InjectionDrupal 8 Services And Dependency Injection
Drupal 8 Services And Dependency InjectionPhilip Norton
 
System performance tuning
System performance tuningSystem performance tuning
System performance tuningMenandro Oba
 
Drupal Pilipinas Apprentice: LAMP Administration, CSS, and Vagrant
Drupal Pilipinas Apprentice: LAMP Administration, CSS, and VagrantDrupal Pilipinas Apprentice: LAMP Administration, CSS, and Vagrant
Drupal Pilipinas Apprentice: LAMP Administration, CSS, and VagrantGerald Villorente
 
Facebook的缓存系统
Facebook的缓存系统Facebook的缓存系统
Facebook的缓存系统yiditushe
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linuxtutorialsruby
 
Oracle Managed Files
Oracle Managed FilesOracle Managed Files
Oracle Managed FilesAnar Godjaev
 
Zend Con 2008 Slides
Zend Con 2008 SlidesZend Con 2008 Slides
Zend Con 2008 Slidesmkherlakian
 
Getting to The Loop - London Wordpress Meetup July 28th
Getting to The Loop - London Wordpress Meetup  July 28thGetting to The Loop - London Wordpress Meetup  July 28th
Getting to The Loop - London Wordpress Meetup July 28thChris Adams
 
An introduction to CouchDB
An introduction to CouchDBAn introduction to CouchDB
An introduction to CouchDBDavid Coallier
 
PuppetConf. 2016: Puppet Best Practices: Roles & Profiles – Gary Larizza, Puppet
PuppetConf. 2016: Puppet Best Practices: Roles & Profiles – Gary Larizza, PuppetPuppetConf. 2016: Puppet Best Practices: Roles & Profiles – Gary Larizza, Puppet
PuppetConf. 2016: Puppet Best Practices: Roles & Profiles – Gary Larizza, PuppetPuppet
 
Database Connection With Mysql
Database Connection With MysqlDatabase Connection With Mysql
Database Connection With MysqlHarit Kothari
 

What's hot (20)

Boosting MongoDB performance
Boosting MongoDB performanceBoosting MongoDB performance
Boosting MongoDB performance
 
Resource Routing in ExpressionEngine
Resource Routing in ExpressionEngineResource Routing in ExpressionEngine
Resource Routing in ExpressionEngine
 
MYSQL - PHP Database Connectivity
MYSQL - PHP Database ConnectivityMYSQL - PHP Database Connectivity
MYSQL - PHP Database Connectivity
 
Scaling in Mind (Case study of Drupal Core)
Scaling in Mind (Case study of Drupal Core)Scaling in Mind (Case study of Drupal Core)
Scaling in Mind (Case study of Drupal Core)
 
Drupal 8 Services And Dependency Injection
Drupal 8 Services And Dependency InjectionDrupal 8 Services And Dependency Injection
Drupal 8 Services And Dependency Injection
 
System performance tuning
System performance tuningSystem performance tuning
System performance tuning
 
Drupal Pilipinas Apprentice: LAMP Administration, CSS, and Vagrant
Drupal Pilipinas Apprentice: LAMP Administration, CSS, and VagrantDrupal Pilipinas Apprentice: LAMP Administration, CSS, and Vagrant
Drupal Pilipinas Apprentice: LAMP Administration, CSS, and Vagrant
 
lab56_db
lab56_dblab56_db
lab56_db
 
Facebook的缓存系统
Facebook的缓存系统Facebook的缓存系统
Facebook的缓存系统
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linux
 
Working with databases
Working with databasesWorking with databases
Working with databases
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Oracle Managed Files
Oracle Managed FilesOracle Managed Files
Oracle Managed Files
 
Distribuido
DistribuidoDistribuido
Distribuido
 
Zend Con 2008 Slides
Zend Con 2008 SlidesZend Con 2008 Slides
Zend Con 2008 Slides
 
Hpage
HpageHpage
Hpage
 
Getting to The Loop - London Wordpress Meetup July 28th
Getting to The Loop - London Wordpress Meetup  July 28thGetting to The Loop - London Wordpress Meetup  July 28th
Getting to The Loop - London Wordpress Meetup July 28th
 
An introduction to CouchDB
An introduction to CouchDBAn introduction to CouchDB
An introduction to CouchDB
 
PuppetConf. 2016: Puppet Best Practices: Roles & Profiles – Gary Larizza, Puppet
PuppetConf. 2016: Puppet Best Practices: Roles & Profiles – Gary Larizza, PuppetPuppetConf. 2016: Puppet Best Practices: Roles & Profiles – Gary Larizza, Puppet
PuppetConf. 2016: Puppet Best Practices: Roles & Profiles – Gary Larizza, Puppet
 
Database Connection With Mysql
Database Connection With MysqlDatabase Connection With Mysql
Database Connection With Mysql
 

Viewers also liked

Drupal 8 configuration system for coders and site builders - DrupalCamp Balti...
Drupal 8 configuration system for coders and site builders - DrupalCamp Balti...Drupal 8 configuration system for coders and site builders - DrupalCamp Balti...
Drupal 8 configuration system for coders and site builders - DrupalCamp Balti...swentel
 
Ekaluokan mikroskooppilöydökset blogiin
Ekaluokan mikroskooppilöydökset blogiinEkaluokan mikroskooppilöydökset blogiin
Ekaluokan mikroskooppilöydökset blogiinAnu Liljeström
 
M2G May 2015 GTI Presentation
M2G May 2015 GTI PresentationM2G May 2015 GTI Presentation
M2G May 2015 GTI PresentationCharles Rice
 
HSE Courses Certificates
HSE Courses CertificatesHSE Courses Certificates
HSE Courses CertificatesMohanad Zaki
 
Dr. Kathryn E. Piquette, Cologne Center for eHumanities, Universität zu Köln:...
Dr. Kathryn E. Piquette, Cologne Center for eHumanities, Universität zu Köln:...Dr. Kathryn E. Piquette, Cologne Center for eHumanities, Universität zu Köln:...
Dr. Kathryn E. Piquette, Cologne Center for eHumanities, Universität zu Köln:...UCLDH
 
L2 keyslides
L2 keyslidesL2 keyslides
L2 keyslidest7260678
 
Eng1023 library instruction_sp2016
Eng1023 library instruction_sp2016Eng1023 library instruction_sp2016
Eng1023 library instruction_sp2016Susan Whitmer
 
Library instruction for art 1603: intro to photography
Library instruction for art 1603: intro to photographyLibrary instruction for art 1603: intro to photography
Library instruction for art 1603: intro to photographySusan Whitmer
 
MIMA Monthly January 2015 - "Content Strategy 2015: Marketing, Mobile, and th...
MIMA Monthly January 2015 - "Content Strategy 2015: Marketing, Mobile, and th...MIMA Monthly January 2015 - "Content Strategy 2015: Marketing, Mobile, and th...
MIMA Monthly January 2015 - "Content Strategy 2015: Marketing, Mobile, and th...Minnesota Interactive Marketing Association
 
งานอาเมเมเมเ
งานอาเมเมเมเงานอาเมเมเมเ
งานอาเมเมเมเmaykai
 
UW-Eau Claire's composting and the effectiveness of our composting efforts
UW-Eau Claire's composting and the effectiveness of our composting effortsUW-Eau Claire's composting and the effectiveness of our composting efforts
UW-Eau Claire's composting and the effectiveness of our composting effortsAngela Knauf
 

Viewers also liked (17)

Drupal 8 configuration system for coders and site builders - DrupalCamp Balti...
Drupal 8 configuration system for coders and site builders - DrupalCamp Balti...Drupal 8 configuration system for coders and site builders - DrupalCamp Balti...
Drupal 8 configuration system for coders and site builders - DrupalCamp Balti...
 
MIMA Monthly January 2016 - “Social Broadcasting for Business”
MIMA Monthly January 2016 - “Social Broadcasting for Business” MIMA Monthly January 2016 - “Social Broadcasting for Business”
MIMA Monthly January 2016 - “Social Broadcasting for Business”
 
Culture in Your Business
Culture in Your BusinessCulture in Your Business
Culture in Your Business
 
Perusahaan
PerusahaanPerusahaan
Perusahaan
 
Ekaluokan mikroskooppilöydökset blogiin
Ekaluokan mikroskooppilöydökset blogiinEkaluokan mikroskooppilöydökset blogiin
Ekaluokan mikroskooppilöydökset blogiin
 
Rendite
RenditeRendite
Rendite
 
M2G May 2015 GTI Presentation
M2G May 2015 GTI PresentationM2G May 2015 GTI Presentation
M2G May 2015 GTI Presentation
 
HSE Courses Certificates
HSE Courses CertificatesHSE Courses Certificates
HSE Courses Certificates
 
Dr. Kathryn E. Piquette, Cologne Center for eHumanities, Universität zu Köln:...
Dr. Kathryn E. Piquette, Cologne Center for eHumanities, Universität zu Köln:...Dr. Kathryn E. Piquette, Cologne Center for eHumanities, Universität zu Köln:...
Dr. Kathryn E. Piquette, Cologne Center for eHumanities, Universität zu Köln:...
 
L2 keyslides
L2 keyslidesL2 keyslides
L2 keyslides
 
Mohanad 123-4
Mohanad 123-4Mohanad 123-4
Mohanad 123-4
 
Lawyers in jacksonville
Lawyers in jacksonvilleLawyers in jacksonville
Lawyers in jacksonville
 
Eng1023 library instruction_sp2016
Eng1023 library instruction_sp2016Eng1023 library instruction_sp2016
Eng1023 library instruction_sp2016
 
Library instruction for art 1603: intro to photography
Library instruction for art 1603: intro to photographyLibrary instruction for art 1603: intro to photography
Library instruction for art 1603: intro to photography
 
MIMA Monthly January 2015 - "Content Strategy 2015: Marketing, Mobile, and th...
MIMA Monthly January 2015 - "Content Strategy 2015: Marketing, Mobile, and th...MIMA Monthly January 2015 - "Content Strategy 2015: Marketing, Mobile, and th...
MIMA Monthly January 2015 - "Content Strategy 2015: Marketing, Mobile, and th...
 
งานอาเมเมเมเ
งานอาเมเมเมเงานอาเมเมเมเ
งานอาเมเมเมเ
 
UW-Eau Claire's composting and the effectiveness of our composting efforts
UW-Eau Claire's composting and the effectiveness of our composting effortsUW-Eau Claire's composting and the effectiveness of our composting efforts
UW-Eau Claire's composting and the effectiveness of our composting efforts
 

Similar to Drupal 8 configuration management

On secure application of PHP wrappers
On secure application  of PHP wrappersOn secure application  of PHP wrappers
On secure application of PHP wrappersPositive Hack Days
 
Learning Puppet basic thing
Learning Puppet basic thing Learning Puppet basic thing
Learning Puppet basic thing DaeHyung Lee
 
Web applications with Catalyst
Web applications with CatalystWeb applications with Catalyst
Web applications with Catalystsvilen.ivanov
 
Practical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails AppPractical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails AppSmartLogic
 
8 things to know about theming in drupal 8
8 things to know about theming in drupal 88 things to know about theming in drupal 8
8 things to know about theming in drupal 8Logan Farr
 
15. CodeIgniter editarea inregistrarilor
15. CodeIgniter editarea inregistrarilor15. CodeIgniter editarea inregistrarilor
15. CodeIgniter editarea inregistrarilorRazvan Raducanu, PhD
 
All I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web FrameworkAll I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web FrameworkBen Scofield
 
Drupal as a web framework
Drupal as a web frameworkDrupal as a web framework
Drupal as a web frameworkAdam Kalsey
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOpsОмские ИТ-субботники
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013grim_radical
 
How to create a non managed standby database
How to create a non managed  standby databaseHow to create a non managed  standby database
How to create a non managed standby databaseJorge Batista
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkBo-Yi Wu
 
Advanced symfony Techniques
Advanced symfony TechniquesAdvanced symfony Techniques
Advanced symfony TechniquesKris Wallsmith
 
Auto-loading of Drupal CCK Nodes
Auto-loading of Drupal CCK NodesAuto-loading of Drupal CCK Nodes
Auto-loading of Drupal CCK Nodesnihiliad
 
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...LEDC 2016
 
Migrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mindMigrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mindValentine Matsveiko
 

Similar to Drupal 8 configuration management (20)

On secure application of PHP wrappers
On secure application  of PHP wrappersOn secure application  of PHP wrappers
On secure application of PHP wrappers
 
Learning Puppet basic thing
Learning Puppet basic thing Learning Puppet basic thing
Learning Puppet basic thing
 
Web applications with Catalyst
Web applications with CatalystWeb applications with Catalyst
Web applications with Catalyst
 
Practical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails AppPractical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails App
 
Mojolicious
MojoliciousMojolicious
Mojolicious
 
8 things to know about theming in drupal 8
8 things to know about theming in drupal 88 things to know about theming in drupal 8
8 things to know about theming in drupal 8
 
15. CodeIgniter editarea inregistrarilor
15. CodeIgniter editarea inregistrarilor15. CodeIgniter editarea inregistrarilor
15. CodeIgniter editarea inregistrarilor
 
All I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web FrameworkAll I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web Framework
 
Drupal as a web framework
Drupal as a web frameworkDrupal as a web framework
Drupal as a web framework
 
Drupal 8 Services
Drupal 8 ServicesDrupal 8 Services
Drupal 8 Services
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
 
Ext 0523
Ext 0523Ext 0523
Ext 0523
 
PhpBB meets Symfony2
PhpBB meets Symfony2PhpBB meets Symfony2
PhpBB meets Symfony2
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013
 
How to create a non managed standby database
How to create a non managed  standby databaseHow to create a non managed  standby database
How to create a non managed standby database
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
 
Advanced symfony Techniques
Advanced symfony TechniquesAdvanced symfony Techniques
Advanced symfony Techniques
 
Auto-loading of Drupal CCK Nodes
Auto-loading of Drupal CCK NodesAuto-loading of Drupal CCK Nodes
Auto-loading of Drupal CCK Nodes
 
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
 
Migrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mindMigrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mind
 

Recently uploaded

(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 

Recently uploaded (20)

(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 

Drupal 8 configuration management

  • 3. Alexander Tkachev (Leksat) Drupal developer @ Amazee Labs
  • 5. Background: types of information • Content • Session • State • Configuration
  • 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
  • 8. # file: system.site.yml uuid: c78fd9aa-b327-4514-9d00-bc72a1f40f27 name: 'My cool site' mail: mailbox@example.com slogan: 'Drupal 8 rules!' page: 403: '' 404: '' front: node admin_compact_mode: false weight_select_max: 100 langcode: en
  • 9. A minute of horror What would be if they chose XML
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 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]
  • 18. # file: system.site.yml uuid: c78fd9aa-b327-4514-9d00-bc72a1f40f27 name: 'My cool site' mail: mailbox@example.com slogan: 'Drupal 8 rules!' page: 403: '' 404: '' front: node admin_compact_mode: false weight_select_max: 100 langcode: en
  • 19. $config = Drupal::config('system.site'); // Instance of DrupalCoreConfigConfig
  • 20. $config = Drupal::config('system.site'); // Instance of DrupalCoreConfigConfig $front_page = $config->get('page.front'); // 'node'
  • 21. $config = Drupal::config('system.site'); // Instance of DrupalCoreConfigConfig $front_page = $config->get('page.front'); // 'node' $page_settings = $config->get('page'); // array( // '403' => '', // '404' => '', // 'front' => 'node', // )
  • 22. $config = Drupal::config('system.site'); // Instance of DrupalCoreConfigConfig $front_page = $config->get('page.front'); // 'node' $page_settings = $config->get('page'); // array( // '403' => '', // '404' => '', // 'front' => 'node', // ) $config->set('page.front', 'my-front-page'); $config->save();
  • 23. Module/theme defaults your_module config install your_module.settings.yml
  • 24. Module/theme defaults your_module config install your_module.settings.yml views.view.my_cool_view.yml
  • 25. Configuration override levels: 1. settings.php 2. modules: • overrides are provided by services tagged as config.factory.override (implementing ConfigFactoryOverrideInterface) Get raw (not overridden) data: 1. ConfigFormBase::config() Drupal::config() 2. Config::getRawData() 3. Drupal::configFactory()->setOverrideState(FALSE);
  • 26. React on simple config changes: • ConfigEvents (SAVE, DELETE, IMPORT etc.) • hook_config_import_steps_alter() (for complicated workflows like fields)
  • 28. # file: core/modules/system/config/install/system.maintenance.yml message: '@site is currently under maintenance. We should be back shortly. langcode: en
  • 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'
  • 33. Modules: https://www.drupal.org/project/config_tools https://www.drupal.org/project/config_devel https://www.drupal.org/project/config_readonly https://www.drupal.org/project/config_inspector
  • 34. Вопросы? Leksat@AmazeeLabs*DrupalCampMsk2014 • This presentation http://bit.ly/d8-configuration • Configuration API docs https://www.drupal.org/developing/api/8/configuration • Drupal core updates https://groups.drupal.org/core/updates