S2OJ/web/app/libs/uoj-lib.php

36 lines
745 B
PHP
Raw Normal View History

2016-07-18 16:39:37 +00:00
<?php
2022-11-06 02:26:21 +00:00
error_reporting(E_ALL ^ E_NOTICE);
spl_autoload_register(function ($class_name) {
$lib = $_SERVER['DOCUMENT_ROOT'] . '/app/models/' . $class_name . '.php';
if (file_exists($lib)) {
require_once $lib;
2016-07-18 16:39:37 +00:00
}
2022-11-06 02:26:21 +00:00
});
function requireLib($name) { // html lib
global $REQUIRE_LIB;
$REQUIRE_LIB[$name] = '';
}
function requirePHPLib($name) { // uoj php lib
2023-02-12 23:56:44 +00:00
require_once $_SERVER['DOCUMENT_ROOT'] . '/app/libs/uoj-' . $name . '-lib.php';
2022-11-06 02:26:21 +00:00
}
requirePHPLib('expection');
requirePHPLib('validate');
requirePHPLib('query');
requirePHPLib('rand');
requirePHPLib('utility');
requirePHPLib('security');
requirePHPLib('contest');
requirePHPLib('html');
Session::init();
UOJTime::init();
DB::init();
$myUser = null;
Auth::init();
UOJLocale::init();