-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.inc
63 lines (55 loc) · 1.85 KB
/
init.inc
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
<?php
/**
* Copyright 2021, 2024 5 Mode
*
* This file is part of Msnger.
*
* Msnger 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 3 of the License, or
* (at your option) any later version.
*
* Msnger 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 Msnger. If not, see <https://www.gnu.org/licenses/>.
*
* init.inc
*
* Msnger initialization file.
*
* @author Daniele Bonini <[email protected]>
* @copyrights (c) 2021, 2024, 5 Mode
*/
error_reporting(E_ALL & ~ (E_WARNING | E_NOTICE | E_STRICT | E_DEPRECATED));
ini_set('display_startup_errors',1);
ini_set('display_errors',1);
ini_set('log_errors',1);
require "config.inc";
// Checking a little the configuration..
if (!file_exists(APP_DATA_PATH)) {
die("Data folder doesn't exist. You must create the data folder in your web app path and configure it properly inside the config file.");
}
require "const.inc";
require "MSN_funct.inc";
// ERROR HANDLING AND LOGGING
if (DEBUG) {
error_reporting(E_ALL | E_STRICT);
ini_set('display_startup_errors',1);
ini_set('display_errors',1);
ini_set('log_errors',1);
} else {
error_reporting(E_ALL & ~ (E_WARNING | E_NOTICE | E_STRICT | E_DEPRECATED));
ini_set('display_startup_errors',0);
ini_set('display_errors',0);
ini_set('log_errors',1);
}
// Set no cache headers
// for HTTP/1.0 clients
header("Expires: 0");
header("Pragma: no-cache");
// HTTP/1.1 support
header("Cache-Control: private,no-cache,max-age=0,s-maxage=0,must-revalidate");