我試圖通過從「Session」庫加載的一些額外信息來擴展CodeIgniter日誌庫。這似乎根據的信息在這裏成爲可能: http://codeigniter.com/user_guide/general/creating_libraries.html從CodeIgniter中的庫調用get_instance時出現錯誤500
所以,我創建了應用程序/庫文件名爲MY_Log.php下列要求:
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Log extends CI_Log {
function __construct() {
parent::__construct();
$CI =& get_instance();
$CI->load->library('session');
}
}
?>
麻煩的是,每當我打電話get_instance從這個文件中,我得到一個「500內部服務器錯誤」。我嘗試用最新版本(2.1.2)的新副本替換我的codeigniter系統目錄,但是我得到相同的錯誤。我究竟做錯了什麼?
在此先感謝。
與此相關的PHP錯誤是什麼? – 2012-07-05 19:09:52
另外,類CI_Log在1.7.2之後不存在。 – 2012-07-05 19:22:44