Skip to content

Commit

Permalink
Show debug restart command as an array or string
Browse files Browse the repository at this point in the history
  • Loading branch information
johnstevenson committed Mar 21, 2024
1 parent 6282b17 commit da886fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ private function reportRestarting(string $command): void
{
$text = sprintf('Process restarting (%s)', $this->getEnvAllow());
$this->output($text);
$text = 'Running '.$command;
$text = 'Running: '.$command;
$this->output($text);
}

Expand Down
8 changes: 5 additions & 3 deletions src/XdebugHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,19 +282,21 @@ protected function restart(array $command): void
*/
private function doRestart(array $command): void
{
$this->tryEnableSignals();
$this->notify(Status::RESTARTING, implode(' ', $command));

if (PHP_VERSION_ID >= 70400) {
$cmd = $command;
$displayCmd = sprintf('[%s]', implode(', ', $cmd));
} else {
$cmd = Process::escapeShellCommand($command);
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
// Outer quotes required on cmd string below PHP 8
$cmd = '"'.$cmd.'"';
}
$displayCmd = $cmd;
}

$this->tryEnableSignals();
$this->notify(Status::RESTARTING, $displayCmd);

$process = proc_open($cmd, [], $pipes);
if (is_resource($process)) {
$exitCode = proc_close($process);
Expand Down

0 comments on commit da886fc

Please sign in to comment.