Below are the instructions of use and sample of how to use it:
INSTRUCTIONS
/********************************
BACKUP OF FILES
*********************************/
$mkBackup = new BackUp;
this initialize the class
$mkBackup->WhatBackup(PATH_TO_SAVE);
this set which folder will be compressed
Relative path. Full path should work. No final "/"
$mkBackup->WhereBackup(MOVE_COMPRESSED_FOLDER_HERE);
this set in which folder the compressed archive will be saved
Relative path. Full path should work. No final "/"
$mkBackup->FileName(NAME_OF_ARCHIVE);
this set the name to give to archive
you can create name on-the-fly, using date(); or whatever you want
$mkBackup->Debug();
if you want to display all the infos about compression
This will display all vars set before: What Backup, Where, and name of archive
Nothing more...
/********************************
BACKUP OF DATABASE
*********************************/
$mkBackup = new BackUp;
this initialize the class
$mkBackup->DBFileName(NAME_OF_SQL_FILE);
this set the name of file of SQL Dump, and save it directly to server
Relative path. Full path should work.
$mkBackup->SaveAs(NAME_OF_SQL_FILE);
this set the name of file of SQL Dump, and ask to "save as..." to save it on own disk...
if this is set, the "DBFileName" function of the class, is ignored
$mkBackup->DBMakeBackup("server","port","user","password","database_name");
this create the backup. Vars are very simple:
server is the mySQL server (if empty, "localhost" is used)
port is the port of mySQL server (if empty, "3306" is used)
user is the user used to connect to mySQL server (if empty, "root" is used)
password is the password used to connect to mySQL server (if empty, empty password is used)
database_name is the name of the Database to save (if empty, it will display an error)
/********************************
BACKUP EXAMPLE
*********************************/
Backup files:
$mkBackup = new BackUp;
$mkBackup->WhatBackup("www/mysite");
$mkBackup->WhereBackup("www/backup");
$filename = date("Y_m_d__H_i_s___WebSiteBackup");
$mkBackup->FileName($filename);
$mkBackup->Backup();
Database Backup, directly on server:
$mkBackup = new BackUp;
$mkBackup->DBFileName("www/backup/2004_05_18__TestingBK.sql");
$mkBackup->DBMakeBackup("localhost","","root","","my_database");
Database Backup, save as...:
$mkBackup = new BackUp;
$mkBackup->SaveAs("2004_05_18__TestingBK.sql");
$mkBackup->DBMakeBackup("localhost","","root","","my_database");