- ConsoleApplication.discoverCommands() scans lib/Console/Commands/ automatically; adding a new command no longer requires editing bin/console - Command base class provides bootstrapApp(), bootstrapModuleApp(), requireBinScript() and projectRoot() helpers — eliminates fragile 4-level relative require_once paths - Per-command --help support via optional usage() method on Command - Docker-compose scheduler updated to use bin/console scheduler:run - Old bin scripts now emit deprecation hint to stderr when called directly Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
27 lines
603 B
PHP
27 lines
603 B
PHP
<?php
|
|
|
|
namespace MintyPHP\Console\Commands\Module;
|
|
|
|
use MintyPHP\Console\Command;
|
|
|
|
final class PermissionsSyncCommand extends Command
|
|
{
|
|
public function name(): string
|
|
{
|
|
return 'module:permissions-sync';
|
|
}
|
|
|
|
public function description(): string
|
|
{
|
|
return 'Sync module permissions to DB and deactivate orphaned ones';
|
|
}
|
|
|
|
public function execute(array $args, array $options): int
|
|
{
|
|
$this->requireBinScript('module-cli-bootstrap.php');
|
|
$this->requireBinScript('module-permissions-sync.php');
|
|
|
|
return modulePermissionsSyncRun();
|
|
}
|
|
}
|