W3cubDocs

/Drupal 8

public function InstallStorage::getFilePath

public InstallStorage::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).

@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.

Return value

string The path to the configuration file.

Overrides FileStorage::getFilePath

File

core/lib/Drupal/Core/Config/InstallStorage.php, line 82

Class

InstallStorage
Storage used by the Drupal installer.

Namespace

Drupal\Core\Config

Code

public function getFilePath($name) {
  $folders = $this->getAllFolders();
  if (isset($folders[$name])) {
    return $folders[$name] . '/' . $name . '.' . $this->getFileExtension();
  }
  // If any code in the early installer requests a configuration object that
  // does not exist anywhere as default config, then that must be mistake.
  throw new StorageException("Missing configuration file: $name");
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Config!InstallStorage.php/function/InstallStorage::getFilePath/8.1.x