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

Breadcrumb

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

function Plugin::getPhpExecCommand

Get the path to the current PHP version being used.

Duplicate of the same in the EventDispatcher class in Composer itself.

1 call to Plugin::getPhpExecCommand()
Plugin::getPhpcsCommand in vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php
Get the command to call PHPCS.

File

vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php, line 380

Class

Plugin
PHP_CodeSniffer standard installation manager.

Namespace

PHPCSStandards\Composer\Plugin\Installers\PHPCodeSniffer

Code

protected function getPhpExecCommand() {
    $finder = new PhpExecutableFinder();
    $phpPath = $finder->find(false);
    if ($phpPath === false) {
        throw new \RuntimeException('Failed to locate PHP binary to execute ' . $phpPath);
    }
    $phpArgs = $finder->findArguments();
    $phpArgs = $phpArgs ? ' ' . implode(' ', $phpArgs) : '';
    $command = ProcessExecutor::escape($phpPath) . $phpArgs . ' -d allow_url_fopen=' . ProcessExecutor::escape(ini_get('allow_url_fopen')) . ' -d disable_functions=' . ProcessExecutor::escape(ini_get('disable_functions')) . ' -d memory_limit=' . ProcessExecutor::escape(ini_get('memory_limit'));
    return $command;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal