index.php 640 B

12345678910111213141516171819202122232425
  1. <?php
  2. require $_SERVER['DOCUMENT_ROOT'] . '/app/libs/uoj-lib.php';
  3. require UOJContext::documentRoot().'/app/route.php';
  4. require UOJContext::documentRoot().'/app/controllers/subdomain/blog/route.php';
  5. include UOJContext::documentRoot().'/app/controllers'.call_user_func(function() {
  6. $route = Route::dispatch();
  7. $q_pos = strpos($route['action'], '?');
  8. if ($q_pos === false) {
  9. $path = $route['action'];
  10. } else {
  11. parse_str(substr($route['action'], $q_pos + 1), $vars);
  12. $_GET += $vars;
  13. $path = substr($route['action'], 0, $q_pos);
  14. }
  15. if (isset($route['onload'])) {
  16. call_user_func($route['onload']);
  17. }
  18. return $path;
  19. });