class FileStorageFactory in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Config/FileStorageFactory.php \Drupal\Core\Config\FileStorageFactory
Provides a factory for creating config file storage objects.
Hierarchy
- class \Drupal\Core\Config\FileStorageFactory
Expanded class hierarchy of FileStorageFactory
1 file declares its use of FileStorageFactory
- FileStorageFactoryTest.php in core/
tests/ Drupal/ KernelTests/ Core/ Config/ FileStorageFactoryTest.php
File
- core/
lib/ Drupal/ Core/ Config/ FileStorageFactory.php, line 10
Namespace
Drupal\Core\ConfigView source
class FileStorageFactory {
/**
* Returns a FileStorage object working with the sync config directory.
*
* @return \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'].
*/
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);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FileStorageFactory:: |
public static | function | Returns a FileStorage object working with the sync config directory. |