views:

332

answers:

4

Hey all, I am wanting to do stuff with the Google Data API, the contacts specifically. The easist method i have found so far is using Zend. The problem I am having is adding the Zend framework. Does anyone know how to do this with WordPress?

Thanks

A: 

Try this http://blueberryware.net/2008/09/04/wp-library-autoloader-plugin I think all you need is there.

lfx
I already tried that it wouldnt work. I also tried:http://wordpress.org/extend/plugins/zend-framework/Whenever it got to a point where i use the framework i get a 500 error.
korki696
Find out what is causing the error. Either turn on error_reporting/display_errors(true), or look in the error log.
timdev
The error I am getting is this:PHP Fatal error: Class 'Zend_Gdata_ClientLogin' not found in /Applications/MAMP/htdocs/wp-content/themes/levitation/send.php on line 82
korki696
Oh and I dont want this as part of a plugin. I need this on one page and thats it.
korki696
1) You're not setting up the autoloader properly. You might be able to get away with just including the right classfiles from Zend, but I have no idea what the dependencies for Gdata_ClientLogin are. 2) Then don't do it as a plugin -- though you should try it sometime, it's not hard to do.
timdev
I am using the autoloader that came with the plugin so everything is already set up. But no matter what I do it wont work.
korki696
+1  A: 

It should be pretty trivial.

Write and test some bootstrap code that sets up ZF's autoloading and make sure it generally works.

Stick that code in a wordpress plugin, and tie things up to the right hooks in wordpress.

timdev
A: 

you can use "hardcoded" includes if you fail to setup autoloading ->

in /wp-content/themes/levitation/send.php insert to the first line: require_once 'your/path/to/zend/Zend/GData/ClientLogin.php';

Problem is you need to get through all the errors and alwas include the missing class (inside classes are the includes taken care of...

Or in the main file (guess index.php) insert:

set_include_path(get_include_path() . PATH_SEPARATOR . 'your/path/to/zend/');
//for ZF below 1.8 
require_once 'Zend/Loader.php'; 
Zend_Loader::registerAutoload();
 //for ZF > 1.8 
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::setFallbackAutoloader(true);
Tomáš Fejfar
Hey, That is what I ended up doing. Hardcoding worked, I am not sure why the other moethods didnt work but its working now.
korki696
A: 

make sure that you are calling:

Zend_Loader::loadClass('Zend_Gdata_ClientLogin');

before you using that class.

and that you have a developer key

non euclidian