Login   Register  
PHP Classes

File: en/test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Eduardo Martos Gómez  >  Backup  >  en/test.php  >  Download  
File: en/test.php
Role: Example script
Content type: text/plain
Description: Test script
Class: Backup
Backup directory files and MySQL databases
Author: By
Last change:
Date: 8 years ago
Size: 944 bytes


Class file image Download
<title>Testing Backup</title>
// Includes the class Backup
include ("cls_backup.php");
// Crea the object
$backup = new backup;
// Sets the parameters
$backup->set_etiqueta ("test");
$backup->set_dir_origen ("src_dir/");
$backup->set_dir_destino ("dest_dir");
$backup->set_bd_host ("host");
$backup->set_bd_usr ("user");
$backup->set_bd_clave ("password");
$backup->set_bd_nombre ("db_name");
// Evaluates the parameter modo
switch ($_GET["modo"])
// Compress the directory specified by set_dir_origen () and downloads
        // the zip file
case "files":
$backup->backup_files ();
// Dumps DB into a file and downloads it
case "db":
$backup->backup_mysql ();
// Shows backup options
case "":
"<p><a href=\"?modo=files\">Files</a></p>";
"<p><a href=\"?modo=db\">DB</a>";