2004-10-16 01:06:34 +02:00
|
|
|
<?php
|
2013-07-14 15:05:24 +02:00
|
|
|
/**
|
|
|
|
* EGroupware - Admin - DB backup and restore
|
|
|
|
*
|
|
|
|
* @link http://www.egroupware.org
|
|
|
|
* @author Ralf Becker <RalfBecker@outdoor-training.de>
|
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
|
|
|
* @package admin
|
|
|
|
* @version $Id$
|
|
|
|
*/
|
2004-10-16 01:06:34 +02:00
|
|
|
|
2013-07-14 15:05:24 +02:00
|
|
|
class admin_db_backup
|
|
|
|
{
|
|
|
|
var $public_functions = array(
|
|
|
|
'index' => true,
|
|
|
|
);
|
|
|
|
var $db_backup;
|
2004-10-16 01:06:34 +02:00
|
|
|
|
2013-07-14 15:05:24 +02:00
|
|
|
/**
|
|
|
|
* Method for sheduled backups, called via asynservice
|
|
|
|
*/
|
|
|
|
function do_backup()
|
|
|
|
{
|
|
|
|
$this->db_backup = new db_backup();
|
2009-08-27 14:46:12 +02:00
|
|
|
|
2014-07-25 11:13:19 +02:00
|
|
|
if (($f = $this->db_backup->fopen_backup()))
|
2013-07-14 15:05:24 +02:00
|
|
|
{
|
|
|
|
$this->db_backup->backup($f);
|
|
|
|
if(is_resource($f))
|
|
|
|
fclose($f);
|
|
|
|
/* Remove old backups. */
|
|
|
|
$this->db_backup->housekeeping();
|
2009-08-27 14:46:12 +02:00
|
|
|
}
|
2013-07-14 15:05:24 +02:00
|
|
|
}
|
2009-08-27 14:46:12 +02:00
|
|
|
|
2013-07-14 15:05:24 +02:00
|
|
|
/**
|
|
|
|
* includes setup's db_backup to display/access it inside admin
|
|
|
|
*/
|
|
|
|
function index()
|
|
|
|
{
|
|
|
|
$tpl_root = EGW_SERVER_ROOT.'/setup/templates/default';
|
|
|
|
$self = $GLOBALS['egw']->link('/index.php',array('menuaction'=>'admin.admin_db_backup.index'));
|
|
|
|
translation::add_app('setup');
|
2014-07-25 11:13:19 +02:00
|
|
|
egw_framework::csp_script_src_attrs('unsafe-inline');
|
2004-10-16 01:06:34 +02:00
|
|
|
|
2013-07-14 15:05:24 +02:00
|
|
|
include EGW_SERVER_ROOT.'/setup/db_backup.php';
|
2004-10-16 01:06:34 +02:00
|
|
|
|
2014-07-25 11:13:19 +02:00
|
|
|
unset($tpl_root, $self);
|
2013-07-14 15:05:24 +02:00
|
|
|
common::egw_footer();
|
2009-08-27 14:46:12 +02:00
|
|
|
}
|
2013-07-14 15:05:24 +02:00
|
|
|
}
|