Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zend Framework with Kohana PHP 3

Tags:

I've put the Zend library folder into classes folder of my app and renamed all files and folders to lowercase ( using Ant Renamer ).

When I call Zend_Feed, instead of loading /classes/zend/feed.php, kohana loads Zend from my servers share\ZendFramework\library\Zend\ (Zend Server), so I get a Cannot redeclare class Zend_Uri_Http error.

ZF version; 1.10 Kohana version: the most recent files available through GitHub

Edit: https://github.com/kolanos/kohana-zend

like image 847
Kemo Avatar asked Jan 23 '10 13:01

Kemo


1 Answers

Kohana autoloader expects lowercase filenames. You can register both Zend and Kohana autoloaders and it should work fine.

In bootstrap you have:

/**
 * Enable the Kohana auto-loader.
 *
 * @see  http://docs.kohanaphp.com/features/autoloading
 * @see  http://php.net/spl_autoload_register
 */
spl_autoload_register(array('Kohana', 'auto_load'));

Zend autoloader should go before or after that (I don't know if that makes a difference). Found a post how to do it: http://www.beyondcoding.com/2009/10/29/using-zend-framework-1-8-with-kohana/

like image 178
Pomyk Avatar answered Oct 20 '22 00:10

Pomyk