S2OJ/uoj/1/index.php
MascoSkray 39acf1b05e
style: move all php libs to a folder
The php lib files are in the app directory root. Move it to a new directory so that can be tidy.
2017-04-25 12:30:03 +08:00

28 lines
658 B
PHP

<?php
Session_Start();
require $_SERVER['DOCUMENT_ROOT'] . '/app/libs/uoj-lib.php';
require UOJContext::documentRoot().'/app/route.php';
require UOJContext::documentRoot().'/app/controllers/subdomain/blog/route.php';
include UOJContext::documentRoot().'/app/controllers'.call_user_func(function() {
$route = Route::dispatch();
$q_pos = strpos($route['action'], '?');
if ($q_pos === false) {
$path = $route['action'];
} else {
parse_str(substr($route['action'], $q_pos + 1), $vars);
$_GET += $vars;
$path = substr($route['action'], 0, $q_pos);
}
if (isset($route['onload'])) {
call_user_func($route['onload']);
}
return $path;
});