Skip to content

Commit

Permalink
Reverted to initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
Fleshgrinder committed Jul 6, 2016
1 parent b94e8ea commit 45e998c
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/Composer/Repository/PlatformRepository.php
Expand Up @@ -12,9 +12,8 @@

namespace Composer\Repository;

use Composer\Config;
use Composer\Package\PackageInterface;
use Composer\Package\CompletePackage;
use Composer\Package\PackageInterface;
use Composer\Package\Version\VersionParser;
use Composer\Plugin\PluginInterface;
use Composer\Util\Silencer;
Expand Down Expand Up @@ -78,21 +77,29 @@ protected function initialize()
$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);
}

// The AF_INET6 constant is only defined if ext-sockets is available but IPv6 support might still be available.
if (defined('AF_INET6') || (function_exists('inet_pton') && Silencer::call('inet_pton', '::') !== false)) {
$phpIpv6 = new CompletePackage('ext-network-ipv6', $version, $prettyVersion);
$phpIpv6->setDescription('PHP IPv6 support');
$this->addPackage($phpIpv6);
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();
Expand Down

0 comments on commit 45e998c

Please sign in to comment.