helloswish / craft-db-dump

A simple way to perform database backups in Craft CMS.
MIT License
4 stars 1 forks source link

Feature/add console command #4

Closed jrrdnx closed 2 years ago

jrrdnx commented 2 years ago

Sorry for all the extra commits. I'm not used to forking repos and installing from the fork as I usually work on everything locally.

Essentially, this adds src/console/controllers/BackupController.php that enables backups to be ran via command line with php craft db-dump/backup. To accomplish this, the existing controller method was moved to its own service so the same method can be called from both the web and console controllers. A few adjustments to that have been made to account for differences when running via console (ignores redirects, doesn't require the key, and doesn't die()).