Is it OK to delete the 'active' and 'staging' entries automatically created in settings.php? I don't plan on using them, but it's not clear to me whether some process might expect them to exist.


The default.settings.php file contains the following comment:

The staging directory is used for configuration imports; the active directory is not used by default, since the default storage for active configuration is the database rather than the file system (this can be changed; see "Active configuration settings" below).

In short:

  • The staging directory is used only when importing configuration from the UI
  • The active directory is not used by default from Drupal 8, which saves the configuration data in the database, like Drupal 7 did with the persistent variables

In both the cases, I would expect Drupal to correctly handle the case the global $config_directories is not set.

  • Hard to miss those paragraphs in settings.php, but it's worth noting that they reference "CONFIG_ACTIVE_DIRECTORY" and not "active"; so something's out of date. Importing and exporting is arbitrary to any named directory in that array via drush 7 or 8 (haven't tried the GUI). But in spite of the apparent indifference, (for example) CONFIG_ACTIVE_DIRECTORY appears 26 times in 15 separate files. I don't really have the chops to wade thru all the code and figure out whether they are critical. – ericx Aug 29 '15 at 20:45
  • 1
    See also drupal.org/node/2487592 which is an attempt at not shipping with the active directory. – anavarre Sep 1 '15 at 11:19

Sadly, D8 will fail with the following exception, if you delete the active element from the array.

Exception: The configuration directory type active does not exist. in config_get_config_directory() (line 177 of core/includes/bootstrap.inc).

However, it doesn't seem to mind if you remove the staging entry. It's worth noting that drush 7 documentation says that the staging entry will be used by default when executing commands like config-export (drush 8, currently presents a nice menu listing all the config_directories instead of defaulting; but it's still in beta so the behavior may change).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.