Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. HhvmDetector.php

function HhvmDetector::getVersion

File

vendor/composer/composer/src/Composer/Platform/HhvmDetector.php, line 39

Class

HhvmDetector

Namespace

Composer\Platform

Code

public function getVersion() : ?string {
    if (null !== self::$hhvmVersion) {
        return self::$hhvmVersion ?: null;
    }
    self::$hhvmVersion = defined('HHVM_VERSION') ? HHVM_VERSION : null;
    if (self::$hhvmVersion === null && !Platform::isWindows()) {
        self::$hhvmVersion = false;
        $this->executableFinder = $this->executableFinder ?: new ExecutableFinder();
        $hhvmPath = $this->executableFinder
            ->find('hhvm');
        if ($hhvmPath !== null) {
            $this->processExecutor = $this->processExecutor ?? new ProcessExecutor();
            $exitCode = $this->processExecutor
                ->execute([
                $hhvmPath,
                '--php',
                '-d',
                'hhvm.jit=0',
                '-r',
                'echo HHVM_VERSION;',
            ], self::$hhvmVersion);
            if ($exitCode !== 0) {
                self::$hhvmVersion = false;
            }
        }
    }
    return self::$hhvmVersion ?: null;
}
RSS feed
Powered by Drupal