32 lines
762 B
PHP
32 lines
762 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace MintyPHP\Console\Commands;
|
||
|
|
|
||
|
|
use MintyPHP\Console\Command;
|
||
|
|
|
||
|
|
final class DoctorCommand extends Command
|
||
|
|
{
|
||
|
|
public function name(): string
|
||
|
|
{
|
||
|
|
return 'doctor';
|
||
|
|
}
|
||
|
|
|
||
|
|
public function description(): string
|
||
|
|
{
|
||
|
|
return 'Run system health checks';
|
||
|
|
}
|
||
|
|
|
||
|
|
public function execute(array $args, array $options): int
|
||
|
|
{
|
||
|
|
// doctor.php is self-contained — include and let it run
|
||
|
|
$scriptPath = __DIR__ . '/../../../bin/doctor.php';
|
||
|
|
|
||
|
|
// Capture the exit code by running as a subprocess to avoid
|
||
|
|
// the script's own exit() call terminating our process.
|
||
|
|
$command = PHP_BINARY . ' ' . escapeshellarg($scriptPath);
|
||
|
|
passthru($command, $exitCode);
|
||
|
|
|
||
|
|
return $exitCode;
|
||
|
|
}
|
||
|
|
}
|