CodeIgniter Forums
Not able to use Zend class - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Not able to use Zend class (/thread-24528.html)



Not able to use Zend class - El Forum - 11-12-2009

[eluser]shinokada[/eluser]
I followed these instructions.
But none of them worked.

http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/

http://freakauth.4webby.com/tutorials/using-zend-framework-components-in-code-igniter

Could anyone direct me to the right direction please?

Thanks in advance.


Not able to use Zend class - El Forum - 11-18-2009

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


Not able to use Zend class - El Forum - 11-18-2009

[eluser]shinokada[/eluser]
Thanks. I need your help.
I still can't find the way.


Not able to use Zend class - El Forum - 11-18-2009

[eluser]jkevinburton[/eluser]
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:
require_once('Zend/Loader.php');

Step 03: Use your selected Zend classes:
Zend_Loader::loadClass('Zend_Gdata_HttpClient');

I am using YouTube API for Zend, so I use:
Zend_Loader::loadClass('Zend_Gdata_YouTube')

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....

Cheers!


Not able to use Zend class - El Forum - 11-18-2009

[eluser]jkevinburton[/eluser]
Also remember that the Zend framework is PHP5 only.


Not able to use Zend class - El Forum - 11-18-2009

[eluser]shinokada[/eluser]
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?


Not able to use Zend class - El Forum - 11-20-2009

[eluser]shinokada[/eluser]
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="http://www.mynameisphil.net/article/may/2009/implementing-the-zend-framework-with-codeigniter/11">http://www.mynameisphil.net/article/may/2009/implementing-the-zend-framework-with-codeigniter/11</a>