From 2d92dd6181247c8db27275f7599edaf75a9a63a3 Mon Sep 17 00:00:00 2001 From: Arnaud Ligny Date: Fri, 12 Jan 2024 18:37:34 +0100 Subject: [PATCH] Update Serve.php --- src/Command/Serve.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Command/Serve.php b/src/Command/Serve.php index 36c0c2939..65e5b7ca1 100644 --- a/src/Command/Serve.php +++ b/src/Command/Serve.php @@ -137,14 +137,12 @@ protected function execute(InputInterface $input, OutputInterface $output) $buildProcess->setPty(Process::isPtySupported()); $buildProcess->setTimeout(3600 * 2); // timeout = 2 minutes - $processOutputCallback = function ($type, $data) use ($output) { - $output->write($data, false, OutputInterface::OUTPUT_RAW); + $processOutputCallback = function ($type, $buffer) use ($output) { + $output->write($buffer, false, OutputInterface::OUTPUT_RAW); }; // (re)builds before serve - if ($this->getBuilder()->isDebug()) { - $output->writeln(sprintf('Build process: %s', implode(' ', $buildProcessArguments))); - } + $output->writeln(sprintf('Build process: %s', implode(' ', $buildProcessArguments)), OutputInterface::VERBOSITY_DEBUG); $buildProcess->run($processOutputCallback); if ($buildProcess->isSuccessful()) { Util\File::getFS()->dumpFile(Util::joinFile($this->getPath(), self::TMP_DIR, 'changes.flag'), time()); @@ -177,7 +175,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } $output->writeln(sprintf('Server process: %s', $command), OutputInterface::VERBOSITY_DEBUG); $output->writeln(sprintf('Starting server (%s:%d)...', $host, $port, $host, $port)); - $process->start(function ($type, $buffer) use (&$output) { + $process->start(function ($type, $buffer) { if ($type === Process::ERR) { error_log($buffer, 3, Util::joinFile($this->getPath(), self::TMP_DIR, 'errors.log')); }