1
0
Fork 0

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.
pull/5317/head
Richard Fussenegger 2016-05-11 20:53:32 +02:00
parent d25b52a4d3
commit 132c37ab44
No known key found for this signature in database
GPG Key ID: 0528EB5E41F5F509
1 changed files with 15 additions and 0 deletions

View File

@ -77,14 +77,29 @@ class PlatformRepository extends ArrayRepository
$version = $versionParser->normalize($prettyVersion); $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 = new CompletePackage('php', $version, $prettyVersion);
$php->setDescription('The PHP interpreter'); $php->setDescription('The PHP interpreter');
$this->addPackage($php); $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) { if (PHP_INT_SIZE === 8) {
$php64 = new CompletePackage('php-64bit', $version, $prettyVersion); $php64 = new CompletePackage('php-64bit', $version, $prettyVersion);
$php64->setDescription('The PHP interpreter, 64bit'); $php64->setDescription('The PHP interpreter, 64bit');
$this->addPackage($php64); $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(); $loadedExtensions = get_loaded_extensions();