function Extension::__wakeup
Magic method implementation to unserialize the extension object.
File
- 
              core/
lib/ Drupal/ Core/ Extension/ Extension.php, line 208  
Class
- Extension
 - Defines an extension (file) object.
 
Namespace
Drupal\Core\ExtensionCode
public function __wakeup() {
  // 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.