forked from ZE3kr/Cloudflare-CNAME-Setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.php
executable file
·74 lines (68 loc) · 2.03 KB
/
settings.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
<?php
if (substr($_SERVER['HTTP_HOST'], 0, 5) == 'beta.') {
$is_beta = true;
$is_debug = false;
} elseif (explode(':', $_SERVER['HTTP_HOST'])[0] == "localhost") {
$is_beta = true;
$is_debug = true;
} else {
$is_beta = false;
$is_debug = false;
}
if (@file_exists("../config.php")) {
require_once "../config.php";
} else {
require_once "config.php";
}
if (!defined('HOST_KEY') || !defined('HOST_MAIL')) {
exit(_('No HOST_KEY or HOST_MAIL defined in config.php .'));
} elseif (HOST_KEY == 'e9e4498f0584b7098692512db0c62b48' || HOST_MAIL == '[email protected]') {
exit(_('Please set up your own HOST_KEY and HOST_MAIL in config.php .'));
}
if (!isset($page_title)) {
$page_title = "TlOxygen";
}
/*
* A quick fix for the server that does not support APCu Cache.
*/
if (!function_exists('apcu_fetch')) {
function apcu_fetch() {
return false;
}
function apcu_store() {
return false;
}
}
$language_supported = [
'zh' => 'zh_CN.UTF-8',
];
$lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 5);
$lan = strtolower($lan);
$short_lan = substr($lan, 0, 2);
$dir = __DIR__ . '/languages';
$domain = 'messages';
if (isset($language_supported[$short_lan])) {
$locale = $language_supported[$short_lan];
$iso_language = $short_lan;
} else {
$locale = 'en';
$iso_language = 'en';
}
putenv('LANG=' . $locale);
setlocale(LC_MESSAGES, $locale);
bindtextdomain($domain, $dir);
bind_textdomain_codeset($domain, "UTF-8");
textdomain($domain);
require_once 'languages/translates.php';
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Content-Type: text/html; charset=UTF-8");
if ($is_debug) {
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
}
require_once dirname(__FILE__) . '/vendor/autoload.php';
require_once dirname(__FILE__) . '/includes/netdns2-1.4/DNS2.php';
require_once dirname(__FILE__) . '/includes/PHPMailer-6.0/src/Exception.php';
require_once dirname(__FILE__) . '/includes/PHPMailer-6.0/src/PHPMailer.php';
require_once dirname(__FILE__) . '/includes/PHPMailer-6.0/src/SMTP.php';