2026-03-19 19:04:28 +01:00
|
|
|
<?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
|
|
|
|
|
{
|
2026-03-19 19:16:36 +01:00
|
|
|
// doctor.php calls exit() internally — run as subprocess
|
|
|
|
|
// to avoid terminating the console process.
|
|
|
|
|
$scriptPath = $this->projectRoot() . '/bin/doctor.php';
|
2026-03-19 19:04:28 +01:00
|
|
|
$command = PHP_BINARY . ' ' . escapeshellarg($scriptPath);
|
|
|
|
|
passthru($command, $exitCode);
|
|
|
|
|
|
|
|
|
|
return $exitCode;
|
|
|
|
|
}
|
|
|
|
|
}
|