Only allow platform packages to be overridden.
As defined by the PlatformRepository::PLATFORM_PACKAGE_REGEX pattern.pull/2990/head
parent
571363dee2
commit
ac89a5bb3b
|
@ -41,10 +41,16 @@ class PlatformRepository extends ArrayRepository
|
||||||
// Add each of the override versions as options.
|
// Add each of the override versions as options.
|
||||||
// Later we might even replace the extensions instead.
|
// Later we might even replace the extensions instead.
|
||||||
foreach( $this->overrides as $name => $prettyVersion ) {
|
foreach( $this->overrides as $name => $prettyVersion ) {
|
||||||
$version = $versionParser->normalize($prettyVersion);
|
// Check that it's a platform package.
|
||||||
$package = new CompletePackage($name, $version, $prettyVersion);
|
if( preg_match(self::PLATFORM_PACKAGE_REGEX, $name) ) {
|
||||||
$package->setDescription("Overridden virtual platform package $name.");
|
$version = $versionParser->normalize($prettyVersion);
|
||||||
parent::addPackage($package);
|
$package = new CompletePackage($name, $version, $prettyVersion);
|
||||||
|
$package->setDescription("Overridden virtual platform package $name.");
|
||||||
|
parent::addPackage($package);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw new \UnexpectedValueException('Invalid platform package "'.$name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue