refactor(cli)!: hard-cut legacy scripts and standardize console runtime
- remove legacy bin/module-*.php and bin/doctor.php entry scripts - move module/doctor execution into class-based runners under lib/Console - add stable JSON output for doctor and module:sync - introduce bin/dev for init/up/down/logs/console/qa workflow - update DI wiring, phpstan scan config, tests, and docs to new CLI contract
This commit is contained in:
@@ -2,9 +2,7 @@
|
||||
|
||||
namespace MintyPHP\Console\Commands\Module;
|
||||
|
||||
use MintyPHP\Console\Command;
|
||||
|
||||
final class DeactivateCommand extends Command
|
||||
final class DeactivateCommand extends AbstractModuleCommand
|
||||
{
|
||||
public function name(): string
|
||||
{
|
||||
@@ -37,18 +35,15 @@ final class DeactivateCommand extends Command
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Rebuild global argv for the underlying script
|
||||
global $argv;
|
||||
$argv = ['module-deactivate.php', $moduleId];
|
||||
if ($options['confirm'] ?? false) {
|
||||
$argv[] = '--confirm';
|
||||
}
|
||||
if ($options['dry-run'] ?? false) {
|
||||
$argv[] = '--dry-run';
|
||||
}
|
||||
$result = $this->moduleRunner()->deactivate(
|
||||
$moduleId,
|
||||
(bool) ($options['confirm'] ?? false),
|
||||
(bool) ($options['dry-run'] ?? false)
|
||||
);
|
||||
|
||||
$this->requireBinScript('module-deactivate.php');
|
||||
$stream = $result['exit_code'] === 0 ? STDOUT : STDERR;
|
||||
fwrite($stream, $result['message'] . PHP_EOL);
|
||||
|
||||
return moduleDeactivateRun();
|
||||
return (int) $result['exit_code'];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user