PHP Classes

File: tools/backup.php

Recommend this page to a friend!
  Classes of Kristo Vaher  >  Wave Framework  >  tools/backup.php  >  Download  
File: tools/backup.php
Role: Auxiliary script
Content type: text/plain
Description: Backup Tool
Class: Wave Framework
MVC framework for building Web sites and APIs
Author: By
Last change: Made session starting configurations possible to be changed at runtime.
Updated documentation with indexes and anchors.
Added jQuery 2.0 as an alternative - to use the new version of jQuery that ignores Internet Explorer up to and including 8, then change jquery.js file to jquery2.js in the View Controller.
Developer tools Debugger and Log Reader for internal log messages are now browser IP and session-based, allowing to separate messages from one another based on client that makes the request.
Added a warning to developer tools when using the default password.
Fixed bug with tester script that did not properly autoload certain PHP scripts.
Implemented an improved getState() method that allows to return data better from nested arrays.
Implemented an improved setState() that allows to set nested array values in State more easily.
PNG images will also now get a background, if RGB setting is set in the dynamic image loading.
Date: 3 years ago
Size: 3,577 bytes


Class file image Download

 * Wave Framework <>
 * System Backup Archiver
 * This script creates backup of entire system together with filesystem or just a backup of the main core
 * files. The type of backup depends on GET variable. 'all' creates backup of everything, 'system' creates
 * backup of just the system files. Files are stored in /filesystem/backups/ folder.
 * @package Tools
 * @author Kristo Vaher <>
 * @copyright Copyright (c) 2012, Kristo Vaher
 * @license GNU Lesser General Public License Version 3
 * @tutorial /doc/pages/guide_tools.htm
 * @since 1.0.0
 * @version 3.6.0

// This initializes tools and authentication

// Log is printed out in plain text format
header('Content-Type: text/html;charset=utf-8');

<!DOCTYPE html>
<html lang="en">
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width"/>
        <link type="text/css" href="style.css" rel="stylesheet" media="all"/>
        <link rel="icon" href="../favicon.ico" type="image/x-icon"/>
        <link rel="icon" href="../favicon.ico" type="image/"/>
        <meta content="noindex,nocache,nofollow,noarchive,noimageindex,nosnippet" name="robots"/>
        <meta http-equiv="cache-control" content="no-cache"/>
        <meta http-equiv="pragma" content="no-cache"/>
        <meta http-equiv="expires" content="0"/>
// Pops up an alert about default password
// Header
echo '<h1>System Backup</h1>';
'<h4 class="highlight">';
$softwareVersions as $software=>$version){
// Adding version numbers
echo '<b>'.$software.'</b> ('.$version.') ';
// If backup has no GET variables sent, then error is thrown
'<p>Backup mode missing, please define either \'all\' or \'system\' in request</p>';
        } else {


// Target archive of the backup

// Creates backup based on backup mode

// This calls the backup function with filesystem flag set to 'true', so it creates archive with filesystem files
'<p class="bold">Backup file /filesystem/backups/'.$backupFilename.' created</p>';
                } else {
'<p class="bold red">Cannot create backup!</p>';
            } elseif(isset(

// This calls the backup function with the filesystem flag undefined (thus 'false')
'<p class="bold">Backup file /filesystem/backups/'.$backupFilename.' created</p>';
                } else {
'<p class="bold red">Cannot create backup!</p>';
            } else {
'<p class="bold red">Incorrect backup mode used</p>';
'<p><a href="backup.php?system">System Backup</a> - Creates backup of system files</p>';
'<p><a href="backup.php?all">Full Backup</a> - Creates backup of all files, including filesystem directory</p>';
// Footer
echo '<p class="footer small bold">Generated at '.date('d.m.Y h:i').' GMT '.date('P').' for '.$_SERVER['HTTP_HOST'].'</p>';