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\PHPCodeSnifferCode
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;
}