소스 검색

Merge pull request #7857 from chr-hertel/feature/php-exec-path

Adding PHP_BINARY as env var to script execution
Jordi Boggiano 6 년 전
부모
커밋
8b90aadbe0
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      src/Composer/EventDispatcher/EventDispatcher.php

+ 6 - 0
src/Composer/EventDispatcher/EventDispatcher.php

@@ -244,6 +244,12 @@ class EventDispatcher
 
                 if (substr($exec, 0, 5) === '@php ') {
                     $exec = $this->getPhpExecCommand() . ' ' . substr($exec, 5);
+                } else {
+                    $finder = new PhpExecutableFinder();
+                    $phpPath = $finder->find(false);
+                    if ($phpPath) {
+                        putenv('PHP_BINARY=' . $phpPath);
+                    }
                 }
 
                 if (0 !== ($exitCode = $this->process->execute($exec))) {