PHP code example of iamjohndev / ijd-ezbackup

1. Go to this page and download the library: Download iamjohndev/ijd-ezbackup 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/ */

    

iamjohndev / ijd-ezbackup example snippets


    composer 

use IamJohnDevEZBackup\BackupAndRestore;

// Create a new BackupAndRestore object
$backup = new BackupAndRestore();

// Set the database configuration
$backup->setConfig('localhost', 'username', 'password', 'database', 'path/to/export_file', 'path/to/import_file');


// Backup the database to a CSV file
$backup->backupToCSV();

// Backup the database to a JSON file
$backup->backupToJSON();

// Backup the database to an XLS file
$backup->backupToXLS();

// Restore the database from a CSV file
$backup->restoreFromCSV($_FILES['csv_file']);

// Restore the database from a JSON file
$backup->restoreFromJSON($_FILES['json_file']);

// Restore the database from an XLS file
$backup->restoreFromXLS($_FILES['xls_file']);