O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Drupal 8 Configuration Management

Book Description

Make the most of Drupal 8's coolest new feature—the Configuration Management system

In Detail

With all the complex configuration options of Drupal, the Configuration Management system allows you to keep track of your configuration and move configuration changes between several development environments with ease.

Drupal 8 Configuration Management will teach you everything you need to know about the Configuration Management system and get you started with using its features quickly. For more advanced users, the book explains how to use the API to add custom configuration and how to upgrade custom modules to use the new Configuration Management system, covering some essential tools and best practices. It will teach you to write schema files for custom configuration and upgrade modules to the new Configuration Management system. Additionally, you will learn how to migrate configuration from Drupal 6 and 7 to Drupal 8 and how to manage configuration for multilingual websites.

What You Will Learn

  • Understand Configuration Management in Drupal
  • Set up development environments with ease
  • Manage and version control your configuration in code
  • Use best practices in your development process
  • Upgrade your modules' configuration from Drupal 7 to Drupal 8
  • Use configuration in your own custom module
  • Discover how the translation of configuration works
  • Explore the structure and write your own schema files for configuration

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Drupal 8 Configuration Management
    1. Table of Contents
    2. Drupal 8 Configuration Management
    3. Credits
    4. About the Authors
    5. About the Reviewer
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. So what is configuration in Drupal terms?
      2. How it works in Drupal 8
      3. What this book covers
      4. What you need for this book
      5. Who this book is for
      6. Conventions
      7. Reader feedback
      8. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Understanding Configuration Management
      1. An introduction to Configuration Management
        1. Configuration
        2. Content
        3. Session
        4. State
      2. Why manage configuration?
      3. Tracking configuration changes
        1. Some version control best practices
          1. Using a project management tool
          2. Meaningful commit messages
          3. Meaningful branches
      4. A look back at Drupal 7
        1. Manual Configuration Management
        2. The hook_install()/hook_update_N() function
        3. The Features module
          1. What is the Features module?
          2. Creating a Feature
          3. The settings to export with Features
          4. The settings to not export with Features
        4. The Configuration Management module
        5. Storing configuration variables in settings.php
      5. How Drupal 8 takes care of Configuration Management
        1. How to start using Configuration Management
      6. Using version control to keep track of configuration changes
        1. Types of configuration
        2. Configuration storage and deploying between environments
      7. Summary
    9. 2. Configuration Management for Administrators
      1. Why do we want to manage our configuration?
        1. Making a clone of your site
        2. The Configuration Management interface
          1. The interface options
            1. Using full import/export
        3. Single import/export
      2. Summary
    10. 3. Drupal 8's Take on Configuration Management
      1. The config directory
        1. A simple configuration example
      2. Config and schema files – what are they and what are they used for?
        1. Config files
        2. Schema files
      3. Learning the difference between active and staging directories
        1. Changing the active configuration storage
        2. Changing the storage location of the active and staging directories
      4. Simple configuration versus configuration entities
        1. Simple configuration
        2. Configuration entities
      5. Summary
    11. 4. The Configuration Management API
      1. A simple configuration API
        1. Working with configuration data
          1. Retrieving the configuration object
          2. Getting configuration values
          3. Setting configuration values
          4. Removing configuration values
          5. Best practices
        2. Getting notified about configuration changes
        3. Overriding the configuration
          1. Global overrides
          2. Language overrides
          3. Module overrides
          4. Avoiding overrides
        4. Creating configuration entity types
          1. Adding the basics
          2. Taking control of your data
      2. Summary
    12. 5. The Anatomy of Schema Files
      1. What are schema files in Drupal?
        1. The structure of a schema file
      2. Properties
      3. Data types
        1. Reusing data types
        2. Making data translatable
      4. Dynamic type references
        1. The element-key references
        2. The sub-key references
        3. The parent-key references
      5. Coding standards
      6. PHP API
      7. Summary
    13. 6. Adding Configuration Management to Your Module
      1. Default configuration
        1. An example
      2. Defining and using your own configuration
        1. Setting your configuration file
        2. Custom configuration entity types
        3. Using the configuration
        4. Creating a configuration form
          1. Configuration forms in Drupal 7
          2. Creating configuration forms in Drupal 8
            1. Adding a form controller
            2. Route and menu items
            3. The result
      3. Summary
    14. 7. Upgrading Your Drupal 7 Variables to the Drupal 8 Configuration
      1. Upgrading your variables
        1. Simple configuration
        2. Complex configuration objects
        3. Upgrading to the new state system
      2. Providing an upgrade path for your variables
        1. Migrating your data
          1. Source plugins
          2. Process plugins
          3. Destination plugins
          4. Running the migration
      3. Summary
    15. 8. Managing Configuration for Multilingual Websites
      1. Multilingual sites in Drupal 7
        1. The Locale module
        2. Content translation
        3. Translating other types of content
        4. Translation settings/configuration
        5. Translating entities
      2. Translating in Drupal 8
        1. Configuration translation
          1. Translating the configuration
          2. Storing translations
          3. Exporting and importing configuration translations
      3. Summary
    16. 9. Useful Tools and Getting Help
      1. Community documentation
      2. The administration guide documentation
      3. Contributed modules
        1. The configuration inspector for Drupal 8
      4. Configuration development
      5. Drush
        1. Exporting and importing your configuration using Drush commands
      6. Forums
      7. The issue queue
      8. IRC chat
      9. Summary
        1. Questions
    17. Index