فهرست منبع

Merge branch '1.4'

Jordi Boggiano 7 سال پیش
والد
کامیت
39d187fb1e

+ 4 - 2
src/Composer/EventDispatcher/EventDispatcher.php

@@ -257,9 +257,11 @@ class EventDispatcher
             throw new \RuntimeException('Failed to locate PHP binary to execute '.$scriptName);
         }
 
-        $memoryFlag = ' -d memory_limit='.ini_get('memory_limit');
+        $allowUrlFOpenFlag = ' -d allow_url_fopen=' . ProcessExecutor::escape(ini_get('allow_url_fopen'));
+        $disableFunctionsFlag = ' -d disable_functions=' . ProcessExecutor::escape(ini_get('disable_functions'));
+        $memoryLimitFlag = ' -d memory_limit=' . ProcessExecutor::escape(ini_get('memory_limit'));
 
-        return ProcessExecutor::escape($phpPath) . $memoryFlag;
+        return ProcessExecutor::escape($phpPath) . $allowUrlFOpenFlag . $disableFunctionsFlag . $memoryLimitFlag;
     }
 
     /**

+ 6 - 4
src/Composer/Installer.php

@@ -359,7 +359,7 @@ class Installer
         }
 
         $this->whitelistUpdateDependencies(
-            $localRepo,
+            $lockedRepository ?: $localRepo,
             $this->package->getRequires(),
             $this->package->getDevRequires()
         );
@@ -1268,11 +1268,13 @@ class Installer
      * skipped including their dependencies, unless they are listed in the
      * update whitelist themselves.
      *
-     * @param RepositoryInterface $localRepo
+     * @param RepositoryInterface $localOrLockRepo Use the locked repo if available, otherwise installed repo will do
+     *                                             As we want the most accurate package list to work with, and installed
+     *                                             repo might be empty but locked repo will always be current.
      * @param array               $rootRequires    An array of links to packages in require of the root package
      * @param array               $rootDevRequires An array of links to packages in require-dev of the root package
      */
-    private function whitelistUpdateDependencies($localRepo, array $rootRequires, array $rootDevRequires)
+    private function whitelistUpdateDependencies($localOrLockRepo, array $rootRequires, array $rootDevRequires)
     {
         if (!$this->updateWhitelist) {
             return;
@@ -1291,7 +1293,7 @@ class Installer
         }
 
         $pool = new Pool;
-        $pool->addRepository($localRepo);
+        $pool->addRepository($localOrLockRepo);
 
         $seen = array();
 

+ 4 - 1
src/Composer/Repository/ComposerRepository.php

@@ -497,7 +497,10 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
                     $this->sourceMirrors['hg'][] = array('url' => $mirror['hg-url'], 'preferred' => !empty($mirror['preferred']));
                 }
                 if (!empty($mirror['dist-url'])) {
-                    $this->distMirrors[] = array('url' => $mirror['dist-url'], 'preferred' => !empty($mirror['preferred']));
+                    $this->distMirrors[] = array(
+                        'url' => $this->canonicalizeUrl($mirror['dist-url']),
+                        'preferred' => !empty($mirror['preferred'])
+                    );
                 }
             }
         }

+ 2 - 0
src/Composer/XdebugHandler.php

@@ -174,6 +174,8 @@ class XdebugHandler
             $content .= $data.PHP_EOL;
         }
 
+        $content .= 'allow_url_fopen='.ini_get('allow_url_fopen').PHP_EOL;
+        $content .= 'disable_functions="'.ini_get('disable_functions').'"'.PHP_EOL;
         $content .= 'memory_limit='.ini_get('memory_limit').PHP_EOL;
 
         if (defined('PHP_WINDOWS_VERSION_BUILD')) {