2017 © Pedro Peláez
 

library backup

PHP Pdo MySQL备份扩展

image

cocolait/backup

PHP Pdo MySQL备份扩展

  • Saturday, May 12, 2018
  • by cocolait
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

backup

composer PHP Mysql备份扩展包, (*1)

链接

  • 博客:http://www.mgchen.com
  • github:https://github.com/cocolait
  • gitee:http://gitee.com/cocolait

安装

composer require cocolait/backup

版本要求

PHP >= 5.3 MySQL PDO扩展, (*2)

使用说明

该扩展包可以嵌套到任何框架中 不过必须支持版本要求, (*3)

使用案例

<?php
// 加载扩展 TODO 如果你使用的框架已支持composer那么这一行可直接忽略
require_once 'vendor/autoload.php';
// backup($path = '备份路径', $tableArray = [需要备份的表集合], $bool = '是否同时备份数据 默认false',['is_compress' => '是否写入内容文件进行压缩','is_download' => '是否进行下载'])
$config = [
        // 服务器地址
        'host'        => 'xx.xx.xx.xx',
        // 数据库名
        'database'    => 'xxx',
        // 用户名
        'user'        => 'xxx',
        // 密码
        'password'    => 'xxx',
        // 端口
        'port'        => '3306',
        // 字符编码
        'charset'     => 'utf8'
];
// 备份
$dir = "./backup/sql";//备份路径
$data = cocolait\sql\Backup::instance($config)->backUp($dir,[],true,['is_compress' => 0]);
print_r($data);die;

// 还原
$data = cocolait\sql\Backup::instance($config)->recover('xxx_20180512072455_194757120.sql',$dir);
print_r($data);die;

The Versions

12/05 2018

dev-master

9999999-dev http://www.mgchen.com/

PHP Pdo MySQL备份扩展

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0
  • ext-pdo *

 

by Avatar cocolait

database framework pdo cocolait

12/05 2018

2.1

2.1.0.0 http://www.mgchen.com/

PHP Pdo MySQL备份扩展

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0
  • ext-pdo *

 

by Avatar cocolait

database framework pdo cocolait

12/05 2018

2.0.2

2.0.2.0 http://www.mgchen.com/

PHP Pdo MySQL备份扩展

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0
  • ext-pdo *

 

by Avatar cocolait

database framework pdo cocolait

12/05 2018

2.0.1

2.0.1.0 http://www.mgchen.com/

PHP Pdo MySQL备份扩展

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0
  • ext-pdo *

 

by Avatar cocolait

database framework pdo cocolait

12/05 2018

1.0.1

1.0.1.0 http://www.mgchen.com/

thinkPHP 5.0.X MySQL备份扩展

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

by Avatar cocolait

11/05 2018

1.0

1.0.0.0 http://www.mgchen.com/

thinkPHP 5.0.X MySQL备份扩展

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0

 

by Avatar cocolait