ZF-7013: Gdata - paths in loader apparently incorrect and causing errors

Description

I have an action that posts data to a blogger account. The actual action works fine, but with zend framework versions 1.8.2 and 1.8.3 I have an error message announcing that there are files missing for Zend_Loader.

Here are the files it is looking for:

Zend/Gdata/Kind/Entry.php Zend/Gdata/Kind/Title.php Zend/Gdata/Kind/Content.php

Oddly, the problem does not affect Zend 1.8.1 (and presumably below) only versions 1.8.2/3. Also, the actual action works great (data is posted to the blog etc...), it is almost as if there is an error for no reason.

Just top confirm, the library/Zend directory(s) and files are completely un-modified, so the installation is stock.

Any help would be appreciated.

Comments

Trevor - can you look at this?

Matthew, Can you provide some more information? What are you calling that's causing this, and what is the exact error text that's returned?

Hi there,

No problem, I am using Zend_Gdata, the particular call(s) are:

newEntry() setCategory() newContent() insertEntry()

Here is the output from the browser (this is with Zend 1.8.4):

Warning: Zend_Loader::include(Zend/Gdata/Kind/Entry.php): failed to open stream: No such file or directory in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(Zend/Gdata/Kind/Entry.php): failed to open stream: No such file or directory in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(): Failed opening 'Zend/Gdata/Kind/Entry.php' for inclusion (include_path='/hsphere/local/home/mattroby/dev.workjabber.com.application/../library:/hsphere/local/home/mattroby/library:.:/hsphere/shared/apache/libexec/php5ext/php/') in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(Zend/Gdata/Extension/Entry.php): failed to open stream: No such file or directory in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(Zend/Gdata/Extension/Entry.php): failed to open stream: No such file or directory in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(): Failed opening 'Zend/Gdata/Extension/Entry.php' for inclusion (include_path='/hsphere/local/home/mattroby/dev.workjabber.com.application/../library:/hsphere/local/home/mattroby/library:.:/hsphere/shared/apache/libexec/php5ext/php/') in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(Zend/Gdata/Kind/Title.php): failed to open stream: No such file or directory in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(Zend/Gdata/Kind/Title.php): failed to open stream: No such file or directory in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(): Failed opening 'Zend/Gdata/Kind/Title.php' for inclusion (include_path='/hsphere/local/home/mattroby/dev.workjabber.com.application/../library:/hsphere/local/home/mattroby/library:.:/hsphere/shared/apache/libexec/php5ext/php/') in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(Zend/Gdata/Extension/Title.php): failed to open stream: No such file or directory in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(Zend/Gdata/Extension/Title.php): failed to open stream: No such file or directory in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(): Failed opening 'Zend/Gdata/Extension/Title.php' for inclusion (include_path='/hsphere/local/home/mattroby/dev.workjabber.com.application/../library:/hsphere/local/home/mattroby/library:.:/hsphere/shared/apache/libexec/php5ext/php/') in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(Zend/Gdata/Title.php): failed to open stream: No such file or directory in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(Zend/Gdata/Title.php): failed to open stream: No such file or directory in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(): Failed opening 'Zend/Gdata/Title.php' for inclusion (include_path='/hsphere/local/home/mattroby/dev.workjabber.com.application/../library:/hsphere/local/home/mattroby/library:.:/hsphere/shared/apache/libexec/php5ext/php/') in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(Zend/Gdata/Kind/Content.php): failed to open stream: No such file or directory in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(Zend/Gdata/Kind/Content.php): failed to open stream: No such file or directory in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(): Failed opening 'Zend/Gdata/Kind/Content.php' for inclusion (include_path='/hsphere/local/home/mattroby/dev.workjabber.com.application/../library:/hsphere/local/home/mattroby/library:.:/hsphere/shared/apache/libexec/php5ext/php/') in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(Zend/Gdata/Extension/Content.php): failed to open stream: No such file or directory in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(Zend/Gdata/Extension/Content.php): failed to open stream: No such file or directory in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(): Failed opening 'Zend/Gdata/Extension/Content.php' for inclusion (include_path='/hsphere/local/home/mattroby/dev.workjabber.com.application/../library:/hsphere/local/home/mattroby/library:.:/hsphere/shared/apache/libexec/php5ext/php/') in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(Zend/Gdata/Content.php): failed to open stream: No such file or directory in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(Zend/Gdata/Content.php): failed to open stream: No such file or directory in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 Warning: Zend_Loader::include(): Failed opening 'Zend/Gdata/Content.php' for inclusion (include_path='/hsphere/local/home/mattroby/dev.workjabber.com.application/../library:/hsphere/local/home/mattroby/library:.:/hsphere/shared/apache/libexec/php5ext/php/') in /hsphere/local/home/mattroby/library/Zend/Loader.php on line 83 This is the editing URL - http://blogger.com/feeds/1244349801983750320/…

Just an update, with the latest 1.8.4 release of ZF, the problem still persists.

Matthew, I think this may be a problem with your installation. I'm not able to reproduce this.

I've attached a test case here that calls all of the functions you listed without problem: [^zf7013-test.php]

