Do not trigger Intervals::isSubsetOf() over and over again for platform packages
parent
c9201b8e40
commit
a1e1cd8fa4
|
@ -245,6 +245,11 @@ class PoolBuilder
|
||||||
|
|
||||||
private function markPackageNameForLoading(Request $request, $name, ConstraintInterface $constraint)
|
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
|
// Root require (which was not unfixed) already loaded the maximum range so no
|
||||||
// need to check anything here
|
// need to check anything here
|
||||||
if (isset($this->maxExtendedReqs[$name])) {
|
if (isset($this->maxExtendedReqs[$name])) {
|
||||||
|
|
|
@ -593,4 +593,21 @@ class PlatformRepository extends ArrayRepository
|
||||||
|
|
||||||
$this->addPackage($lib);
|
$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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue