Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Allow phpdbg PHP SAPI #695

Merged
merged 1 commit into from
Apr 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Classes/Console/Core/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function __construct(\Composer\Autoload\ClassLoader $classLoader)
*/
private function ensureRequiredEnvironment()
{
if (PHP_SAPI !== 'cli' || !isset($_SERVER['argc'], $_SERVER['argv'])) {
if (!in_array(PHP_SAPI, ['cli', 'phpdbg'], true) || !isset($_SERVER['argc'], $_SERVER['argv'])) {
echo 'The command line must be executed with a cli PHP binary! The current PHP sapi type is "' . PHP_SAPI . '".' . PHP_EOL;
exit(1);
}
Expand Down
5 changes: 4 additions & 1 deletion Classes/Console/Mvc/Cli/CommandDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,13 @@ public static function createFromTestRun($typo3CommandPath = null): self
public static function create($typo3CommandPath, array $commandLine = [], array $environmentVars = [], PhpExecutableFinder $phpFinder = null): self
{
$phpFinder = $phpFinder ?: new PhpExecutableFinder();
if (!($php = $phpFinder->find())) {
if (!($php = $phpFinder->find(false))) {
throw new RuntimeException('The "php" binary could not be found.', 1485128615);
}
array_unshift($commandLine, $typo3CommandPath);
if (!empty($phpArguments = $phpFinder->findArguments())) {
array_unshift($commandLine, ...$phpArguments);
}
array_unshift($commandLine, $php);
if (getenv('PHP_INI_PATH')) {
$commandLine[] = '-c';
Expand Down