Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Extension.php

function 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\Extension

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal