All configuration data will be stored on-disk using YAML files. In a fresh Drupal installation two directories will be created:
- Active: This stores your currently live configuration.
- Staging: This stores configuration that is ready to be imported.
Both of these directories will live inside a randomly named directory that lives inside your files directory.
Individual configuration files (
prefix.example.yml) will look like the following:
some_string: Woo kittens!
Configuration can also be nested, here is what the standard core 'thumbnail' image style looks like:
label: Thumbnail (100x100)
How these files are organized and named will vary depending on use cases. Standard settings will be in files like
statistics.settings.yml, and something like image module which other modules hook into to provide "discoverable" stuff might do both a module-specific configuration file
image.settings.yml for "global" module settings, as well as provide
Data in these files will be stored in a pluggable cache implementing the standard Drupal CacheBackendInterface.
At this level are the actual API functions that module developers will interact with in order to manipulate configuration values; essentially, a replacement for variable_get()/variable_set().
// Load a set of configuration out of the active store.
// 'prefix.name' refers to the filename of the .yml file, without the extension.
$config = config('prefix.name');
// Access a single value out of the store.
// Change a value and save it back to both the active store and the filesystem.
$config->set('my.value','my new value');
The next chapter explains these APIs in detail.