Download the PHP package phil/backup without Composer

On this page you can find all versions of the php package phil/backup. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package backup

phil/backup

Back a database and its media files up, encrypted and rotated, restore them behind a guard, and prove that they restore.

phil/backup copies a database to a file with its platform's own client tools — sqlite3, mysqldump or mariadb-dump, pg_dump — and back with sqlite3, mysql or mariadb, pg_restore. Credentials never reach a command line, where every user of the machine reads them: MySQL and MariaDB read them from an option file readable by its owner alone, PostgreSQL from the tool's environment. The media directories of the application — uploads, generated images, documents — go beside the database in a tar archive, each under a name rather than a path, so that a backup restores on a machine whose directories are elsewhere.

Every file of a backup can be encrypted with a 32-byte key by libsodium's secret stream, chunk by chunk, so that a backup of any size passes through a fixed amount of memory and an altered, cut or swapped file is refused. Backups are named after the database and the time in UTC, and a grandfather-father-son rotation keeps the latest ones and the most recent of each day, week and month. A restore guard refuses a restore in production unless an environment variable names the database, and asks for a confirmation and the database's name typed again. A restore test restores a backup into a copy — a temporary file for SQLite, a scratch database for a server — and checks it there, without touching the database.

It exists because a backup nobody has restored is a hope, not a backup, and because a backup holds every person's data in clear: it is kept to its owner, encrypted where it is stored, and replaced on a schedule. It is for any PHP application that keeps its data in SQLite, MySQL, MariaDB or PostgreSQL; phil/backup-bundle puts it in Symfony, with its configuration and its commands.

It is a plain PHP library whose only requirement is ext-sodium. It does not run processes itself: a CommandRunner given by the application finds and runs the tools. It does not schedule backups, copy them off the machine, or decide when a restore is wise: the application's scheduler, storage and people do.

Status

Part State
SqliteClient, MysqlClient, PostgresqlClient over the client tools, credentials off the command line Implemented and tested: SQLite with the real sqlite3, the others by their command lines
BackupCipher and BackupKey: libsodium's secret stream by chunks, a versioned format Implemented and tested
TarWriter, TarReader, MediaArchive: ustar archives of named directories, without links Implemented and tested
BackupDirectory, BackupSet: sets named after the database, the time in UTC and a label Implemented and tested
RotationPolicy: the latest backups and the most recent of each day, ISO week and month Implemented and tested
RestoreGuard: production, confirmation, the name typed again Implemented and tested
Backups: create, rotate, find, restore and test a set Implemented and tested

Documentation

Quick start

Requirements

PHP 8.5 or later and ext-sodium; the client tools of the database on the machine that runs the backups.

Contributing

Contributions are welcome on the PHIL monorepo: read the contribution guide and the security policy explains, never in a public issue.

License

MIT, © Philippe Gamache, doing business as Le Gnome Archiviste; a Parler Haut Interagir Librement project. See LICENSE.


All versions of backup with dependencies

PHP Build Version
Package Version
Requires php Version >=8.5
ext-sodium Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package phil/backup contains the following files

Loading the files please wait ...