From 132c37ab44bbdb28c12ad9563ccc7cc0497b3797 Mon Sep 17 00:00:00 2001 From: Richard Fussenegger Date: Wed, 11 May 2016 20:53:32 +0200 Subject: [PATCH 1/2] Added support for IPv6 requirement I decided to add two additional PHP interpreter packages instead of an additional extension key. IPv6 support is part of PHP core (if enabled) and is not part of any optional extension. --- src/Composer/Repository/PlatformRepository.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index d5e7e583c..8e711b30f 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -77,14 +77,29 @@ class PlatformRepository extends ArrayRepository $version = $versionParser->normalize($prettyVersion); } + // The AF_INET6 constant is only defined if ext-sockets is available but IPv6 support might still be available. + $ipv6Support = defined('AF_INET6') || @inet_pton('::') !== false; + $php = new CompletePackage('php', $version, $prettyVersion); $php->setDescription('The PHP interpreter'); $this->addPackage($php); + if ($ipv6Support) { + $phpIpv6 = new CompletePackage('php-ipv6', $version, $prettyVersion); + $phpIpv6->setDescription('The PHP interpreter with IPv6 support'); + $this->addPackage($phpIpv6); + } + if (PHP_INT_SIZE === 8) { $php64 = new CompletePackage('php-64bit', $version, $prettyVersion); $php64->setDescription('The PHP interpreter, 64bit'); $this->addPackage($php64); + + if ($ipv6Support) { + $php64Ipv6 = new CompletePackage('php-64bit-ipv6', $version, $prettyVersion); + $php64Ipv6->setDescription('The PHP interpreter with IPV6 support, 64bit'); + $this->addPackage($php64Ipv6); + } } $loadedExtensions = get_loaded_extensions(); From b68921ce8f66e5e4fc12ebc86f04feae4fd21f1a Mon Sep 17 00:00:00 2001 From: Richard Fussenegger Date: Sat, 14 May 2016 09:53:59 +0200 Subject: [PATCH 2/2] Provide IPv6 requirement via ext --- .../Repository/PlatformRepository.php | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index 8e711b30f..80ad29ba6 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -77,29 +77,21 @@ class PlatformRepository extends ArrayRepository $version = $versionParser->normalize($prettyVersion); } - // The AF_INET6 constant is only defined if ext-sockets is available but IPv6 support might still be available. - $ipv6Support = defined('AF_INET6') || @inet_pton('::') !== false; - $php = new CompletePackage('php', $version, $prettyVersion); $php->setDescription('The PHP interpreter'); $this->addPackage($php); - if ($ipv6Support) { - $phpIpv6 = new CompletePackage('php-ipv6', $version, $prettyVersion); - $phpIpv6->setDescription('The PHP interpreter with IPv6 support'); - $this->addPackage($phpIpv6); - } - if (PHP_INT_SIZE === 8) { $php64 = new CompletePackage('php-64bit', $version, $prettyVersion); $php64->setDescription('The PHP interpreter, 64bit'); $this->addPackage($php64); + } - if ($ipv6Support) { - $php64Ipv6 = new CompletePackage('php-64bit-ipv6', $version, $prettyVersion); - $php64Ipv6->setDescription('The PHP interpreter with IPV6 support, 64bit'); - $this->addPackage($php64Ipv6); - } + // The AF_INET6 constant is only defined if ext-sockets is available but IPv6 support might still be available. + if (defined('AF_INET6') || @inet_pton('::') !== false) { + $phpIpv6 = new CompletePackage('ext-network-ipv6', $version, $prettyVersion); + $phpIpv6->setDescription('The network IPv6 PHP extension'); + $this->addPackage($phpIpv6); } $loadedExtensions = get_loaded_extensions();