<commit_before>Programmatically create dump files of an entire database or individual tables
in a PHP application. Restore from dump files.

[![Build Status](https://travis-ci.org/hglattergotz/dbbackup.png)](https://travis-ci.org/hglattergotz/dbbackup)

## Installation

Using Composer:

```json
{
    "require": {
        "hglattergotz/dbbackup": "dev-master"
    }
}
```

Download source and manually add to project:

 - Get the zip file [here](http://github.com/hglattergotz/dbbackup/archive/master.zip)

## Supported Databases:

 - MySql

Pull Requests for additional database engines welcome!

## Usage

### Backup entire database

```php
use HGG\DbBackup\CmdBuilder\MySql;
use HGG\DbBackup\DbBackup;

try
{
    $output = '';
    $backup = new DbBackup(new MySql());
    $backup->backupDb('username', 'password', 'localhost', 'database',
        'backupFile', array(), &$output);
    
    // log $output
}<commit_msg>Fix incorrect instructions for composer.json file<commit_after>Programmatically create dump files of an entire database or individual tables
in a PHP application. Restore from dump files.

[![Build Status](https://travis-ci.org/hglattergotz/dbbackup.png)](https://travis-ci.org/hglattergotz/dbbackup)

## Installation

Using Composer:

```json
{
    "require": {
        "hgg/dbbackup": "dev-master"
    }
}
```

Download source and manually add to project:

 - Get the zip file [here](http://github.com/hglattergotz/dbbackup/archive/master.zip)

## Supported Databases:

 - MySql

Pull Requests for additional database engines welcome!

## Usage

### Backup entire database

```php
use HGG\DbBackup\CmdBuilder\MySql;
use HGG\DbBackup\DbBackup;

try
{
    $output = '';
    $backup = new DbBackup(new MySql());
    $backup->backupDb('username', 'password', 'localhost', 'database',
        'backupFile', array(), &$output);
    
    // log $output
}
{'fraction_non_alphanumeric': 0.13949759486905397, 'fraction_numerical': 0.0, 'mean_word_length': 3.9655172413793105, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1286804', 'n_tokens_mistral': 609, 'n_tokens_neox': 597, 'n_words': 153}