Drupal 8 Configuration Management
By Stefan Borchert and Anja Schirwinski
()
About this ebook
- Understand Configuration Management from a non-developer perspective
- Achieve a faster moving configuration between environments
- Create custom configuration inside your own modules
Drupal 8 Configuration Management is intended for people who use Drupal 8 to build websites, whether you are a hobbyist using Drupal for the first time, a long-time Drupal site builder, or a professional web developer.
Related to Drupal 8 Configuration Management
Related ebooks
Drupal 8 SEO: The Visual, Step-By-Step Guide to Drupal Search Engine Optimization Rating: 3 out of 5 stars3/5Drush for Developers - Second Edition Rating: 0 out of 5 stars0 ratingsRedmine Plugin Extension and Development Rating: 0 out of 5 stars0 ratingsInstant Jsoup How-to Rating: 0 out of 5 stars0 ratingsResponsive Design High Performance Rating: 0 out of 5 stars0 ratingsLearning Website Development with Django Rating: 0 out of 5 stars0 ratingsLearning Drupal 6 Module Development Rating: 3 out of 5 stars3/5Persistence in PHP with Doctrine ORM Rating: 0 out of 5 stars0 ratingsNginx Essentials Rating: 0 out of 5 stars0 ratingsHands-On Parallel Programming with C# 8 and .NET Core 3: Build solid enterprise software using task parallelism and multithreading Rating: 0 out of 5 stars0 ratingsINSTANT Premium Drupal Themes Rating: 0 out of 5 stars0 ratingsInstant Hands-on Testing with PHPUnit How-to Rating: 0 out of 5 stars0 ratingsMastering Sublime Text Rating: 0 out of 5 stars0 ratingsMeteor Design Patterns Rating: 0 out of 5 stars0 ratingsGit Best Practices Guide Rating: 0 out of 5 stars0 ratingsSymfony2 Essentials Rating: 0 out of 5 stars0 ratingsLearning Apache Mahout Classification Rating: 0 out of 5 stars0 ratingsLearning PHP Data Objects Rating: 5 out of 5 stars5/5Google Visualization API Essentials Rating: 3 out of 5 stars3/5Drupal 8 Theming with Twig Rating: 4 out of 5 stars4/5Learning Drupal 8 Rating: 0 out of 5 stars0 ratingsMastering Drupal 8 Views Rating: 0 out of 5 stars0 ratingsBasic Drupal: How to create, administer and maintain a Drupal Site Rating: 0 out of 5 stars0 ratingsDrupal 7 Views Rating: 4 out of 5 stars4/5Drupal Multimedia Rating: 4 out of 5 stars4/5Mastering Swift 3 - Linux Rating: 0 out of 5 stars0 ratingsMongoDB High Availability Rating: 5 out of 5 stars5/5Redmine Cookbook Rating: 0 out of 5 stars0 ratingsAjax Bible Rating: 3 out of 5 stars3/5Mastering Akka Rating: 0 out of 5 stars0 ratings
Programming For You
Python: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5HTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5Java for Beginners: A Crash Course to Learn Java Programming in 1 Week Rating: 5 out of 5 stars5/5SQL: For Beginners: Your Guide To Easily Learn SQL Programming in 7 Days Rating: 5 out of 5 stars5/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5Python Machine Learning By Example Rating: 4 out of 5 stars4/5Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Learn SQL in 24 Hours Rating: 5 out of 5 stars5/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Linux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Pokemon Go: Guide + 20 Tips and Tricks You Must Read Hints, Tricks, Tips, Secrets, Android, iOS Rating: 5 out of 5 stars5/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5SQL All-in-One For Dummies Rating: 3 out of 5 stars3/5Modern C++ for Absolute Beginners: A Friendly Introduction to C++ Programming Language and C++11 to C++20 Standards Rating: 0 out of 5 stars0 ratingsWeb Designer's Idea Book, Volume 4: Inspiration from the Best Web Design Trends, Themes and Styles Rating: 4 out of 5 stars4/5101 Amazing Nintendo NES Facts: Includes facts about the Famicom Rating: 4 out of 5 stars4/5OneNote: The Ultimate Guide on How to Use Microsoft OneNote for Getting Things Done Rating: 1 out of 5 stars1/5Learn PowerShell in a Month of Lunches, Fourth Edition: Covers Windows, Linux, and macOS Rating: 0 out of 5 stars0 ratings
Reviews for Drupal 8 Configuration Management
0 ratings0 reviews
Book preview
Drupal 8 Configuration Management - Stefan Borchert
Table of Contents
Drupal 8 Configuration Management
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
So what is configuration in Drupal terms?
How it works in Drupal 8
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Understanding Configuration Management
An introduction to Configuration Management
Configuration
Content
Session
State
Why manage configuration?
Tracking configuration changes
Some version control best practices
Using a project management tool
Meaningful commit messages
Meaningful branches
A look back at Drupal 7
Manual Configuration Management
The hook_install()/hook_update_N() function
The Features module
What is the Features module?
Creating a Feature
The settings to export with Features
The settings to not export with Features
The Configuration Management module
Storing configuration variables in settings.php
How Drupal 8 takes care of Configuration Management
How to start using Configuration Management
Using version control to keep track of configuration changes
Types of configuration
Configuration storage and deploying between environments
Summary
2. Configuration Management for Administrators
Why do we want to manage our configuration?
Making a clone of your site
The Configuration Management interface
The interface options
Using full import/export
Single import/export
Summary
3. Drupal 8's Take on Configuration Management
The config directory
A simple configuration example
Config and schema files – what are they and what are they used for?
Config files
Schema files
Learning the difference between active and staging directories
Changing the active configuration storage
Changing the storage location of the active and staging directories
Simple configuration versus configuration entities
Simple configuration
Configuration entities
Summary
4. The Configuration Management API
A simple configuration API
Working with configuration data
Retrieving the configuration object
Getting configuration values
Setting configuration values
Removing configuration values
Best practices
Getting notified about configuration changes
Overriding the configuration
Global overrides
Language overrides
Module overrides
Avoiding overrides
Creating configuration entity types
Adding the basics
Taking control of your data
Summary
5. The Anatomy of Schema Files
What are schema files in Drupal?
The structure of a schema file
Properties
Data types
Reusing data types
Making data translatable
Dynamic type references
The element-key references
The sub-key references
The parent-key references
Coding standards
PHP API
Summary
6. Adding Configuration Management to Your Module
Default configuration
An example
Defining and using your own configuration
Setting your configuration file
Custom configuration entity types
Using the configuration
Creating a configuration form
Configuration forms in Drupal 7
Creating configuration forms in Drupal 8
Adding a form controller
Route and menu items
The result
Summary
7. Upgrading Your Drupal 7 Variables to the Drupal 8 Configuration
Upgrading your variables
Simple configuration
Complex configuration objects
Upgrading to the new state system
Providing an upgrade path for your variables
Migrating your data
Source plugins
Process plugins
Destination plugins
Running the migration
Summary
8. Managing Configuration for Multilingual Websites
Multilingual sites in Drupal 7
The Locale module
Content translation
Translating other types of content
Translation settings/configuration
Translating entities
Translating in Drupal 8
Configuration translation
Translating the configuration
Storing translations
Exporting and importing configuration translations
Summary
9. Useful Tools and Getting Help
Community documentation
The administration guide documentation
Contributed modules
The configuration inspector for Drupal 8
Configuration development
Drush
Exporting and importing your configuration using Drush commands
Forums
The issue queue
IRC chat
Summary
Questions
Index
Drupal 8 Configuration Management
Drupal 8 Configuration Management
Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: March 2015
Production reference: 1130315
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78398-520-3
www.packtpub.com
Credits
Authors
Stefan Borchert
Anja Schirwinski
Reviewers
Greg Dunlap
Johannes Haseitl
Thomas Keitel
Jose A. Reyero
Dev Saran
Commissioning Editor
Julian Ursell
Acquisition Editor
Kevin Colaco
Content Development Editor
Shubhangi Dhamgaye
Technical Editor
Indrajit A. Das
Copy Editors
Alfida Paiva
Adithi Shetty
Project Coordinator
Harshal Ved
Proofreaders
Stephen Copestake
Maria Gould
Indexer
Priya Sane
Production Coordinator
Alwin Roy
Cover Work
Alwin Roy
About the Authors
Stefan Borchert has been working with Drupal for more than 9 years. In the community, he is better known by his nickname stBorchert. He contributes to Drupal by writing contributed modules, helping with Drupal Core, and providing help to new contributors as a project application review administrator. He is a founding partner and senior Drupal developer at undpaul, a Drupal Digital Agency based in Germany.
Anja Schirwinski got to know Drupal more than 8 years ago as a themer/site builder and went on to build several very different web applications with it for the company she worked for. She has been a participating member of the Drupal community since 2007, known by the nickname aschiwi.
From 2009-2010, Anja was the deputy chair of the Drupal Initiative, a registered association that promotes Drupal in Germany. She is the cofounder and CEO of undpaul, one of the first Drupal-only digital agencies in Germany. She founded the company in 2010 with friends she met at a local Drupal user group.
About the Reviewer
Thomas Keitel, also known as hctom on the Web, started with computers as a kid using an Amiga 500 for his first graphic designs. When technology evolved, he became more and more interested in learning how to program and design for the Web. He completed his training as a digital media designer in 2003, focusing on a combination of development and design. Being more of a self-learner, he taught himself several web programming languages before finally settling for PHP. This got him started with Drupal in 2007. Over the years, he built a wide range of Drupal sites from small corporate sites to big community and content portals.
In August 2014, he started working for undpaul, one of Germany's oldest Drupal-only digital agencies.
www.PacktPub.com
Support files, eBooks, discount offers, and more
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.
Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Free access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.
Preface
In professional web development, especially when working in teams of any size, configuration management is one of the most important tasks when it comes to keeping track of configuration changes.
The Wikipedia article for Software Configuration Management states that In software engineering, software configuration management (SCM) is the task of tracking and controlling changes in the software, which is part of the larger cross-discipline field of configuration management. SCM practices include revision control and the establishment of baselines. If something goes wrong, SCM can determine what was changed and who changed it. If a configuration is working well, SCM can determine how to replicate it across many hosts.
So what is configuration in Drupal terms?
In Drupal, configuration includes topics such as content types, fields, menus, or text formats. Creating or changing a configuration on a live site poses a high risk and makes changes untraceable. Questions such as who made a change, and when and why it was made, cannot be answered.
Up until Drupal 7, Drupal had all configuration stored in the database. By Drupal 7, most professional Drupal developers kept track of their configuration changes by exporting them to code, the most popular option being the Features module, and version-controlling it with a version control system such as Git.