CodeIgniter Forums

Full Version: Not able to use Zend class
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

I followed these instructions.
But none of them worked.

Could anyone direct me to the right direction please?

Thanks in advance.

El Forum

Did you get it working?
I implemented the Zend Gdata classes yesterday....
If you need help, let me know.

El Forum

Thanks. I need your help.
I still can't find the way.

El Forum

it all depends the kind of help you need... if you need help setting up your Zend for CI.

this is what I did.

Step 01: Make the Zend Library Accessible
I put the "Zend" folder in the folder: /assets/classes
In your index.php:
$my_include_folder = realpath(dirname(__FILE__)).'/assets/classes';
set_include_path(get_include_path() . PATH_SEPARATOR . $my_include_folder);

Step 01: Call the Zend Framework:
In your controller or whereever you need it:

Step 03: Use your selected Zend classes:

I am using YouTube API for Zend, so I use:

and then I use the code:

$youtube = new Zend_Gdata_YouTube();
$query = $youtube->newVideoQuery();
$query->videoQuery = 'cats';
$query->startIndex = 10;
$query->maxResults = 20;
$query->orderBy = 'viewCount';

$videoFeed = $youtube->getVideoFeed($query);

So, thats pretty much it.... IMPORTANT step is setting the include path to the parent of the Zend folder....


El Forum

Also remember that the Zend framework is PHP5 only.

El Forum

Since I am using Xampp, I am having problems with paths using CI in XAMPP.

I get error message.
Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader.php' (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\ci_zend\system\application\controllers\welcome.php on line 2

The line 2 is require_once('Zend/Loader.php');

I found that the following.

set_include_path(get_include_path() . PATH_SEPARATOR . :.;C:\xampp\php\pear\

Is it correct?

El Forum

Yes, I got it.

I used the following for XAMPP.

ini_set("include_path", ini_get("include_path").PATH_SEPARATOR.str_replace("/", "\\", BASEPATH)."/contrib/");
require_once 'Zend/Loader.php';

<a href=""></a>