Split detail page contracts
This commit is contained in:
31
lib/Console/Commands/DoctorCommand.php
Normal file
31
lib/Console/Commands/DoctorCommand.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user