1 <?php declare(strict_types=1);
3 namespace Cli\Services;
9 public function __construct(
10 protected string $appDir
14 public function run(array $commandArgs)
16 $errors = (new ProgramRunner('php', '/usr/bin/php'))
18 ->withIdleTimeout(600)
19 ->withEnvironment(EnvironmentLoader::load($this->appDir))
20 ->runCapturingAllOutput([
21 $this->appDir . DIRECTORY_SEPARATOR . 'artisan',
27 $cmdString = implode(' ', $commandArgs);
28 throw new Exception("Failed 'php artisan {$cmdString}' with errors:\n" . $errors);