Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Drupal 8 Configuration Management

You're reading from   Drupal 8 Configuration Management

Arrow left icon
Product type Paperback
Published in Mar 2015
Publisher
ISBN-13 9781783985203
Length 148 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Toc

Table of Contents (11) Chapters Close

Preface 1. Understanding Configuration Management FREE CHAPTER 2. Configuration Management for Administrators 3. Drupal 8's Take on Configuration Management 4. The Configuration Management API 5. The Anatomy of Schema Files 6. Adding Configuration Management to Your Module 7. Upgrading Your Drupal 7 Variables to the Drupal 8 Configuration 8. Managing Configuration for Multilingual Websites 9. Useful Tools and Getting Help Index

A simple configuration API

As you learned earlier in this book, there are several types of configuration objects in Drupal 8: simple configuration and the more complex configuration entities.

Working with configuration data

If you've worked with Drupal 7 before and have written some custom code, you will surely remember the variable subsystem. Drupal 7 itself and many modules store their settings in the {variable} database table. Every configuration saved to this table needs to be serialized before saving and converted back to its original state while reading from the table. To read and write configuration, Drupal 7 has the widely used functions variable_get($name) and variable_set($name, $value).

Here are some small examples of how Drupal 7 reads and saves simple configuration settings, taken from system.admin.inc:

<?php
// The status message depends on whether an admin theme is currently in use:
// a value of 0 means the admin theme is set to be the default theme.
$admin_theme =...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime