refactor: extract shared code from bin/ scripts and remove legacy scheduler runner
- Extract ModuleManifestLoader for standalone manifest loading (used by module-deactivate and ValidateCommand) - Extract SqlStatementParser, ModuleMigrationRepository, and ModuleMigrationService from bin/module-migrate.php to enforce strict layering (SQL in repository, orchestration in service) - Delete bin/scheduler-run.php (fully superseded by bin/console scheduler:run) - Update docs and test fixtures to reference bin/console Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -37,20 +37,10 @@ function moduleDeactivateRun(): int
|
||||
}
|
||||
|
||||
$projectRoot = moduleCliProjectRoot();
|
||||
$manifestFile = $projectRoot . '/modules/' . $moduleId . '/module.php';
|
||||
|
||||
if (!is_file($manifestFile)) {
|
||||
fwrite(STDERR, "Error: module manifest not found at {$manifestFile}\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
$raw = require $manifestFile;
|
||||
if (!is_array($raw)) {
|
||||
fwrite(STDERR, "Error: manifest must return an array.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
$manifest = \MintyPHP\App\Module\ModuleManifest::fromArray($raw, dirname($manifestFile));
|
||||
$manifest = \MintyPHP\App\Module\ModuleManifestLoader::loadFromDisk(
|
||||
$projectRoot . '/modules',
|
||||
$moduleId
|
||||
);
|
||||
|
||||
$handlerClass = $manifest->deactivationHandler;
|
||||
if ($handlerClass === null) {
|
||||
|
||||
Reference in New Issue
Block a user