start.php 658 B

123456789101112131415161718192021
  1. <?php
  2. //
  3. if ( ! defined('BASE_PATH')) exit('No direct script access allowed');
  4. /**
  5. * 自动加载
  6. * */
  7. function includeloader($class){
  8. $path = BASE_PATH."include/{$class}.php";
  9. if (is_readable($path)) require $path;
  10. }
  11. spl_autoload_register('includeloader');
  12. //die($_SERVER['QUERY_STRING']);
  13. new controller(isset($_SERVER['REQUEST_URI'])?$_SERVER['REQUEST_URI']:'');
  14. //print_r($_SERVER);die();
  15. //$url = $_SERVER['DOCUMENT_ROOT'].(isset($_SERVER['REQUEST_URI'])?$_SERVER['REQUEST_URI']:'');
  16. //$url = str_ireplace('\\','/',$url);
  17. //$base = str_ireplace('\\','/',BASE_PATH);
  18. //$test = (explode($base,$url));
  19. //new controller($test[1]); //做path_info兼容