djunehor/db-backup-restore

A PHP module to backup DB as well as restore from backup

dev-master / 1.0.0.x-dev 2019-10-11 00:42 UTC

This package is auto-updated.

Last update: 2024-12-14 22:08:32 UTC


README

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!