exolnet/laravel-backup-database

通过添加一个简单的命令来扩展laravel-backup以备份数据库。

v1.9.0 2024-03-28 14:28 UTC

This package is auto-updated.

Last update: 2024-08-28 15:37:37 UTC


README

Latest Release Total Downloads Build Status Software License

通过添加一个简单的命令来扩展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发送电子邮件,而不是使用问题跟踪器。

鸣谢

许可协议

此代码受MIT许可协议许可。请参阅许可文件以获取更多信息。