我已经成功使用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