function Extension::__wakeup
Same name in other branches
- 9 core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::__wakeup()
- 8.9.x core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::__wakeup()
- 10 core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::__wakeup()
Magic method implementation to unserialize the extension object.
File
-
core/
lib/ Drupal/ Core/ Extension/ Extension.php, line 193
Class
- Extension
- Defines an extension (file) object.
Namespace
Drupal\Core\ExtensionCode
public function __wakeup() : void {
// Get the app root from the container. While compiling the container we
// have to discover all the extension service files in
// \Drupal\Core\DrupalKernel::initializeServiceProviders(). This results in
// creating extension objects before the container has the kernel.
// Specifically, this occurs during the call to
// \Drupal\Core\Extension\ExtensionDiscovery::scanDirectory().
$container = \Drupal::hasContainer() ? \Drupal::getContainer() : FALSE;
$this->root = $container && $container->hasParameter('app.root') ? $container->getParameter('app.root') : DRUPAL_ROOT;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.