Check if inet_pton() exists
parent
4aaff4c4b4
commit
4e06aa051a
|
@ -34,6 +34,15 @@ class Runtime
|
||||||
return constant(ltrim($class.'::'.$constant, ':'));
|
return constant(ltrim($class.'::'.$constant, ':'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $fn
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function hasFunction($fn)
|
||||||
|
{
|
||||||
|
return function_exists($fn);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param callable $callable
|
* @param callable $callable
|
||||||
* @param array $arguments
|
* @param array $arguments
|
||||||
|
|
|
@ -125,7 +125,7 @@ class PlatformRepository extends ArrayRepository
|
||||||
|
|
||||||
// The AF_INET6 constant is only defined if ext-sockets is available but
|
// The AF_INET6 constant is only defined if ext-sockets is available but
|
||||||
// IPv6 support might still be available.
|
// IPv6 support might still be available.
|
||||||
if ($this->runtime->hasConstant('AF_INET6') || Silencer::call(array($this->runtime, 'invoke'), array('inet_pton', '::')) !== false) {
|
if ($this->runtime->hasConstant('AF_INET6') || ($this->runtime->hasFunction('inet_pton') && Silencer::call(array($this->runtime, 'invoke'), array('inet_pton', '::')) !== false)) {
|
||||||
$phpIpv6 = new CompletePackage('php-ipv6', $version, $prettyVersion);
|
$phpIpv6 = new CompletePackage('php-ipv6', $version, $prettyVersion);
|
||||||
$phpIpv6->setDescription('The PHP interpreter, with IPv6 support');
|
$phpIpv6->setDescription('The PHP interpreter, with IPv6 support');
|
||||||
$this->addPackage($phpIpv6);
|
$this->addPackage($phpIpv6);
|
||||||
|
|
Loading…
Reference in New Issue