PHPackages                             kocor/tp5-databackup - 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. kocor/tp5-databackup

ActiveProject

kocor/tp5-databackup
====================

THINKPHP5

0151PHP

Since Feb 28Pushed 8y agoCompare

[ Source](https://github.com/kocor01/tp5_databackup)[ Packagist](https://packagist.org/packages/kocor/tp5-databackup)[ RSS](/packages/kocor-tp5-databackup/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

tp5\_databackup
===============

[](#tp5_databackup)

THINKPHP5 数据库备份还原

初始化
===

[](#初始化)

$this-&gt;config = \[ 'path' =&gt; RUNTIME\_PATH.'/Backup/',//数据库备份路径 'part' =&gt; 20971520,//20M 数据库备份卷大小 'compress' =&gt; 1,//数据库备份文件是否启用压缩 0不压缩 1 压缩 'level' =&gt; 9 //数据库备份文件压缩级别 1普通 4 一般 9最高 \];

数据库表列表
======

[](#数据库表列表)

$backup = new BackupModel($this-&gt;config); $tableList = $backup-&gt;dataList();

备份
==

[](#备份)

$backup = new BackupModel($this-&gt;config); foreach ($tableList as $key =&gt; $value) { $start= $backup-&gt;backup($value, 0); if($start !== 0){ bleak; } }

还原
==

[](#还原)

$backup = new BackupModel($this-&gt;config); $file = \['name' =&gt; date('Ymd-His',$time), 'part' =&gt; ($part)\]; $backup-&gt;setFile($file)-&gt;import($compress);

删除
==

[](#删除)

$time = Request::instance()-&gt;param('time/s'); $backup = new BackupModel($this-&gt;config); $tableList = $backup-&gt;delFile($time);

下载
==

[](#下载)

$backup = new BackupModel($this-&gt;config); $tableList = $backup-&gt;downloadFile($time,$part);

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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/b5992e16ce24c304d3c898ac5f7228cdbf9a4ec898a89a2cb8daa673c3a6d6be?d=identicon)[kocor](/maintainers/kocor)

### Embed Badge

![Health badge](/badges/kocor-tp5-databackup/health.svg)

```
[![Health](https://phpackages.com/badges/kocor-tp5-databackup/health.svg)](https://phpackages.com/packages/kocor-tp5-databackup)
```

PHPackages © 2026

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