I'm migrating application from ZF1 to ZF2. I have a controller depends on third party lib 'Solarium'.
namespace Stock\Controller;
class BaseController extends AbstractActionController
{
protected function indexAction()
{
require_once('Solarium/Autoloader.php');
Solarium_Autoloader::register();
The 'Solarium' exists under 'vendor', and in 'init_autoloader.php' I have:
set_include_path(implode(PATH_SEPARATOR, array(
realpath('vendor')
)));
But, when I viewing the page, there's an error:
Fatal error: Class 'Stock\Controller\Solarium_Autoloader' not found in ...
I tried to add trace in 'StandardAutoloader.php' and found StandardAutoloader.autoload('Stock\Controller\Solarium_Autoloader') is called on runtime.
I want to know how this happens and how to fix it. Thanks.