diff --git a/src/Composer/DependencyResolver/PoolBuilder.php b/src/Composer/DependencyResolver/PoolBuilder.php index 416a8d1dd..2f8ff9c1c 100644 --- a/src/Composer/DependencyResolver/PoolBuilder.php +++ b/src/Composer/DependencyResolver/PoolBuilder.php @@ -245,6 +245,11 @@ class PoolBuilder private function markPackageNameForLoading(Request $request, $name, ConstraintInterface $constraint) { + // Skip platform requires at this stage + if (PlatformRepository::isPlatformPackage($name)) { + return; + } + // Root require (which was not unfixed) already loaded the maximum range so no // need to check anything here if (isset($this->maxExtendedReqs[$name])) { diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index ac6d49525..f6ec91864 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -593,4 +593,21 @@ class PlatformRepository extends ArrayRepository $this->addPackage($lib); } + + /** + * Check if a package name is a platform package. + * + * @param $name + * @return bool + */ + public static function isPlatformPackage($name) + { + static $cache = array(); + + if (isset($cache[$name])) { + return $cache[$name]; + } + + return $cache[$name] = (bool) preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $name); + } }