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

Breadcrumb

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

function Runtime::getRawBinary

Returns the raw path to the binary of the current runtime.

1 call to Runtime::getRawBinary()
Runtime::getBinary in vendor/sebastian/environment/src/Runtime.php
Returns the escaped path to the binary of the current runtime.

File

vendor/sebastian/environment/src/Runtime.php, line 96

Class

Runtime

Namespace

SebastianBergmann\Environment

Code

public function getRawBinary() : string {
    if (self::$initialized) {
        return self::$rawBinary;
    }
    if (PHP_BINARY !== '') {
        self::$rawBinary = PHP_BINARY;
        self::$initialized = true;
        return self::$rawBinary;
    }
    // @codeCoverageIgnoreStart
    $possibleBinaryLocations = [
        PHP_BINDIR . '/php',
        PHP_BINDIR . '/php-cli.exe',
        PHP_BINDIR . '/php.exe',
    ];
    foreach ($possibleBinaryLocations as $binary) {
        if (is_readable($binary)) {
            self::$rawBinary = $binary;
            self::$initialized = true;
            return self::$rawBinary;
        }
    }
    self::$rawBinary = 'php';
    self::$initialized = true;
    return self::$rawBinary;
    // @codeCoverageIgnoreEnd
}
RSS feed
Powered by Drupal