For now, I'm going to close this issue with resolution "cannot reproduce". However, if you can provide a modified test case which demonstrates this problem, feel free to leave a followup comment and I'll re-open this.

Trevor,

As requested, I am posting here because of a similar problem. The code is as follows:

    $username = 'user@example.com';
    $password = 'password';
    $domain = 'example.com';
    $userToSearchFor = 'tester';
    $conn = Zend_Gdata_ClientLogin::getHttpClient($username, $password, Zend_Gdata_Gapps::AUTH_SERVICE_NAME);
    $gapps = new Zend_Gdata_Gapps($conn, $domain);

    $this->view->user = $gapps->retrieveUser($userToSearchFor);

I'm trying to use the Gapps API and access the Provisioning API of Google Apps. The Provisioning API is available on Premier and Education editions of Google Apps.

The warning message is displayed below. I'm using version 1.8.4 of the framework. Previously when I was in version 1.7.8, this message did not appear. I switched the Gdata library folder from 1.7.8 into 1.8.4 and the warning message did not appear as well.

Warning: include(Zend/Gdata/Gapps/Extension/UserQuery.php) [function.include]: failed to open stream: No such file or directory in /home/cheeze/public_html/zend/library/Zend/Loader.php on line 83

Warning: include() [function.include]: Failed opening 'Zend/Gdata/Gapps/Extension/UserQuery.php' for inclusion (include_path='/home/cheeze/public_html/zend/application/../library:/home/cheeze/public_html/zend/library:.:/usr/share/php:/usr/share/pear') in /home/cheeze/public_html/zend/library/Zend/Loader.php on line 83

I am having essentially the exact same issue as Chee How

trying to access the Google Provisioning API, using virtually identical code, and am getting the same error:

Warning: include(Zend/Gdata/Gapps/Extension/UserQuery.php) [function.include]: failed to open stream: No such file or directory in /home/cheeze/public_html/zend/library/Zend/Loader.php on line 83

Warning: include() [function.include]: Failed opening 'Zend/Gdata/Gapps/Extension/UserQuery.php' for inclusion (include_path='/home/cheeze/public_html/zend/application/../library:/home/cheeze/public_html/zend/library:.:/usr/share/php:/usr/share/pear') in /home/cheeze/public_html/zend/library/Zend/Loader.php on line 83

As a temporary workaround, I've copied the UserQuery.php file into the Extensions directory, which seems to work, but I can't understand why the loader is looking there to begin with.

Experimenting further, it seems that, at least in my case, UserQuery is actually being found (I can use retrieveUser function perfectly), but the warnings still persist.

Could the Loader be looking for the file in two different places?

For those of you who are experiencing this problem:

Please attach a complete test case that reproduces this, including calls to Zend_Loader. See this file as an example: [^zf7013-test.php]

Also please let me know when output you run the above test case, and the the output from {{phpinfo()}} (or {{php -i}} from the command line).

Got a similar error, but using the autoloader.

###3
<?php require_once 'Zend/Loader/Autoloader.php'; $loader = Zend_Loader_Autoloader::getInstance(); $email = 'email@somedomain.com'; $pass = 'password'; $service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; try { $client = Zend_Gdata_ClientLogin::getHttpClient($email, $pass, $service); } catch (Zend_Gdata_App_Exception $e) { echo "Error: Authentication with Google failed. Reason: BadAuthentication"; exit; } $gdataCal = new Zend_Gdata_Calendar($client); $query = $gdataCal->newEventQuery(); ?>
#

The output

Warning: include(Zend/Gdata/Calendar/Extension/EventQuery.php) [function.include]: failed to open stream: No such file or directory in /usr/share/php/ZendFramework-1.8.4/library/Zend/Loader.php on line 83

Warning: include() [function.include]: Failed opening 'Zend/Gdata/Calendar/Extension/EventQuery.php' for inclusion (include_path='.:/var/www/developer/libs:/usr/share/pear') in /usr/share/php/ZendFramework-1.8.4/library/Zend/Loader.php on line 83

#

I don't get the error when using

require_once('Zend/Loader.php'); Zend_Loader::loadClass('Zend_Gdata'); Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); Zend_Loader::loadClass('Zend_Gdata_Calendar');

to load.

If interested, i can give you the output of my php -i

I'm having the same issue with Leif: using the loader "manually" works fine.

The problem occurs when using the Autoloader.

It looks like this problem occurs in the release-1.8 branch, but not in trunk.

Since the 1.9 branch is going to be cut soon, I'm not going to bother to backport the fix for this to the release-1.8 branch (unless I hear that there's going to be another 1.8.X release). In the meantime, please download a development snapshot from here to fix this:

http://framework.zend.com/code/browse/…

If you continue to have this problem while using the above snapshot, please let me know.

Resolving as fixed for next minor release (1.9.0).

Just chiming in...

Verified that my issue was the same...Loader works fine, Autoloader causes issue

Will try snapshot tomorrow.

Thanks, Trevor!

Verified that the dev snapshot listed above solve my issue.

Thanks!

I can also verify that the 1.9 version fixes the issue as well.

Thanks for the work, Trevor!

using version 1.11.11 i get 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

Another bug report has been filed for this as ZF-11959 .