-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.php
executable file
·107 lines (77 loc) · 3.54 KB
/
common.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
/*
* common.php
*
* Copyright 2011 Ovidiu Liuta <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
define("XCLONER_VERSION", "3.6.0");
if ((!extension_loaded('zlib')) &&(function_exists('ob_start'))) {
ob_end_clean();
ob_start('ob_gzhandler');
}
####################################
$_CONFIG['multiple_config_dir'] = "configs";
//$strlen = strlen($_CONFIG['backup_path']);
//if((substr($_CONFIG['backup_path'], $strlen-1, $strlen) != '/') && (substr($_CONFIG['backup_path'], $strlen-1, $strlen) != '\\'))
// $_CONFIG['backup_path'] .= "/";
#$_CONFIG['backup_path'] = realpath($_CONFIG['backup_path'])."/";
#$_CONFIG['backups_dir'] = realpath($_CONFIG['backup_path'])."/administrator/backups";
$_CONFIG['backup_path'] = ($_CONFIG['backup_path']);
$_CONFIG['backups_dir'] = str_replace("//administrator","/administrator",($_CONFIG['backup_path'])."/administrator/backups");
$_CONFIG['backup_path'] = str_replace("\\","/", $_CONFIG['backup_path']);
$_CONFIG['backups_dir'] = str_replace("\\","/", $_CONFIG['backups_dir']);
$_CONFIG['exfile'] = $_CONFIG['backups_dir']."/.excl";
$_CONFIG['exfile_tar'] = $_CONFIG['backups_dir']."/.excl_tar";
$_CONFIG['logfile'] = $_CONFIG['backups_dir']."/xcloner.log";
$_CONFIG['commentsfile'] = $_CONFIG['backups_dir']."/.comments"; #$_REQUEST['backupComments']
$_CONFIG['script_path'] = str_replace("\\","/",dirname(__FILE__));
$lang_dir = "language";
$task = $_REQUEST['task'];
####################################
if($_CONFIG['enable_db_backup']){
### Connecting to the mysql server
$_CONFIG['link'] = @mysqli_connect($_CONFIG['mysql_host'], $_CONFIG['mysql_user'], $_CONFIG['mysql_pass']) or
E_print("Could not connect: " . mysqli_error($_CONFIG['link']));
@mysqli_select_db($_CONFIG['link'], $_CONFIG['mysql_database']) or E_print("Unable to select database ".$_CONFIG['mysql_database']);
@mysqli_query($_CONFIG['link'], "SET NAMES 'utf8'");
}
### loading language
if($_CONFIG['select_lang']!="")
$mosConfig_lang = $_CONFIG['select_lang'];
if (file_exists( "language/".$mosConfig_lang.".php" )) {
include_once( "language/".$mosConfig_lang.".php" );
@include_once( "language/english.php" );
}
else{
include_once( "language/english.php" );
}
$version = str_replace(".", "", phpversion());
if (version_compare(PHP_VERSION, '5.2.3') < 0) {
$_CONFIG['refresh_mode']="0";
}
if (!$_CONFIG['backup_refresh']) {
$_CONFIG['refresh_mode']="0";
}
$_CONFIG['backup_start_path'] = $_CONFIG['backup_path'];
$_CONFIG['backup_store_path'] = $_CONFIG['clonerPath'];
$_CONFIG['temp_dir'] = $_CONFIG['backups_dir'];
if(!ini_get('date.timezone'))
date_default_timezone_set('America/Los_Angeles');
?>