diff --git a/src/moduleutils/PhutilBootloader.php b/src/moduleutils/PhutilBootloader.php --- a/src/moduleutils/PhutilBootloader.php +++ b/src/moduleutils/PhutilBootloader.php @@ -12,6 +12,7 @@ private $registeredLibraries = array(); private $libraryMaps = array(); private $extensionMaps = array(); + private $extendedMaps = array(); private $currentLibrary = null; private $classTree = array(); private $inMemoryMaps = array(); @@ -114,6 +115,10 @@ } public function getLibraryMap($name) { + if (isset($this->extendedMaps[$name])) { + return $this->extendedMaps[$name]; + } + if (empty($this->libraryMaps[$name])) { $root = $this->getLibraryRoot($name); $this->currentLibrary = $name; @@ -167,6 +172,8 @@ } } + $this->extendedMaps[$name] = $map; + return $map; } @@ -275,6 +282,10 @@ $this->extensionMaps[$library]['xmap'][$class] = $xmap; } } + + // Clear the extended library cache (should one exist) so we know that + // we need to rebuild it. + unset($this->extendedMaps[$library]); } }