51 lines
1.4 KiB
PHP
51 lines
1.4 KiB
PHP
<?php
|
|
|
|
// Enable error reporting
|
|
error_reporting(E_ALL);
|
|
|
|
// Run configuration
|
|
define('DEV_MODE', false); // Development mode to not send error reports etc.
|
|
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);
|
|
/** @deprecated Use MANIACONTROL_PATH */
|
|
define('ManiaControlDir', MANIACONTROL_PATH);
|
|
|
|
// Set process settings
|
|
ini_set('memory_limit', '64M');
|
|
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();
|
|
|
|
// Load libs
|
|
require_once MANIACONTROL_PATH . '/libs/curl-easy/autoload.php';
|
|
|
|
/**
|
|
* @deprecated
|
|
* @see \ManiaControl\Logger::log()
|
|
*/
|
|
function logMessage($message, $eol = true) {
|
|
\ManiaControl\Logger::log($message, $eol);
|
|
}
|
|
|
|
\ManiaControl\Logger::log('Starting ManiaControl...');
|
|
|
|
// Check requirements
|
|
\ManiaControl\Utils\SystemUtil::checkRequirements();
|
|
|
|
// Start ManiaControl
|
|
$maniaControl = new \ManiaControl\ManiaControl();
|
|
$maniaControl->run();
|