Ratings | | Unique User Downloads | | Download Rankings |
Not yet rated by the users | | Total: 374 | | All time: 6,751 This week: 177 |
|
Description | | Author |
This class can backup and restore MySQL database dumping SQL file.
It takes the name of a given MySQL database and connects to a database server using MySQLi. Then it generates a file with SQL statements that can be used later to recreate the database SQL statements in case the it is necessary.
The class can also read a file previously generated by this class, so it can restore the tables and records of a MySQL database that was run the backup process described above. Recommendations
| |
 |
|
Innovation award
 Nominee: 9x |
|
Details
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!
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.