Skip to content

Commit

Permalink
Improved ConsoleLogger to support running in watcher (#7033)
Browse files Browse the repository at this point in the history
  • Loading branch information
huangdijia authored Aug 29, 2024
1 parent 4e7ee37 commit a7fa38b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Watcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,18 @@ public function restart($isStart = true)
$this->channel->pop();
$this->output->writeln('Start server ...');

$descriptorspec = [
$descriptorSpec = [
0 => STDIN,
1 => STDOUT,
2 => STDERR,
];

proc_open($this->option->getBin() . ' ' . BASE_PATH . '/' . $this->option->getCommand(), $descriptorspec, $pipes);
proc_open(
$this->option->getBin() . ' ' . BASE_PATH . '/' . $this->option->getCommand(),
$descriptorSpec,
$pipes,
env_vars: $_ENV

This comment has been minimized.

Copy link
@zhlhuang

zhlhuang Sep 8, 2024

加了 env_vars: $_ENV 之后,会报错 php: command not found
以前我是默认没有 配置文件 watcher.php ,现在需要到配置文件指定 php bin

This comment has been minimized.

Copy link
@wtry

wtry Sep 13, 2024

env_vars 需要加上 getenv,不然无法获取到 docker environment

);

$this->output->writeln('Stop server success.');
$this->channel->push(1);
Expand Down

0 comments on commit a7fa38b

Please sign in to comment.