5 * Install, update and uninstall functions for the config module.
9 * Implements hook_requirements().
11 function config_requirements($phase) {
14 $directory = config_get_config_directory(CONFIG_SYNC_DIRECTORY);
16 catch (\Exception $e) {
17 // system_requirements() guarantees that the CONFIG_SYNC_DIRECTORY exists
18 // as the config.storage.staging service relies on it.
21 // Ensure the configuration sync directory is writable. This is only a warning
22 // because only configuration import from a tarball requires the folder to be
24 if ($phase !== 'install' && !is_writable($directory)) {
25 $requirements['config directory ' . CONFIG_SYNC_DIRECTORY] = [
26 'title' => t('Configuration directory: %type', ['%type' => CONFIG_SYNC_DIRECTORY]),
27 'description' => t('The directory %directory is not writable.', ['%directory' => $directory]),
28 'severity' => REQUIREMENT_WARNING,