0

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');
herlambang
  • 185
  • 2
  • 9

1 Answers1

1

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

tttony
  • 4,944
  • 4
  • 26
  • 41
  • I successfully installed FOQElasticaBundle and Elastica library, the problem is the FOQElasticaBundle unable to load Elastica classes. – herlambang Jan 23 '13 at 06:50