symandy/database-backup-bundle
Composer 安装命令:
composer require symandy/database-backup-bundle
包简介
A Symfony Bundle to handle databases backup
README 文档
README
DatabaseBackupBundle is a Symfony Bundle to manage your databases backup.
Installation
composer require symandy/database-backup-bundle
If Symfony Flex is not enabled yet for the bundle (A PR on
symfony/recipes-contrib will be submitted soon), add the following lines
to config/bundles.php.
<?php return [ ... Symandy\DatabaseBackupBundle\SymandyDatabaseBackupBundle::class => ['all' => true], ... ];
Configuration
YAML configuration
As in the previous part, if Symfony Flex is not enabled, add the following file (symandy_database_backup.yaml)
to config/packages directory.
Basic configuration
If the only purpose is to back up the database of the current project, use the basic configuration file.
symandy_database_backup: backups: app: connection: url: "%env(DATABASE_URL)%" strategy: max_files: 5 backup_directory: "%kernel.project_dir%/backups"
Advanced usages
symandy_database_backup: backups: foo: connection: # driver: !php/const \Symandy\DatabaseBackupBundle\Model\ConnectionDriver::MySQL driver: mysql # Usage of environment variables as parameters is recommended for connections configuration configuration: user: "%app.foo_db_user%" password: "%app.foo_db_password%" host: 127.0.0.1 # Already the default value, don't need to be added port: 3306 # Already the default value, don't need to be added databases: [foo, bar, baz] # Will only back up these databases strategy: max_files: 5 # Number of files kept after a backup (per database) # backup_directory: "/var/www/backups" # The directory must be created and must have the right permissions backup_directory: "%kernel.project_dir%/backups" # backup_directory: ~ # The current directory will be used if no value is passed date_format: 'Y-m-d-His' # The date format to use in backup files (default: 'Y-m-d') bar: # Use Doctrine database url env parameter connection: url: "%env(DATABASE_URL)%" # url key will ALWAYS override array configuration configuration: user: john # Overridden by url
Drivers
Only the mysql driver is currently available.
Usage
Once the backups are configured, you only have to run the following command to generate the dumped databases backup files:
php bin/console symandy:databases:backup
It will generate one file by database in the format <backup_name>-<database>-<date_format>.sql.
Changelog
You can see all the changes between versions here in the CHANGELOG.md or in the GitHub releases page
symandy/database-backup-bundle 适用场景与选型建议
symandy/database-backup-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 928 次下载、GitHub Stars 达 5, 最近一次更新时间为 2022 年 04 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 symandy/database-backup-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 symandy/database-backup-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 928
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-04-21