InstallStorage
class InstallStorage extends FileStorage (View source)
Storage used by the Drupal installer.
This storage performs a full filesystem scan to discover all available extensions and reads from all default config directories that exist.
This special implementation MUST NOT be used anywhere else than the early installer environment.
Constants
| CONFIG_INSTALL_DIRECTORY |
Extension sub-directory containing default configuration for installation. |
| CONFIG_OPTIONAL_DIRECTORY |
Extension sub-directory containing optional configuration for installation. |
| CONFIG_SCHEMA_DIRECTORY |
Extension sub-directory containing configuration schema. |
Properties
| protected string | $collection | The storage collection. |
from FileStorage |
| protected string | $directory | The directory to scan in each extension to scan for files. |
|
| protected FileCacheInterface | $fileCache | The file cache object. |
from FileStorage |
| protected array | $folders | Folder map indexed by configuration name. |
Methods
Constructs an InstallStorage object.
Overrides Drupal\Core\Config\FileStorage::getFilePath().
Returns the file extension used by the file storage for all configuration files.
Returns whether a configuration object exists.
Implements Drupal\Core\Config\StorageInterface::read().
Overrides Drupal\Core\Config\FileStorage::write().
Overrides Drupal\Core\Config\FileStorage::delete().
Overrides Drupal\Core\Config\FileStorage::rename().
Encodes configuration data into the storage-specific format.
Decodes configuration data from the storage-specific format.
Gets configuration object names starting with a given prefix.
Overrides Drupal\Core\Config\FileStorage::deleteAll().
Gets the name of the current collection the storage is using.
Helper function for getAllCollectionNames().
Returns a map of all config object names and their folders.
Get all configuration names and folders for a list of modules or themes.
Get all configuration names and folders for Drupal core.
Get folder inside Drupal core that contains the files.
Resets the static cache.
Details
__construct(string $directory = self::CONFIG_INSTALL_DIRECTORY, string $collection = StorageInterface::DEFAULT_COLLECTION)
Constructs an InstallStorage object.
string
getFilePath($name)
Overrides Drupal\Core\Config\FileStorage::getFilePath().
Returns the path to the configuration file.
Determines the owner and path to the default configuration file of a requested config object name located in the installation profile, a module, or a theme (in this order).
static string
getFileExtension()
Returns the file extension used by the file storage for all configuration files.
protected
ensureStorage()
Check if the directory exists and create it if not.
bool
exists(string $name)
Returns whether a configuration object exists.
array|bool
read(string $name)
Implements Drupal\Core\Config\StorageInterface::read().
array
readMultiple(array $names)
Reads configuration data from the storage.
bool
write(string $name, array $data)
Overrides Drupal\Core\Config\FileStorage::write().
bool
delete(string $name)
Overrides Drupal\Core\Config\FileStorage::delete().
bool
rename(string $name, string $new_name)
Overrides Drupal\Core\Config\FileStorage::rename().
string
encode(array $data)
Encodes configuration data into the storage-specific format.
This is a publicly accessible static method to allow for alternative usages in data conversion scripts and also tests.
array
decode(string $raw)
Decodes configuration data from the storage-specific format.
This is a publicly accessible static method to allow for alternative usages in data conversion scripts and also tests.
array
listAll(string $prefix = '')
Gets configuration object names starting with a given prefix.
Given the following configuration objects:
- node.type.article
- node.type.page
Passing the prefix 'node.type.' will return an array containing the above names.
bool
deleteAll(string $prefix = '')
Overrides Drupal\Core\Config\FileStorage::deleteAll().
$this
createCollection(string $collection)
Creates a collection on the storage.
A configuration storage can contain multiple sets of configuration objects in partitioned collections. The collection name identifies the current collection used.
Implementations of this method must provide a new instance to avoid side effects caused by the fact that Config objects have their storage injected.
string
getCollectionName()
Gets the name of the current collection the storage is using.
array
getAllCollectionNames()
Gets the existing collections.
A configuration storage can contain multiple sets of configuration objects in partitioned collections. The collection key name identifies the current collection used.
protected array
getAllCollectionNamesHelper(string $directory)
Helper function for getAllCollectionNames().
If the file storage has the following subdirectory structure: ./another_collection/one ./another_collection/two ./collection/sub/one ./collection/sub/two this function will return:
protected string
getCollectionDirectory()
Gets the directory for the collection.
protected array
getAllFolders()
Returns a map of all config object names and their folders.
array
getComponentNames(array $list)
Get all configuration names and folders for a list of modules or themes.
array
getCoreNames()
Get all configuration names and folders for Drupal core.
protected string
getComponentFolder(Extension $extension)
Get folder inside each component that contains the files.
protected string
getCoreFolder()
Get folder inside Drupal core that contains the files.
reset()
Resets the static cache.