PHPackages                             caroltc/ant-backup - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. caroltc/ant-backup

ActiveLibrary[File &amp; Storage](/categories/file-storage)

caroltc/ant-backup
==================

quickly backup and recover your database

1113PHP

Since Feb 13Pushed 9y ago1 watchersCompare

[ Source](https://github.com/caroltc/ant-backup)[ Packagist](https://packagist.org/packages/caroltc/ant-backup)[ RSS](/packages/caroltc-ant-backup/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

ant-backup
----------

[](#ant-backup)

quickly backup your database

安装
--

[](#安装)

```
composer require caroltc/ant-backup

```

### 使用示例

[](#使用示例)

```
$data = array(
            'writer_type' => 'file', // 目前只支持file
            'db_type' => 'mysql',
            'db_username' => 'root',
            'db_password' => 'root',
            'db_host' => '127.0.0.1',
            'db_name' => 'ctbms_db',
            'db_port' => '3306',
            'db_charset' => 'UTF-8',
            'file_path' => '/phpstudy/www/BMS_3.0/data/backup', // 需读写权限
            'file_name' => '', // 可为空
            'gz_write' => true  // 是否开启gzip压缩,需gzip拓展
        );
        $BC = new AntBackup($data);

        // 备份
        $rs = $BC->dbBackup();
        print_r($rs);

        // 获取备份列表
        $list = $BC->getBackupList();
        print_r($list);

        // 恢复指定文件
        $rs = $BC->dbRecover('20170208162648_backup.gz');
        var_dump($rs);

```

### 开发计划

[](#开发计划)

- 基本备份\[已完成\]
- 基本恢复\[已完成\]
- 备份压缩\[已完成\]
- 从压缩文件恢复\[已完成\]
- 下载备份
- 上传备份恢复
- 邮件备份
- 设置备份最大数量
- 指定表备份

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d37f0fdc4b0cc105dd824ce15cf08984ae7a61b2b680f158fce155be90f73d4?d=identicon)[caroltc](/maintainers/caroltc)

---

Top Contributors

[![caroltc](https://avatars.githubusercontent.com/u/3196616?v=4)](https://github.com/caroltc "caroltc (1 commits)")

### Embed Badge

![Health badge](/badges/caroltc-ant-backup/health.svg)

```
[![Health](https://phpackages.com/badges/caroltc-ant-backup/health.svg)](https://phpackages.com/packages/caroltc-ant-backup)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M123](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
