Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/212325
Change subject: Rebuild autoloader to support classmap authoritative. ...................................................................... Rebuild autoloader to support classmap authoritative. Change-Id: I5c691dfc98596ca1e4a9e173d6fd183ac7c006e5 --- M composer.json M composer.lock M vendor/composer/ClassLoader.php M vendor/composer/autoload_real.php 4 files changed, 29 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/composer refs/changes/25/212325/1 diff --git a/composer.json b/composer.json index 4dc00d0..a96268b 100644 --- a/composer.json +++ b/composer.json @@ -3,6 +3,7 @@ "composer/composer": "1.0.0-alpha10" }, "config": { + "classmap-authoritative": true, "optimize-autoloader": true } } diff --git a/composer.lock b/composer.lock index fb28ee4..179d304 100644 --- a/composer.lock +++ b/composer.lock @@ -352,6 +352,7 @@ "composer/composer": 15 }, "prefer-stable": false, + "prefer-lowest": false, "platform": [], "platform-dev": [] } diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 70d78bc..5e1469e 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -54,6 +54,8 @@ private $useIncludePath = false; private $classMap = array(); + private $classMapAuthoritative = false; + public function getPrefixes() { if (!empty($this->prefixesPsr0)) { @@ -249,6 +251,27 @@ } /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not @@ -299,6 +322,9 @@ if (isset($this->classMap[$class])) { return $this->classMap[$class]; } + if ($this->classMapAuthoritative) { + return false; + } $file = $this->findFileWithExtension($class, '.php'); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index ff1c559..917301b 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -38,6 +38,7 @@ $loader->addClassMap($classMap); } + $loader->setClassMapAuthoritative(true); $loader->register(true); return $loader; -- To view, visit https://gerrit.wikimedia.org/r/212325 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5c691dfc98596ca1e4a9e173d6fd183ac7c006e5 Gerrit-PatchSet: 1 Gerrit-Project: integration/composer Gerrit-Branch: master Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits