Download the PHP package coderatio/simple-backup without Composer

On this page you can find all versions of the php package coderatio/simple-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 simple-backup

Simple-backup


A simple mysql database backup library for php. This library helps you backup your mysql database to a directory in your project or download it to your machine.

The library also allows you import or restore a database without stress. Follow the instructions below to get started.

Installation

Open your terminal or command prompt and type the below command:

New in version 1.0.1

  1. You can now chain static ::start() on `SimpleBackup class.
  2. This version includes fluent chaining of database settings.
  3. Added ->includeOnly(array $tables) which allows you to export data for only tables mentioned in $tables variable.
  4. Added ->excludeOnly(array $tables) which removes the inclussion of tables mentioned in $tables variable during export.

(v1.0.1) Exporting specific tables only

(v1.0.1) Excluding specific tables only


Exporting

The export can be done in two ways.

  1. Store in a directory
  2. Download to your machine

1-- Store in a directory

To store the export in a directory, do this:

To get the stored file name, you can echo it out like this:

You can also get the reponse by doing this:

2-- Download

To download the export to your machine, do this:

If $file_name isn't provided, a random name will be generated for the download.

Adding where clauses to tables

To add where clauses as you would do on SQL, you can do this before exporting:

Note: $tables variable must be an associative array e.g

Setting rows limit on tables

To limit how many rows to be included in your backup for a table, do this before exporting:

Note: Just like adding where clauses, the $tables variable here must be an associative array. e.g

Importing

This package makes importing or restoring your mysql database easy. To import your database, do this:

Note: You can provide sql statements as the parameter. You may also overwrite the database configuration by passing it as second parameter to the importFrom(). e.g importFrom(pathtosql_file, array $db_config);.

Todo

  1. Add a scheduler method to use with cron
  2. Store backup in Dropbox, Google Drive.
  3. Send backup to emails

Contribution

To contribute to this project, send a pull request or find me on Twitter.

License

This project is licenced with the MIT license.


All versions of simple-backup with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6|^7.0|^7.1|^7.2
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 coderatio/simple-backup contains the following files

Loading the files please wait ....