<?php 
include ('dumper.php');



date_default_timezone_set('Asia/Baghdad');
$datess = date("Y-m-d_h-i-s", time());

try {
	$world_dumper = Shuttle_Dumper::create(array(
		'host' => 'localhost',
		'username' => 'erbilsystem_root',
		'password' => 'root 84 acc',
		'db_name' => 'erbilsystem_fabric',
	));

	// dump the database to gzipped file
	//$world_dumper->dump('world.sql.gz');

	// dump the database to plain text file
	$world_dumper->dump('backup_database_'.$datess.'.sql');

	$op = array('is_success'=>true,'data'=>'');
		
	$op['data'] = 'backup_database_'.$datess.'.sql';
	echo json_encode($op );

} catch(Shuttle_Exception $e) {

	$op = array('is_success'=>false,'data'=>'');
		
	$op['data'] = "Couldn't dump database: " . $e->getMessage();
	echo json_encode($op );

	// echo "Couldn't dump database: " . $e->getMessage();


}

?>