function FileStorageFactory::getSync
Same name in other branches
- 9 core/lib/Drupal/Core/Config/FileStorageFactory.php \Drupal\Core\Config\FileStorageFactory::getSync()
- 8.9.x core/lib/Drupal/Core/Config/FileStorageFactory.php \Drupal\Core\Config\FileStorageFactory::getSync()
- 11.x core/lib/Drupal/Core/Config/FileStorageFactory.php \Drupal\Core\Config\FileStorageFactory::getSync()
Returns a FileStorage object working with the sync config directory.
Return value
\Drupal\Core\Config\FileStorage FileStorage
Throws
\Drupal\Core\Config\ConfigDirectoryNotDefinedException In case the sync directory does not exist or is not defined in $settings['config_sync_directory'].
1 call to FileStorageFactory::getSync()
- FileStorageFactoryTest::testGetSync in core/
tests/ Drupal/ KernelTests/ Core/ Config/ FileStorageFactoryTest.php - @covers ::getSync
1 string reference to 'FileStorageFactory::getSync'
- core.services.yml in core/
core.services.yml - core/core.services.yml
File
-
core/
lib/ Drupal/ Core/ Config/ FileStorageFactory.php, line 21
Class
- FileStorageFactory
- Provides a factory for creating config file storage objects.
Namespace
Drupal\Core\ConfigCode
public static function getSync() {
$directory = Settings::get('config_sync_directory', FALSE);
if ($directory === FALSE) {
throw new ConfigDirectoryNotDefinedException('The config sync directory is not defined in $settings["config_sync_directory"]');
}
return new FileStorage($directory);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.