For all those poking around Drupal and Zend Framework, I wrote a little module that auto-loads Zend Framework. This module works with new Zend_Loader_Autoloader introduced in version 1.8. Therefore this Drupal module requires new 1.8 or higher version of Zend Framework library.
Module is really simple, not much to it. Note that Zend Framework library it self is not packed with module, you need to download is separately and copy paste to modules /library folder.
It has only two files, one .info file needed for Drupal to recognize it and one .module file whose content you can see below.
function ZendFrameworkLoader_boot() { //Get current file path, cut off the file name and use the rest as folder path $siteBasePath = str_replace('ZendFrameworkLoader.module', '', __FILE__); //Append subfolder named 'library' to the path $siteLibraryPath = $siteBasePath.'library'; //Add script wide include paths set_include_path('.' . PATH_SEPARATOR . $siteLibraryPath . PATH_SEPARATOR . $siteLibraryPath.'/Zend' . PATH_SEPARATOR . get_include_path()); include_once $siteLibraryPath.'/Zend/Loader/Autoloader.php'; Zend_Loader_Autoloader::getInstance(); }
As you can see module is using hook_boot() to handle (inject) auto-loading code. Therefore try not to call any of the Zend library components in hook_boot functions, latter is good.
Installing a module is done by simply copy-pasting unarchived module to /sites/all/modules/ folder. By doing so you should have /sites/all/modules/ActiveCodeline folder in place if you copy-pasted it ok.
Download ActiveCodeline_ZendFrameworkLoader.