diff --git a/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php b/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php index ebe5958..627e4fe 100644 --- a/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php +++ b/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php @@ -70,13 +70,6 @@ class ExtensionDiscovery { protected $infoParser; /** - * Static root path, useful for invalidating static::$files when needed. - * - * @var string - */ - protected static $cacheRoot; - - /** * Previously discovered files keyed by origin directory and extension type. * * @var array @@ -128,12 +121,6 @@ public function __construct($root, $use_file_cache = TRUE, $profile_directories $this->fileCache = $use_file_cache ? FileCacheFactory::get('extension_discovery') : NULL; $this->profileDirectories = $profile_directories; $this->sitePath = $site_path; - // Invalidate the cache if we're using a new root directory. We must do this - // since $files is static. - if ($this->root != static::$cacheRoot) { - static::$files = []; - static::$cacheRoot = $this->root; - } } /** @@ -228,12 +215,12 @@ public function scan($type, $include_tests = NULL) { $files = array(); foreach ($searchdirs as $dir) { // Discover all extensions in the directory, unless we did already. - if (!isset(static::$files[$dir][$include_tests])) { - static::$files[$dir][$include_tests] = $this->scanDirectory($dir, $include_tests); + if (!isset(static::$files[$this->root][$dir][$include_tests])) { + static::$files[$this->root][$dir][$include_tests] = $this->scanDirectory($dir, $include_tests); } // Only return extensions of the requested type. - if (isset(static::$files[$dir][$include_tests][$type])) { - $files += static::$files[$dir][$include_tests][$type]; + if (isset(static::$files[$this->root][$dir][$include_tests][$type])) { + $files += static::$files[$this->root][$dir][$include_tests][$type]; } }