zend-framework2zend-search-lucene

How to use ZendSearch in Zendframework 2 with autoloader without zend application


I'm using Zend Framework 2 in a project with that code:

require_once APPPATH . "third_party/Zend/Loader/StandardAutoloader.php";

 $loader = new StandardAutoloader(array('autoregister_zf' => true));
 $loader->register();

How can I add ZendSearch from this github repo: https://github.com/zendframework/ZendSearch

I dont know how to copy it into the zend directory, so that the autoloader finds it.

Please help me.


Solution

  • Ladys and gentlemen, here is the solution:

    $loader = new StandardAutoloader(array('autoregister_zf' => true));
    $loader->registerNamespace('ZendPdf', APPPATH . "third_party/ZendPdf");
    $loader->registerNamespace('ZendSearch', APPPATH . "third_party/ZendSearch");
    $loader->register();
    

    Life could be so easy ;)