1. Go to this page and download the library: Download coderatio/simple-backup library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Coderatio\SimpleBackup\SimpleBackup;
// Set the database to backup
$simpleBackup = SimpleBackup::setDatabase(['db_name', 'db_user', 'db_password', 'db_host'])
->storeAfterExportTo('pathtostore', 'file_name (optional)');
use Coderatio\SimpleBackup\SimpleBackup;
// Set the database to backup
$simpleBackup = SimpleBackup::setDatabase(['db_name', 'db_user', 'db_password', 'db_host'])
->downloadAfterExport($file_name (optional));
$tables = [
'users' => 'is_active = true'
];
$simpleBackup->setTableConditions(array $tables);
$tables = [
'users' => 50,
'posts' => 50
]
$simpleBackup->setTableLimitsOn(array $tables);
use Coderatio\SimpleBackup\SimpleBackup;
// Set the database to backup
$simpleBackup = SimpleBackup::setDatabase(['db_name', 'db_user', 'db_password', 'db_host (optional)']])
->importFrom('pathtosql_file or sql_contents');
/**
* You can then dump the response like this.
*
* @return object
**/
var_dump($simpleBackup->getResponse());
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.