function Settings::getInstance
Returns the settings instance.
A singleton is used because this class is used before the container is available.
Return value
Throws
\BadMethodCallException Thrown when the settings instance has not been initialized yet.
2 calls to Settings::getInstance()
- install_begin_request in core/
includes/ install.core.inc - Begins an installation request, modifying the installation state as needed.
- UpdateKernel::handle in core/
lib/ Drupal/ Core/ Update/ UpdateKernel.php - Handles a Request to convert it to a Response.
File
-
core/
lib/ Drupal/ Core/ Site/ Settings.php, line 69
Class
- Settings
- Read only settings that are initialized with the class.
Namespace
Drupal\Core\SiteCode
public static function getInstance() {
if (self::$instance === NULL) {
throw new \BadMethodCallException('Settings::$instance is not initialized yet. Whatever you are trying to do, it might be too early for that. You could call Settings::initialize(), but it is probably better to wait until it is called in the regular way. Also check for recursions.');
}
return self::$instance;
}