exolnet / laravel-backup-database
通过添加一个简单的命令来扩展laravel-backup以备份数据库。
v1.9.0
2024-03-28 14:28 UTC
Requires
- php: ^8.1
- illuminate/console: ^10.0|^11.0
- illuminate/support: ^10.0|^11.0
- spatie/laravel-backup: ^8.0
Requires (Dev)
- mockery/mockery: ^1.4
- orchestra/testbench: ^8.0|^9.0
- phpunit/phpunit: ^10.5
- squizlabs/php_codesniffer: ^3.6
README
通过添加一个简单的命令来扩展laravel-backup以备份数据库。无需配置!
安装
使用composer安装此包
composer require exolnet/laravel-backup-database
如果您不使用包自动发现,请将服务提供者添加到config/app.php
中的providers
数组中
Exolnet\Backup\BackupServiceProvider::class
使用方法
Usage:
backup:database [options] [--] [<filename>]
Arguments:
filename Custom filename to use instead of the generated one
Options:
--connection[=CONNECTION] Connection to use instead of the default one
--path[=PATH] Path where to dump the database instead of the current directory
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--env[=ENV] The environment the command should run under
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Help:
Backup (dump) the database.
示例
要转储默认数据库,请运行
php artisan backup:database
要使用自定义文件名转储默认数据库,请运行
php artisan backup:database my_filename.sql.gz
要将默认数据库转储到自定义路径,请运行
php artisan backup:database --path=/path/to/the/backup/directory
要转储其他数据库,请运行
php artisan backup:database --connection=sqlite
测试
要运行phpUnit测试,请使用
composer test
贡献
请参阅CONTRIBUTING和行为准则以获取详细信息。
安全
如果您发现任何安全相关的问题,请通过security@exolnet.com发送电子邮件,而不是使用问题跟踪器。