我正在使用代码点火器。突然,由于某种原因,我的 application/config/config.php 开始加载两次。
我在配置文件的顶部有以下代码,从第 5 行到第 12 行:
function __autoload ($class) {
$file = APPPATH . 'libraries/' . $class . EXT;
if (strpos($class, 'CI_') !== 0) {
if (file_exists($file) && is_file($file)) {
@include_once (APPPATH . 'libraries/' . $class . EXT);
}
}
}
当我测试一个页面时,我得到这个错误:
Fatal error: Cannot redeclare __autoload() (previously declared in C:\xampp\htdocs\ci_centric\application\config\config.php:5) in C:\xampp\htdocs\ci_centric\application\config\config.php on line 12
如果我用 包装自动加载if(!function_exists('__autoload')) { ... }
,我会得到以下输出:
Notice: Constant FRONTEND_PATH already defined in C:\xampp\htdocs\ci_centric\application\config\config.php on line 390
Notice: Constant FRONTEND_WEBPARTS_PATH already defined in C:\xampp\htdocs\ci_centric\application\config\config.php on line 391
Notice: Constant FRONTEND_MAINPAGES_PATH already defined in C:\xampp\htdocs\ci_centric\application\config\config.php on line 392
Notice: Constant BACKEND_PATH already defined in C:\xampp\htdocs\ci_centric\application\config\config.php on line 393
Notice: Constant BACKEND_WEBPARTS_PATH already defined in C:\xampp\htdocs\ci_centric\application\config\config.php on line 394
Notice: Constant BACKEND_MAINPAGES_PATH already defined in C:\xampp\htdocs\ci_centric\application\config\config.php on line 395
Notice: Constant BACKEND_MAINPAGES_PATH already defined in C:\xampp\htdocs\ci_centric\application\config\config.php on line 396
.
.
.
过去几天一切正常;我玩了一点 $this->session->flashdata('...'); 然后我得到了配置双重加载问题。
任何帮助将不胜感激...