Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 谷歌日历Zend_加载程序错误_Php_Zend Framework_Google Calendar Api - Fatal编程技术网

Php 谷歌日历Zend_加载程序错误

Php 谷歌日历Zend_加载程序错误,php,zend-framework,google-calendar-api,Php,Zend Framework,Google Calendar Api,当我在PHP中初始化Google日历API时,Zend_Loader(1.10.8)出现了一些错误。这是我的密码: \Zend_Loader::loadClass('Zend_Gdata'); \Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); \Zend_Loader::loadClass('Zend_Gdata_Calendar'); $this->_service = \Zend_Gdata_Calendar::AUTH_SERVIC

当我在PHP中初始化Google日历API时,Zend_Loader(1.10.8)出现了一些错误。这是我的密码:

\Zend_Loader::loadClass('Zend_Gdata');
\Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
\Zend_Loader::loadClass('Zend_Gdata_Calendar');
$this->_service = \Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
$this->_client  = \Zend_Gdata_ClientLogin::getHttpClient(USER, PASS, $this->_service);
$this->_client->setConfig(array('keepalive' => true));
$this->_service = new \Zend_Gdata_Calendar($this->_client);
$this->defaultQuery = $this->_service->newEventQuery();
最后一行给出了以下错误:

Warning: include_once(Zend/Gdata/Calendar/Extension/EventQuery.php): failed to open stream: No such file or directory
Warning: include_once(): Failed opening 'Zend/Gdata/Calendar/Extension/EventQuery.php' for inclusion

这不会破坏任何功能,但我不知道如何解决错误。我的EventQuery.php文件位于“/Zend/Gdata/Calendar/EventQuery.php”中,而不是它在错误中使用的路径。有什么想法吗?

这是一个bug,而且它似乎在新版本的ZendFramework中再次出现

这是原件


这是我重新打开的一个,但什么都没有发生

当您注册了引发异常的错误处理程序时,会发生这种情况:

set_error_handler('errorFunction');

function errorFunction($errno, $errstr, $errfile, $errline)
{
    throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
在Zend/Gdata/App.php版本1.11.11中,第1046至1059行:

1046             foreach ($this->_registeredPackages as $name) {
1047                  try {
1048                      // Autoloading disabled on next line for compatibility
1049                      // with magic factories. See ZF-6660.
1050                      if (!class_exists($name . '_' . $class, false)) {
1051                         require_once 'Zend/Loader.php';
1052                         @Zend_Loader::loadClass($name . '_' . $class);
1053                      }  
1054                      $foundClassName = $name . '_' . $class;
1055                      break;
1056                  } catch (Zend_Exception $e) {
1057                      // package wasn't here- continue searching
1058                  }   
1059             }
如果试图加载的文件/类不存在,或者只是用
@
符号抑制错误,则类依赖加载程序引发Zend_异常

在错误处理程序中抛出
ErrorException
,会绕过错误抑制,并导致此代码失败

解决方案 我已经就ZF问题、原因和可能的解决方案发表了评论。同时,您可以在第1058-1060行添加以下内容

} catch (ErrorException $e) {
    //Do Nothing, just the file not found error
}

只需将第1056行的
Zend_异常
更改为基本
异常
,就像在ZF2中所做的那样。

nice,但问题是,我有一个错误处理程序记录所有错误,以便以后可以修复它们,而且每次升级zendframework时都要记住手动应用补丁肯定不是那么舒服。希望Zend的人能尽快解决这个问题。我检查了ZF2代码,它已经在那里修复了。这个错误仍然显示在
1.12.1
中,其中有上面的修复。@Withremote引发了什么异常?异常消息是什么?@Jrgns
error-2013-02-19 13:19:25-->严重性:警告-->include_once()[]:无法打开“Zend/Gdata/Calendar/Extension/EventQuery.php”进行包含(include_path=”。:/usr/lib/php:/usr/local/lib/php:www:/home/grchamb/public_html/mm/application/libraries)/home/grchamb/public_html/mm/application/libraries/Zend/Loader.php 134
,但是尽管存在include错误,所有函数仍然可以工作<代码>Zend_Gdata_应用程序_异常未返回任何错误。