[php]代码库
require(BASEPATH.'core/Common.php');
// Common.php主要是load_class()加载各种所需的类库
// 比如加载配置文件类什么的
$CFG =& load_class('Config', 'core');
$URI =& load_class('URI', 'core');
$RTR =& load_class('Router', 'core');
$RTR->_set_routing();
$SEC =& load_class('Security', 'core');
$IN =& load_class('Input', 'core');
require BASEPATH.'core/Controller.php';
function &get_instance()
{
return CI_Controller::get_instance();
}
// 从$RTR类解析出URL的 class 名与 method 名
$class = $RTR->fetch_class();
$method = $RTR->fetch_method();
call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, 2));