PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Zacchaeus Bolaji  >  PHP Backup MySQL Database Automatically  >  README.md  >  Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP Backup MySQL Database Automatically
Backup and restore MySQL database dumping SQL file
Author: By
Last change:
Date: 3 years ago
Size: 1,066 bytes
 

Contents

Class file image Download

DB BackUp and Restore Class

Issues and pull requests welcome.

A PHP Class that helps take backup of DB as well as restore from backup.

Table of Contents

Installation

You will need PHP 7.x and composer.

Install using composer: composer require djunehor/db-backup-restore

Usage

use \Djunehor\DB\BackUp;

/
	 *
	 *
	 * @param string $host
	 * @param string $username
	 * @param string $password
	 * @param string $database
	 * @param string $charset
	 * @param string $lang
	 */
$db = new BackUp( 'localhost', 'root', '', 'test', 'utf8', 'en' );

// To backup DB
$db->backup ();

//To restore from backup
$db->restore ( __DIR__.'/backup/20121027194215_all_v1.sql')

Acknowledgment

Adapted from the class created by yanue

Contribute

Check out the issues on GitHub and/or make a pull request to contribute!