2016-12-27 20:25:32 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Define PROJECT PATH
|
2017-06-19 17:51:59 +00:00
|
|
|
define('PROJECT_PATH', dirname(__FILE__).'/');
|
|
|
|
define('APP_PATH', PROJECT_PATH.'app/');
|
2016-12-27 20:25:32 +00:00
|
|
|
|
|
|
|
// Load Autoloader
|
2017-06-19 17:51:59 +00:00
|
|
|
require APP_PATH."splclassloader.class.php";
|
2017-02-11 13:39:25 +00:00
|
|
|
$classLoader = new SplClassLoader(null, APP_PATH);
|
2016-12-27 20:25:32 +00:00
|
|
|
$classLoader->setFileExtension('.class.php');
|
|
|
|
$classLoader->register();
|
|
|
|
|
2019-12-20 17:32:04 +00:00
|
|
|
// In debug mode, display errors
|
|
|
|
if(Config::get_safe('debug', false)){
|
|
|
|
ini_set('display_errors', 1);
|
|
|
|
ini_set('display_startup_errors', 1);
|
|
|
|
error_reporting(E_ALL);
|
2019-12-26 19:43:22 +00:00
|
|
|
|
|
|
|
// Check extensions
|
|
|
|
$required = ['curl', 'PDO', 'pdo_mysql', 'gd'];
|
|
|
|
$loaded = get_loaded_extensions();
|
|
|
|
if($missing = array_diff($required, $loaded)){
|
|
|
|
die("Missing extensions, please install: ".impode(", ", $missing));
|
|
|
|
}
|
2019-12-20 17:32:04 +00:00
|
|
|
}
|
|
|
|
|
2017-06-19 17:51:59 +00:00
|
|
|
// Language
|
|
|
|
Lang::load(empty($_GET["hl"]) ? Config::get("lang") : $_GET["hl"]);
|
|
|
|
|
2016-12-27 20:25:32 +00:00
|
|
|
// Start session
|
2019-12-22 21:53:25 +00:00
|
|
|
ini_set('session.cookie_httponly', 1);
|
2019-12-26 19:43:22 +00:00
|
|
|
session_start();
|
|
|
|
|
|
|
|
|