Drupal 8  8.0.2
InstallStorage Class Reference
Inheritance diagram for InstallStorage:

Public Member Functions

 __construct ($directory=self::CONFIG_INSTALL_DIRECTORY, $collection=StorageInterface::DEFAULT_COLLECTION)
 
 getFilePath ($name)
 
 exists ($name)
 
 write ($name, array $data)
 
 delete ($name)
 
 rename ($name, $new_name)
 
 listAll ($prefix= '')
 
 getComponentNames (array $list)
 
 getCoreNames ()
 
 deleteAll ($prefix= '')
 
 reset ()
 
- Public Member Functions inherited from FileStorage
 __construct ($directory, $collection=StorageInterface::DEFAULT_COLLECTION)
 
 getFilePath ($name)
 
 exists ($name)
 
 read ($name)
 
 readMultiple (array $names)
 
 write ($name, array $data)
 
 delete ($name)
 
 rename ($name, $new_name)
 
 encode ($data)
 
 decode ($raw)
 
 listAll ($prefix= '')
 
 deleteAll ($prefix= '')
 
 createCollection ($collection)
 
 getCollectionName ()
 
 getAllCollectionNames ()
 

Data Fields

const CONFIG_INSTALL_DIRECTORY = 'config/install'
 
const CONFIG_OPTIONAL_DIRECTORY = 'config/optional'
 
const CONFIG_SCHEMA_DIRECTORY = 'config/schema'
 
- Data Fields inherited from StorageInterface
const DEFAULT_COLLECTION = ''
 

Protected Member Functions

 getAllFolders ()
 
 getComponentFolder (Extension $extension)
 
 getCoreFolder ()
 
- Protected Member Functions inherited from FileStorage
 ensureStorage ()
 
 getAllCollectionNamesHelper ($directory)
 
 getCollectionDirectory ()
 

Protected Attributes

 $folders
 
 $directory
 
- Protected Attributes inherited from FileStorage
 $collection
 
 $directory = ''
 

Additional Inherited Members

- Static Public Member Functions inherited from FileStorage
static getFileExtension ()
 

Detailed Description

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.

See Also

Constructor & Destructor Documentation

__construct (   $directory = self::CONFIG_INSTALL_DIRECTORY,
  $collection = StorageInterface::DEFAULT_COLLECTION 
)

Constructs an InstallStorage object.

Parameters
string$directoryThe directory to scan in each extension to scan for files. Defaults to 'config/install'.
string$collection(optional) The collection to store configuration in. Defaults to the default collection.

Member Function Documentation

delete (   $name)

Overrides Drupal::delete().

Exceptions
\Drupal\Core\Config\StorageException

Implements StorageInterface.

deleteAll (   $prefix = '')

Overrides Drupal::deleteAll().

Exceptions
\Drupal\Core\Config\StorageException

Implements StorageInterface.

exists (   $name)

{Returns whether a configuration object exists.

Parameters
string$nameThe name of a configuration object to test.
Returns
bool TRUE if the configuration object exists, FALSE otherwise.
}

Implements StorageInterface.

References InstallStorage\getAllFolders().

Here is the call graph for this function:

getAllFolders ( )
protected

Returns a map of all config object names and their folders.

Returns
array An array mapping config object names with directories.

References InstallStorage\getComponentNames(), InstallStorage\getCoreNames(), and Drupal\root().

Referenced by InstallStorage\exists(), InstallStorage\getFilePath(), and InstallStorage\listAll().

Here is the call graph for this function:

Here is the caller graph for this function:

getComponentFolder ( Extension  $extension)
protected

Get folder inside each component that contains the files.

Parameters
\Drupal\Core\Extension\Extension$extensionThe Extension object for the component.
Returns
string The configuration folder name for this component.

References FileStorage\getCollectionDirectory(), and Extension\getPath().

Referenced by InstallStorage\getComponentNames().

Here is the call graph for this function:

Here is the caller graph for this function:

getComponentNames ( array  $list)

Get all configuration names and folders for a list of modules or themes.

Parameters
\Drupal\Core\Extension\Extension[]$list An associative array of Extension objects, keyed by extension name.
Returns
array Folders indexed by configuration name.

References InstallStorage\getComponentFolder(), and FileStorage\getFileExtension().

Referenced by TestInstallStorage\getAllFolders(), ExtensionInstallStorage\getAllFolders(), and InstallStorage\getAllFolders().

Here is the call graph for this function:

Here is the caller graph for this function:

getCoreFolder ( )
protected

Get folder inside Drupal core that contains the files.

Returns
string The configuration folder name for core.

References FileStorage\getCollectionDirectory().

Referenced by InstallStorage\getCoreNames().

Here is the call graph for this function:

Here is the caller graph for this function:

getCoreNames ( )

Get all configuration names and folders for Drupal core.

Returns
array Folders indexed by configuration name.

References InstallStorage\getCoreFolder(), and FileStorage\getFileExtension().

Referenced by TestInstallStorage\getAllFolders(), ExtensionInstallStorage\getAllFolders(), and InstallStorage\getAllFolders().

Here is the call graph for this function:

Here is the caller graph for this function:

getFilePath (   $name)

Overrides Drupal::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).

Returns
string The path to the configuration file.
Todo:
Improve this when figuring out how we want to handle configuration in installation profiles. For instance, a config object actually has to be searched in the profile first (whereas the profile is never the owner); only afterwards check for a corresponding module or theme.

References InstallStorage\getAllFolders(), and FileStorage\getFileExtension().

Here is the call graph for this function:

listAll (   $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.
Parameters
string$prefix(optional) The prefix to search for. If omitted, all configuration object names that exist are returned.
Returns
array An array containing matching configuration object names.
}

Implements StorageInterface.

References InstallStorage\getAllFolders().

Here is the call graph for this function:

rename (   $name,
  $new_name 
)

Overrides Drupal::rename().

Exceptions
\Drupal\Core\Config\StorageException

Implements StorageInterface.

reset ( )

Resets the static cache.

write (   $name,
array  $data 
)

Overrides Drupal::write().

Exceptions
\Drupal\Core\Config\StorageException

Implements StorageInterface.

Field Documentation

const CONFIG_OPTIONAL_DIRECTORY = 'config/optional'
const CONFIG_SCHEMA_DIRECTORY = 'config/schema'

Extension sub-directory containing configuration schema.

Referenced by DefaultConfigTest\containerBuild(), ConfigInstaller\installDefaultConfig(), and TestViewsTest\testDefaultConfig().


The documentation for this class was generated from the following file: