XAMPP + 2 Zend libraries

Problems with the Windows version of XAMPP, questions, comments, and anything related.

XAMPP + 2 Zend libraries

Postby PhilDHD » 03. November 2010 19:38

Hello

I am running Drupal6 on XAMPP 1.7.3. I am trying to use the Zend GData library. I suspect my problem is easily resolved but my knowlegde of Apache + PHP libraries is very limited and I have just spent a day failing to find a solution. Can anyone here help?

In a php file within htdocs I pointed at an existing Zend library (that exists as a requirement for another Drupal module):
Code: Select all
require_once 'sites/all/libraries/ZendGdata/library/Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_Gbase');


I got this error message:
Fatal error: Cannot redeclare class Zend_Loader in C:\xampp\php\PEAR\Zend\Loader.php on line 31


So, next I tried to point directly at the GData classes in my php file with:

Code: Select all
require 'sites/all/libraries/ZendGdata/library/Zend/Gdata/Gbase.php';
require 'sites/all/libraries/ZendGdata/library/Zend/Gdata/ClientLogin.php';


This stopped the redeclaration error but raised another issue:
Fatal error: Call to a member function getDOM() on a non-object in C:\xampp\php\PEAR\Zend\Gdata\App\FeedEntryParent.php on line 220

This error might well be a result of my function not working correctly but that is not my question. What I do not understand is why the error message refers to the Zend library in the xampp\php\PEAR\ folder. The GData library here is an older version than the one in my htdocs and I guess I need to understand how to use only one Zend or another.

Can anyone tell me why the error message refers to the XAMPP/PHP/PEAR/Zend library when my PHP includes the htdocs/sites/all/libraries/ZendGdata/library/Zend library?

And what is the best practise to get over this obstacle?


Thanks for reading this.

Phil
PhilDHD
 
Posts: 2
Joined: 03. November 2010 19:29

Re: XAMPP + 2 Zend libraries

Postby PhilDHD » 03. November 2010 21:26

Well I was right in that the answer is obvious if you know anything about these matters and I clearly dont. :) Just in case it might help someone else:

I got this going by adding the htdocs/sites/all/libraries/ZendGdata/library/Zend library before the PEAR/zend library in the php.ini's include_path setting. Like this-
Code: Select all
include_path = ".;C:\xampp\htdocs\sites\all\libraries\ZendGdata\library;C:\xampp\php\PEAR;"


I'm not confident this is an ideal solution but at least I seem to be using only one GData library now.

Phil
PhilDHD
 
Posts: 2
Joined: 03. November 2010 19:29


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 81 guests