2016-07-18 16:39:37 +00:00
|
|
|
<?php
|
|
|
|
error_reporting(E_ALL ^ E_NOTICE);
|
|
|
|
|
|
|
|
spl_autoload_register(function($class_name) {
|
2022-03-14 13:49:48 +00:00
|
|
|
$lib = $_SERVER['DOCUMENT_ROOT'] . '/app/models/' . $class_name . '.php';
|
|
|
|
if (file_exists($lib)) {
|
|
|
|
require_once $lib;
|
|
|
|
}
|
2016-07-18 16:39:37 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
function requireLib($name) { // html lib
|
|
|
|
global $REQUIRE_LIB;
|
|
|
|
$REQUIRE_LIB[$name] = '';
|
|
|
|
}
|
|
|
|
function requirePHPLib($name) { // uoj php lib
|
2017-11-25 04:00:00 +00:00
|
|
|
require $_SERVER['DOCUMENT_ROOT'].'/app/libs/uoj-'.$name.'-lib.php';
|
2016-07-18 16:39:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
requirePHPLib('validate');
|
|
|
|
requirePHPLib('query');
|
|
|
|
requirePHPLib('rand');
|
|
|
|
requirePHPLib('utility');
|
|
|
|
requirePHPLib('security');
|
|
|
|
requirePHPLib('contest');
|
|
|
|
requirePHPLib('html');
|
|
|
|
|
|
|
|
Session::init();
|
|
|
|
UOJTime::init();
|
|
|
|
DB::init();
|
|
|
|
Auth::init();
|
|
|
|
|
|
|
|
if (isset($_GET['locale'])) {
|
|
|
|
UOJLocale::setLocale($_GET['locale']);
|
|
|
|
}
|
|
|
|
UOJLocale::requireModule('basic');
|
|
|
|
?>
|