ave-cms/admin/dbsettings.php

70 lines
1.5 KiB
PHP
Raw Normal View History

2017-06-24 00:58:56 +03:00
<?php
2018-03-26 10:33:20 +03:00
/**
* AVE.cms
*
* @package AVE.cms
* @version 3.x
* @filesource
* @copyright © 2007-2014 AVE.cms, http://www.ave-cms.ru
*
* @license GPL v.2
*/
2017-06-24 00:58:56 +03:00
2018-03-26 10:33:20 +03:00
if (! defined('ACP'))
{
header('Location:index.php');
exit;
}
2017-06-24 00:58:56 +03:00
2018-03-26 10:33:20 +03:00
check_permission_acp('db_actions');
2017-06-24 00:58:56 +03:00
2018-03-26 10:33:20 +03:00
$AVE_Template->config_load(BASE_DIR . '/admin/lang/' . $_SESSION['admin_language'] . '/dbactions.txt', 'db');
2017-06-24 00:58:56 +03:00
2018-03-26 10:33:20 +03:00
require (BASE_DIR . '/class/class.dbdump.php');
2017-06-24 00:58:56 +03:00
2018-03-26 10:33:20 +03:00
$AVE_DB_Service = new AVE_DB_Service;
if (!empty($_REQUEST['action']))
2017-06-24 00:58:56 +03:00
{
2018-03-26 10:33:20 +03:00
switch ($_REQUEST['action'])
{
case 'optimize':
$AVE_DB_Service->databaseTableOptimize();
break;
2017-06-24 00:58:56 +03:00
2018-03-26 10:33:20 +03:00
case 'repair':
$AVE_DB_Service->databaseTableRepair();
break;
2017-06-24 00:58:56 +03:00
2018-03-26 10:33:20 +03:00
case 'dump_top':
$AVE_DB_Service->databaseDumpExport(1);
exit;
2017-06-24 00:58:56 +03:00
2018-03-26 10:33:20 +03:00
case 'dump':
$AVE_DB_Service->databaseDumpExport();
exit;
2017-06-24 00:58:56 +03:00
2018-03-26 10:33:20 +03:00
case 'restore':
2018-05-23 19:32:14 +03:00
$AVE_DB_Service->databaseDumpImport(BASE_DIR . '/tmp/backup/');
2018-03-26 10:33:20 +03:00
break;
2017-06-24 00:58:56 +03:00
2018-03-26 10:33:20 +03:00
case 'download':
$AVE_DB_Service->databaseDumpFileSave($_REQUEST['file']);
break;
2017-06-24 00:58:56 +03:00
2018-03-26 10:33:20 +03:00
case 'restorefile':
$AVE_DB_Service->databaseDumpFileImport($_REQUEST['file']);
break;
2017-06-24 00:58:56 +03:00
2018-03-26 10:33:20 +03:00
case 'deletefile':
$AVE_DB_Service->databaseDumpFileDelete($_REQUEST['file']);
break;
}
2017-06-24 00:58:56 +03:00
}
2018-03-26 10:33:20 +03:00
$AVE_Template->assign('db_size', get_mysql_size());
$AVE_Template->assign('files', $AVE_DB_Service->databaseFilesGet());
$AVE_Template->assign('tables', $AVE_DB_Service->databaseTableGet());
$AVE_Template->assign('content', $AVE_Template->fetch('dbactions/actions.tpl'));
2017-06-24 00:58:56 +03:00
?>