Console plugin - CLI commands #29

Open
opened 2026-06-04 17:08:49 +00:00 by jmiller · 0 comments
Owner

Summary

New plg_console_mokobackup plugin providing Symfony Console commands for CLI backup management via php joomla.php.

Commands

Command Description
mokobackup:run Run a backup (--profile, --description)
mokobackup:list List backup records (--limit, --status)
mokobackup:profiles List available backup profiles
mokobackup:restore Restore a backup by record ID (with confirmation)
mokobackup:cleanup Clean up old backups (--max-age, --max-count, --dry-run)

Implementation

  • Registers commands via ApplicationEvents::BEFORE_EXECUTE
  • Each command extends AbstractCommand
  • Uses SymfonyStyle for formatted CLI output

Files

  • src/packages/plg_console_mokobackup/ (full plugin directory)

Verification

php joomla.php mokobackup:profiles
php joomla.php mokobackup:run --profile=1
php joomla.php mokobackup:list
php joomla.php mokobackup:cleanup --dry-run
## Summary New `plg_console_mokobackup` plugin providing Symfony Console commands for CLI backup management via `php joomla.php`. ## Commands | Command | Description | |---|---| | `mokobackup:run` | Run a backup (`--profile`, `--description`) | | `mokobackup:list` | List backup records (`--limit`, `--status`) | | `mokobackup:profiles` | List available backup profiles | | `mokobackup:restore` | Restore a backup by record ID (with confirmation) | | `mokobackup:cleanup` | Clean up old backups (`--max-age`, `--max-count`, `--dry-run`) | ## Implementation - Registers commands via `ApplicationEvents::BEFORE_EXECUTE` - Each command extends `AbstractCommand` - Uses `SymfonyStyle` for formatted CLI output ## Files - `src/packages/plg_console_mokobackup/` (full plugin directory) ## Verification ```bash php joomla.php mokobackup:profiles php joomla.php mokobackup:run --profile=1 php joomla.php mokobackup:list php joomla.php mokobackup:cleanup --dry-run ```
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoJoomBackup#29