registering zend framework in wordpress

I’m trying to use zend framework in wordpress and have tried various methods using plugins, the latest is :

http://crazycoders.net/2012/04/using-zend-framework-in-a-wordpress-environment/

Read More
    add_action('plugins_loaded', 'Zend_Framework_Register');

    function Zend_Framework_Register(){

//Setup Zend framework autoloading
define('ZEND_FRAMEWORK_PATH', dirname(__FILE__));
set_include_path(ZEND_FRAMEWORK_PATH . PATH_SEPARATOR . get_include_path());
require_once         'Zend'.DIRECTORY_SEPARATOR.'Loader'
    .DIRECTORY_SEPARATOR.'Autoloader.php';
Zend_Loader_Autoloader::getInstance();

//Send a signal to say that zend framework got registered
do_action('Zend_Framework_Registered');

    }

I have a plugin structure – enter image description here
I have included the minimal zend library.

Regardless of the method I’ve used I get the following error on activation

Fatal error: Class ‘Zend_Loader_Autoloader’ not found in C:vhostsplum-vet-recruitwordpresswp-contentpluginszend-framework-pluginzend-framework-plugin.php on line 22

Another thing that is confusing me is that the plugin scripts refer to Autoloader.php but the loader folder does not include an Autoloader file ..?

I’ve also tried this plugin http://wordpress.org/extend/plugins/wp-zend-library/

Any ideas..

Thanks

Related posts

Leave a Reply

1 comment

  1. You need to require in the autoloader class before you can use it, so before the Zend_Loader_Autoloader::getInstance(); line, add:

    require_once 'Zend/Loader/Autoloader.php';
    

    the autoloader then requires in the rest of the ZF files that you use. If you check the article you linked you’ll see it is doing this as well.

    Also keep in mind that the instructions you’re following are for ZF1. If there is no Zend/Loader/Autoloader.php file then you may have downloaded ZF2.