herlambang
herlambang

Reputation: 185

symfony2.1 FOQElasticaBundle class load

I setup FOQElasticaBundle following this https://github.com/Exercise/FOQElasticaBundle#readme both Elastica and FOQElasticaBundle installed using git submodule.

and when I try app/console, it gives error The autoloader expected class "Elastica_Client" to be defined in file "/path/to/project/../vendor/elastica/lib/Elastica/Client.php". The file was found but the class was not in it, the class name or namespace probably has a typo.

I found that FOQ tried to load Elastica_Client class within vendor/elastica/lib/Elastica/Client.php and found nothing since the class named Client.

I randomly browse elastica repo https://github.com/ruflin/Elastica/blob/v0.18.6.0/lib/Elastica/Client.php , and found that the class previously named Elastica_Client.

the questions are

  1. is FOQElasticaBundle is outdated, against the current Elastica library?
  2. or is there something gone wrong with my autoload. ps: i'm using composer autoloader?

app/autoload.php

$loader->add('Elastica', __DIR__.'/../vendor/elastica/lib');
$loader->add('FOQ', __DIR__.'/../vendor/bundles');

Upvotes: 0

Views: 455

Answers (1)

tttony
tttony

Reputation: 5082

That FOQElasticaBundle install steps is for Symfony 2.0

In SF2.1 you have to install your bundles with composer, so just add this to your composer.json file:

"ruflin/elastica": "0.19.8"here an example

Then run this command:

composer update

And the last step is:

composer dumpautoload

The last step generate the autoloads files for you

Upvotes: 1

Related Questions