Download the PHP package phelium/mysql-backup without Composer

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

MySQLBackup

Introduction

This is a backup utility used to dump a database for backup. The backup file contains the queries to build the tables and insert the datas.
You can select some or all tables, compress the backup in ZIP or GZIP and start downloading automatically.

Installation

With Composer, add this line to your require section :

"phelium/mysql-backup": "dev-master"

Then run composer update.

Initialization

To initialize MySQLBackup, you must provide your database information :

MySQL port default is 3306.

Usage

Add tables

By default, all tables are saved. If you want to save one or more tables, the functions addTable or addTables must be used:

Exclude tables

You can exclude some tables of the backup. Use excludeTables function. The parameter must be an array containing tables name to exclude.

Set the filename

By default, the name of the generated file is "dump_{database name}_{date}". With setFilename method, you can specify a different file name:

Do not dump the table schema or the datas

By default, the table schema (structure) and datas of each table are saved. However, it's possible not to save one or the other with setDumpStructure and setDumpDatas (default : true) :

Do not add CREATE DATABASE IF NOT EXISTS

By default, the CREATE DATABASE IF NOT EXISTS directive is added in top of the backup file. You can disable it with addCreateDatabaseIfNotExists (default : true) :

Do not add DROP TABLE

By default, the DROP TABLE IF EXISTS directive is added before each CREATE TABLE. You can disable it with addDropTable (default : true) :

Do not add IF NOT EXISTS

By default, the IF NOT EXISTS directive is added during a CREATE TABLE. You can disable it with addIfNotExists (default : true) :

Compress file

To compress the output file, setCompress allows to use ZIP or GZIP (default : no compression) :

Delete file

The generated file can be deleted automatically with setDelete (default : false) :

Auto download

To download automatically the generated file, use setDownload (default : false) :

Execute the backup

To start backing up your database, use dump:

Full example

Here is an example to backup the blog database. Only the tables posts, comments and users are kept. Then compressed in ZIP format. The generated file is deleted from the server and the download starts automatically:


All versions of mysql-backup with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
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 phelium/mysql-backup contains the following files

Loading the files please wait ....