diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index dcf791857..214c8022f 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -144,5 +144,19 @@ class PlatformRepository extends ArrayRepository $lib->setDescription('The '.$name.' PHP library'); parent::addPackage($lib); } + + if (defined('HHVM_VERSION')) { + try { + $prettyVersion = HHVM_VERSION; + $version = $versionParser->normalize($prettyVersion); + } catch (\UnexpectedValueException $e) { + $prettyVersion = preg_replace('#^([^~+-]+).*$#', '$1', HHVM_VERSION); + $version = $versionParser->normalize($prettyVersion); + } + + $hhvm = new CompletePackage('hhvm', $version, $prettyVersion); + $hhvm->setDescription('The HHVM Runtime (64bit)'); + parent::addPackage($hhvm); + } } }