jenkins-bot has submitted this change and it was merged.

Change subject: Rebuild composer autoloader to support classmap-authoritative 
setting
......................................................................


Rebuild composer autoloader to support classmap-authoritative setting

Also explicitly set optimize-autoloader in the config.

Bug: T85182
Change-Id: I7a175fde896da75f07fb184b50f03a9a578ad3d3
---
M composer.json
M composer.lock
M vendor/autoload.php
M vendor/composer/ClassLoader.php
M vendor/composer/autoload_real.php
5 files changed, 47 insertions(+), 22 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  Hashar: Looks good to me, but someone else must approve
  QEDK: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/composer.json b/composer.json
index a473df1..78257a8 100644
--- a/composer.json
+++ b/composer.json
@@ -1,5 +1,9 @@
 {
        "require": {
                "phpunit/phpunit": "3.7.*"
+       },
+       "config": {
+               "autoloader-suffix": "_integration_phpunit",
+               "optimize-autoloader": true
        }
 }
diff --git a/composer.lock b/composer.lock
index d1f6545..ddde51e 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at 
http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file";,
         "This file is @generated automatically"
     ],
-    "hash": "11774bed2716724738d66bb56a8a1508",
+    "hash": "31067a05cbb6738933a9df4ef971563a",
     "packages": [
         {
             "name": "phpunit/php-code-coverage",
@@ -420,21 +420,12 @@
             "time": "2014-09-22 09:14:18"
         }
     ],
-    "packages-dev": [
-
-    ],
-    "aliases": [
-
-    ],
+    "packages-dev": [],
+    "aliases": [],
     "minimum-stability": "stable",
-    "stability-flags": [
-
-    ],
+    "stability-flags": [],
     "prefer-stable": false,
-    "platform": [
-
-    ],
-    "platform-dev": [
-
-    ]
+    "prefer-lowest": false,
+    "platform": [],
+    "platform-dev": []
 }
diff --git a/vendor/autoload.php b/vendor/autoload.php
index 2678587..91c0e44 100644
--- a/vendor/autoload.php
+++ b/vendor/autoload.php
@@ -4,4 +4,4 @@
 
 require_once __DIR__ . '/composer' . '/autoload_real.php';
 
-return ComposerAutoloaderInitc34e695b67af30676200134067aaa384::getLoader();
+return ComposerAutoloaderInit_integration_phpunit::getLoader();
diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php
index 4433649..5e1469e 100644
--- a/vendor/composer/ClassLoader.php
+++ b/vendor/composer/ClassLoader.php
@@ -54,9 +54,15 @@
     private $useIncludePath = false;
     private $classMap = array();
 
+    private $classMapAuthoritative = false;
+
     public function getPrefixes()
     {
-        return call_user_func_array('array_merge', $this->prefixesPsr0);
+        if (!empty($this->prefixesPsr0)) {
+            return call_user_func_array('array_merge', $this->prefixesPsr0);
+        }
+
+        return array();
     }
 
     public function getPrefixesPsr4()
@@ -245,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
@@ -295,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 0684538..d0ac884 100644
--- a/vendor/composer/autoload_real.php
+++ b/vendor/composer/autoload_real.php
@@ -2,7 +2,7 @@
 
 // autoload_real.php @generated by Composer
 
-class ComposerAutoloaderInitc34e695b67af30676200134067aaa384
+class ComposerAutoloaderInit_integration_phpunit
 {
     private static $loader;
 
@@ -19,9 +19,9 @@
             return self::$loader;
         }
 
-        
spl_autoload_register(array('ComposerAutoloaderInitc34e695b67af30676200134067aaa384',
 'loadClassLoader'), true, true);
+        
spl_autoload_register(array('ComposerAutoloaderInit_integration_phpunit', 
'loadClassLoader'), true, true);
         self::$loader = $loader = new \Composer\Autoload\ClassLoader();
-        
spl_autoload_unregister(array('ComposerAutoloaderInitc34e695b67af30676200134067aaa384',
 'loadClassLoader'));
+        
spl_autoload_unregister(array('ComposerAutoloaderInit_integration_phpunit', 
'loadClassLoader'));
 
         $includePaths = require __DIR__ . '/include_paths.php';
         array_push($includePaths, get_include_path());
@@ -48,7 +48,7 @@
     }
 }
 
-function composerRequirec34e695b67af30676200134067aaa384($file)
+function composerRequire_integration_phpunit($file)
 {
     require $file;
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/188398
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7a175fde896da75f07fb184b50f03a9a578ad3d3
Gerrit-PatchSet: 3
Gerrit-Project: integration/phpunit
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: QEDK <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to