Add PlatformRepository::PLATFORM_PACKAGE_REGEX to remove duplication
parent
370a9a40fc
commit
d38eb244fa
|
@ -717,7 +717,7 @@ class Installer
|
||||||
private function extractPlatformRequirements($links) {
|
private function extractPlatformRequirements($links) {
|
||||||
$platformReqs = array();
|
$platformReqs = array();
|
||||||
foreach ($links as $link) {
|
foreach ($links as $link) {
|
||||||
if (preg_match('{^(?:php(?:-64bit)?|(?:ext|lib)-[^/]+)$}i', $link->getTarget())) {
|
if (preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $link->getTarget())) {
|
||||||
$platformReqs[$link->getTarget()] = $link->getPrettyConstraint();
|
$platformReqs[$link->getTarget()] = $link->getPrettyConstraint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,7 +240,7 @@ class ComposerRepository extends ArrayRepository implements StreamableRepository
|
||||||
}
|
}
|
||||||
|
|
||||||
// skip platform packages
|
// skip platform packages
|
||||||
if (preg_match('{^(?:php(?:-64bit)?|(?:ext|lib)-[^/]+)$}i', $name) || '__root__' === $name) {
|
if (preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $name) || '__root__' === $name) {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,8 @@ use Composer\Package\Version\VersionParser;
|
||||||
*/
|
*/
|
||||||
class PlatformRepository extends ArrayRepository
|
class PlatformRepository extends ArrayRepository
|
||||||
{
|
{
|
||||||
|
const PLATFORM_PACKAGE_REGEX = '{^(?:php(?:-64bit)?|(?:ext|lib)-[^/]+)$}i';
|
||||||
|
|
||||||
protected function initialize()
|
protected function initialize()
|
||||||
{
|
{
|
||||||
parent::initialize();
|
parent::initialize();
|
||||||
|
|
Loading…
Reference in New Issue