PHPackages                             runopencode/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. runopencode/backup

Abandoned → [phpbu/phpbu](/?search=phpbu%2Fphpbu)Library[File &amp; Storage](/categories/file-storage)

runopencode/backup
==================

Simple web application backup library, fork of 'kbond/php-backup'.

1.0.4(9y ago)931[1 issues](https://github.com/RunOpenCode/backup/issues)MITPHPPHP &gt;=5.4

Since Dec 28Pushed 9y ago4 watchersCompare

[ Source](https://github.com/RunOpenCode/backup)[ Packagist](https://packagist.org/packages/runopencode/backup)[ RSS](/packages/runopencode-backup/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (7)Versions (6)Used By (0)

\[DEPRECIATED\] Simple web application backup library
=====================================================

[](#depreciated-simple-web-application-backup-library)

**This library is depreciated, please use **

---

[![Packagist](https://camo.githubusercontent.com/071642458f4eac0aaaac33bcfb45b7b271dfbbc49c963990d6d9b1c1de6f753d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f52756e4f70656e436f64652f6261636b75702e737667)](https://packagist.org/packages/runopencode/backup)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/39299eb98eb6dab461a74e2e002c25eda39a643e3be13a9493190c6168d5efda/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f52756e4f70656e436f64652f6261636b75702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/RunOpenCode/backup/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/e7ccbbbcf8a1e8438a49abacd6fedb7b53aab2ff82433c36ffbf52d62f5c906c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f52756e4f70656e436f64652f6261636b75702f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/RunOpenCode/backup/?branch=master)[![Build Status](https://camo.githubusercontent.com/3f8ed30835ae809360a9b63c7a27c78742978db0d3a7904b227806143d85323b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f52756e4f70656e436f64652f6261636b75702f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/RunOpenCode/backup/build-status/master)[![Build Status](https://camo.githubusercontent.com/655ef055ff8fcc1aa7ebb94b483dcf46bf38c8b242208a9ea0e677dd6dae354b/68747470733a2f2f7472617669732d63692e6f72672f52756e4f70656e436f64652f6261636b75702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/RunOpenCode/backup)

[![SensioLabsInsight](https://camo.githubusercontent.com/d439eb9790f339267f9f32cc539d19e7ba6c5568d049946ab776e6b532eb9de3/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f36333064366130382d396666382d343039392d616464612d3866663333653239613332392f6269672e706e67)](https://insight.sensiolabs.com/projects/630d6a08-9ff8-4099-adda-8ff33e29a329)

**NOTE:** *This library is fork of 'kbond/php-backup' library with significant modifications which disables compatibility with its original.*

Every process of backup can be broken down to several activities:

- Prepare files to backup from various sources (filesystem, database...)
- Process those files somehow (create zip archive, per example) and name it according to some convention
- Determine if there is sufficient backup space on your backup storage system, and delete old backups if neccessary
- Copy new backup to backup destination (usually into new folder named with current date and time)

Having in mind the process stated above, we can identify several major parts of backup system:

- **Source** of files which needs to be backed up. Even database belongs to this category, since database backup is a file.
- **Backup** is collection of **Files** retrieved from Sources.
- **Processor** process Files within backup somehow (usually compress them into single archive, but it is not limited to mentioned).
- **Namer** provides new name for Backup according to some desired rule (timestamping or similar).
- **Rotator** checks previous backups within backup storage and removes old backups if some rotation constraint is violated (per example, max size of backup storage).
- **Destination** is abstraction of backup storage where backups residue.
- **Workflow** is abstraction of backup process which is executed trough sequence of backup activities. This library provides default workflow, which can be replaced with your own if default one does not suits your needs.
- **Profile** is collection of all above stated, it defines what have to backed up, how backup has to be processed, what name to use, where to store new backups and how to rotate old backups.
- **Manager** is collection of profiles, he provides profiles with Logger and EventDispatcher and executes them.

*Note that author of this brilliant idea on how to brake down to fundamental backup system components is [Kevin Bond](https://github.com/kbond).*

See if this library is for you by evaluating simple example
===========================================================

[](#see-if-this-library-is-for-you-by-evaluating-simple-example)

Let's backup our website by creating simple application that will be executed by `crontab`. Let's say that our code is in some `app.php` file (Don't be scared with amount of code - each line is commented so you can understand the concept with ease).

```
