blessing-skin-server/libraries/autoloader.php

21 lines
685 B
PHP
Raw Normal View History

2016-02-02 21:23:20 +08:00
<?php
/**
2016-03-19 10:28:18 +08:00
* @Author: printempw
2016-02-02 21:23:20 +08:00
* @Date: 2016-02-02 21:17:59
2016-03-12 17:21:30 +08:00
* @Last Modified by: printempw
* @Last Modified time: 2016-04-02 19:19:48
2016-02-02 21:23:20 +08:00
*/
function __autoload($classname) {
global $dir;
2016-03-18 17:49:52 +08:00
// echo $classname.'<br />';
2016-03-26 18:50:47 +08:00
$include_dir = $dir.DIRECTORY_SEPARATOR."libraries".DIRECTORY_SEPARATOR;
2016-03-18 17:49:52 +08:00
$filename = $include_dir.str_replace('\\', DIRECTORY_SEPARATOR, $classname) . '.class.php';
if (!file_exists($filename))
exit("Undefined class `$classname` @ `$filename`");
2016-03-18 17:49:52 +08:00
require_once($filename);
2016-02-02 21:23:20 +08:00
}
2016-03-12 17:21:30 +08:00
if (!file_exists($dir.'/config.php'))
2016-03-27 11:38:27 +08:00
throw new E('未找到 `config.php`,请确认配置文件是否存在。', -1, true);
2016-02-04 18:35:14 +08:00
require "$dir/config.php";