ZF-11959: No such file or directory: Zend\Gdata\Calendar\Extension\EventQuery.php

Issue Type: Bug Created: 2011-12-23T17:22:50.000+0000 Last Updated: 2013-02-19T19:32:25.000+0000 Status: Resolved Fix version(s): - 1.12.1 (18/Dec/12)

Reporter: Maxim Postoronca (max4ever) Assignee: Trevor Johns (tjohns) Tags: - Zend_Gdata

  • FixForZF1.12
  • loader
  • zf-crteam-review

Related issues: - ZF-7013

Attachments: - ZF-11959.patch


Please see this bug, i think it's a regression bug…

Accessing google calendar my error log gives me include_once(Zend\Gdata\Calendar\Extension\EventQuery.php) [<function.include-once>]: failed to open stream: No such file or directory in C:\www\www\gestionale\library\Zend\Loader.php : 146

include_once() [<function.include>]: Failed opening 'Zend\Gdata\Calendar\Extension\EventQuery.php' for inclusion (include_path='C:\www\www\gestionale\application/../library;C:\www\www\gestionale\library;.;C:\php\pear') in C:\www\www\gestionale\library\Zend\Loader.php : 146 but the application works anyway.

I am using Windows 7 environment, so it is not a case sensitive problem


Posted by Adam Lundrigan (adamlundrigan) on 2012-02-26T07:09:38.000+0000

Could you provide some code which reproduces your issue?

There is not Zend_Gdata_Calendar_Extension_EventQuery class in the framework. There is, however, a Zend_Gdata_Calendar_EventQuery class.

Posted by Maxim Postoronca (max4ever) on 2012-02-27T17:28:24.000+0000

<pre class="highlight">
        //<a href="">…</a>
        $service = Zend_Gdata_ClientLogin::getHttpClient($email, $password, Zend_Gdata_Calendar::AUTH_SERVICE_NAME );

        if (is_a($service, 'Zend_Gdata_HttpClient'))
                try {
                $service = new Zend_Gdata_Calendar($service);
                $calendars = $service->getCalendarListFeed();
                foreach($calendars as $calendar)
                    if ($calendar->title == $email)
                        $query = $service->newEventQuery();  ///=> here goes the erorr

Posted by Adam Lundrigan (adamlundrigan) on 2012-02-28T03:51:26.000+0000

Could you please provide a use case example? A small snippet of the framework code without a file name and line number doesn't really help narrow down where the problem is coming from.

Posted by Jurgens du Toit (jrgns) on 2012-06-03T12:44:19.000+0000

You can try the following code

<pre class="highlight">
$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();

It was reported on StackOverflow

Posted by Jurgens du Toit (jrgns) on 2012-06-03T13:35:30.000+0000

I did some digging.

In Zend/Gdata/App.php version 1.11.11, lines 1047 to 1058:

<pre class="highlight">
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             }

The class relies on the loader to throw a Zend_Exception if the file / class it tries to load doesn't exist, or just suppresses the error with the @ symbol.

Simplified, I have the following code:

<pre class="highlight">

function errorFunction($errno, $errstr, $errfile, $errline)
    throw new ErrorException($errstr, 0, $errno, $errfile, $errline);

This clearly doesn't honour the error suppression, and produces the above mentioned error.

This can be fixed for a lot of users by also catching the ErrorException and doing nothing with it, just like the Zend_Exception.

Posted by Adam Lundrigan (adamlundrigan) on 2012-06-04T12:43:29.000+0000

The simpler fix would be to not throw (non-fatal) E_NOTICE raises as (fatal) ErrorException. That said, I don't see any problem with catching and ignoring ErrorException here, as chances are that if the file being loaded has errors we're not going to want to use it anyway.

Posted by Adam Lundrigan (adamlundrigan) on 2012-06-04T13:02:11.000+0000

I've attached a fix and unit test that implements the suggested workaround. Personally, I would prefer that end users not throw E_NOTICE as an exception, but that's just me. I'll leave it up to the maintainer of Zend_Gdata or the CR Team to decide if the patch should be applied to the next release.

Posted by Jurgens du Toit (jrgns) on 2012-06-22T09:32:43.000+0000

Not throwing an exception for notices makes sense, but I see in the ZF2 code they cover all their bases just by catching the base Exception class.

It might be a better (simpler) solution than the one I proposed.

Posted by Rob Allen (rob) on 2012-11-03T14:06:28.000+0000

Patch applied on trunk (25062) and release-1.12 (25063)

Posted by Nate Nolting (withremote) on 2013-02-19T19:32:25.000+0000

This error still exists in 1.12.1 Zend_Gdata

Have you found an issue?

See the Overview section for more details.


© 2006-2022 by Zend by Perforce. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.