backup-manager/symfony 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

backup-manager/symfony

Composer 安装命令:

composer require backup-manager/symfony

包简介

A simple database backup manager for Symfony2 with support for S3, Rackspace, Dropbox, FTP, SFTP.

README 文档

README

Latest Stable Version License Build Status Total Downloads

A simple database backup manager for Symfony with support for S3, Rackspace, Dropbox, FTP, SFTP.

This package pulls in the framework agnostic Backup Manager and provides seamless integration with Symfony.

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require backup-manager/symfony

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2 (with Flex): Enable the Bundle

You do not need to do anything more. The bundle is enabled automatically and you have some nice default config in config/packages/bm_backup_manager.yml.

Step 2 (no Flex): Enable the Bundle

If you are not using Symfony Flex, you need to enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project.

// config/bundles.php

return [
    BM\BackupManagerBundle\BMBackupManagerBundle::class => ['all' => true],
    // ...
];

Step 3: Configure your databases and filesystems

# config/packages/bm_backup_manager.yml

bm_backup_manager:
    database:
        development:
            type: mysql
            host: localhost
            port: 3306
            user: root
            pass: password
            database: test
            ignoreTables: ['foo', 'bar']

            # If DSN is specified, it will override other values
            dsn: 'mysql://root:root_pass@127.0.0.1:3306/test_db'
        production:
            type: postgresql
            host: localhost
            port: 5432
            user: postgres
            pass: password
            database: test

            # You could also use a environment variable
            dsn: '%env(resolve:DATABASE_URL)%'
    storage:
        local:
            type: Local
            root: /path/to/working/directory
        s3:
            type: AwsS3
            key:
            secret:
            region: us-east-1
            version: latest
            bucket:
            root:
        b2:
            type: B2
            key:
            accountId:
            bucket:
        rackspace:
            type: Rackspace
            username:
            password:
            container:
        dropbox:
            type: DropboxV2
            token:
            key:
            secret:
            app:
            root:
        ftp:
            type: Ftp
            host:
            username:
            password:
            root:
            port: 21
            passive: true
            ssl: true
            timeout: 30
        sftp:
            type: Sftp
            host:
            username:
            password:
            root:
            port: 21
            timeout: 10
            privateKey:

Usage

To backup from any configured database.

Backup the development database to Amazon S3. The S3 backup path will be test/backup.sql.gz in the end, when gzip is done with it.

class Foo {
  private $backupManager;

  public function __construct(BackupManager $backupManager) {
      $this->backupManager = $backupManager;
  }

  public function bar() {
      $this->backupManager->makeBackup()->run('development', [new Destination('s3', 'test/backup.sql')], 'gzip');
  }
}

Or with a command:

php bin/console backup-manager:backup development s3 -c gzip --filename test/backup.sql

To restore from any configured filesystem.

Restore the database file test/backup.sql.gz from Amazon S3 to the development database.

class Foo {
  private $backupManager;

  public function __construct(BackupManager $backupManager) {
      $this->backupManager = $backupManager;
  }

  public function bar() {
      $this->backupManager->makeRestore()->run('s3', 'test/backup.sql.gz', 'development', 'gzip');
  }
}

Or with a command:

php bin/console backup-manager:restore development s3 test/backup.sql.gz -c gzip

This package does not allow you to backup from one database type and restore to another. A MySQL dump is not compatible with PostgreSQL.

Requirements

  • PHP 7.3
  • MySQL support requires mysqldump and mysql command-line binaries
  • PostgreSQL support requires pg_dump and psql command-line binaries
  • Gzip support requires gzip and gunzip command-line binaries

backup-manager/symfony 适用场景与选型建议

backup-manager/symfony 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 298.42k 次下载、GitHub Stars 达 119, 最近一次更新时间为 2016 年 11 月 18 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「database」 「symfony」 「s3」 「backup」 「sftp」 「rackspace」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 backup-manager/symfony 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 backup-manager/symfony 我们能提供哪些服务?
定制开发 / 二次开发

基于 backup-manager/symfony 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 298.42k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 123
  • 点击次数: 28
  • 依赖项目数: 4
  • 推荐数: 1

GitHub 信息

  • Stars: 119
  • Watchers: 6
  • Forks: 41
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-18