我已經成功使用APNS-PHP發送PN - 這太棒了!如何在Code Igniter項目中包含APNS-PHP?
但是,我有點卡在如何將它添加到Code Igniter項目 (在將從命令行調用的控制器內)。
呼喚:
require_once APPPATH.'/third_party/ApnsPHP/Autoload.php';
結果中的錯誤:
Fatal error: Uncaught exception 'Exception' with message 'Class file
'XXXXXXX/application/third_party/CI/DB/mysql/result.php' does not
exists' in XXXXXXX/application/third_party/ApnsPHP/Autoload.php:49
我假設它是某種自動加載的衝突?但我不是 真的很確定!
任何幫助都會非常出色 - 我沒有多少運氣就拖網Google!
下面是我正在試圖在函數內部使用的線路:
require_once APPPATH.'/third_party/ApnsPHP/Autoload.php';
這裏的__autoload功能我添加裝載離子驗證的庫:
function __autoload($class)
{
if (strpos($class, 'CI_') !== 0)
{
if (file_exists($file = APPPATH.'core/'.$class.EXT))
{
include $file;
}
else if (file_exists($file = APPPATH.'libraries/'.$class.EXT))
{
include $file;
}
else if (file_exists($file = APPPATH.'core/base_controllers/'.$class.EXT))
{
include $file;
}
}
}
你可以發佈你寫與LIB使用的代碼?出於某種原因,這試圖實例化CI數據庫類。 –
我已經在Ion Auth的其他地方添加了一個自動加載功能 - 似乎是那種衝突。 – Rich