forked from ManiaControl/ManiaControl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathManiaControl.php
More file actions
56 lines (43 loc) · 1.6 KB
/
ManiaControl.php
File metadata and controls
56 lines (43 loc) · 1.6 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
<?php
/**
* ManiaControl Server Controller for ManiaPlanet Server
*
* @author ManiaControl Team <mail@maniacontrol.com>
* @copyright 2014-2018 ManiaControl Team
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
// Enable error reporting
error_reporting(E_ALL);
// Run configuration
define('LOG_NAME_USE_DATE', true); // Use current date as suffix for log file name in logs folder
define('LOG_NAME_USE_PID', true); // Use current process id as suffix for log file name in logs folder
// Define base dir
define('MANIACONTROL_PATH', __DIR__ . DIRECTORY_SEPARATOR);
// Set process settings
ini_set('memory_limit', '128M');
if (!ini_get('date.timezone') && function_exists('date_default_timezone_set')) {
date_default_timezone_set('UTC');
}
// Make sure garbage collection is enabled
gc_enable();
// Register AutoLoader
require_once MANIACONTROL_PATH . 'core' . DIRECTORY_SEPARATOR . 'AutoLoader.php';
\ManiaControl\AutoLoader::register();
// Setup Logger
\ManiaControl\Logger::setup();
$devMode = \ManiaControl\Utils\CommandLineHelper::getParameter('-dev');
if($devMode === "true"){
define('DEV_MODE', true); // Development mode to not send error reports etc.
}else{
define('DEV_MODE', false); // Development mode to not send error reports etc.
}
if(DEV_MODE){
\ManiaControl\Logger::log('Starting ManiaControl with activated Development Mode...');
}else{
\ManiaControl\Logger::log('Starting ManiaControl...');
}
// Check requirements
\ManiaControl\Utils\SystemUtil::checkRequirements();
// Start ManiaControl
$maniaControl = new \ManiaControl\ManiaControl();
$maniaControl->run();