-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefines.php
More file actions
57 lines (43 loc) · 1.28 KB
/
Copy pathdefines.php
File metadata and controls
57 lines (43 loc) · 1.28 KB
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
<?php
declare(strict_types=1);
namespace CMS\PhpBackup;
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
@ini_set('memory_limit', '512M');
set_time_limit(1200);
if (!defined('CMS_DEBUG')) {
define('CMS_DEBUG', true);
}
if (!defined('ABS_PATH')) {
define('ABS_PATH', realpath(__DIR__) . DIRECTORY_SEPARATOR);
}
if (!defined('CONFIG_DIR')) {
define('CONFIG_DIR', ABS_PATH . 'config' . DIRECTORY_SEPARATOR);
}
if (!file_exists(CONFIG_DIR)) {
mkdir(CONFIG_DIR, 0o755, true);
}
if (!defined('TEMP_DIR')) {
define('TEMP_DIR', ABS_PATH . 'temp' . DIRECTORY_SEPARATOR);
}
if (!file_exists(TEMP_DIR)) {
mkdir(TEMP_DIR, 0o755, true);
}
function CMS_is_debug_mode()
{
return defined('CMS_DEBUG') && CMS_DEBUG;
}
require_once ABS_PATH . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
use CMS\PhpBackup\Helper\FileLogger;
use CMS\PhpBackup\Helper\LogLevel;
if (CMS_is_debug_mode()) {
$logger = FileLogger::getInstance();
$logger->activateEchoLogs();
$logger->setLogLevel(LogLevel::DEBUG);
$logger->debug('ABS_PATH: ' . ABS_PATH);
$logger->debug('CONFIG_DIR: ' . CONFIG_DIR);
$logger->debug('TEMP_DIR: ' . TEMP_DIR);
}
// Set an environment variable
putenv('MYSQLDUMP_EXE=C:\\xampp\\mysql\\bin\\mysqldump');