symfony2.1 FOQElasticaBundle class load


symfony2.1 FOQElasticaBundle class load

我按照这个 https://github.com/Exercise/FOQElasticaBundle#readme 设置 FOQElasticaBundleElastica 和 FOQElasticaBundle 都使用 git 子模块安装。

当我尝试应用程序/控制台时,它会给出错误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.

我发现FOQ试图在vendor/elastica/lib/Elastica/Client中加载Elastica_Client类.php但自从名为Client的类以来什么也没找到。

我随机浏览了弹性存储库 https://github.com/ruflin/Elastica/blob/v0.18.6.0/lib/Elastica/Client.php,发现以前命名为 Elastica_Client 的类。

问题是

  1. FOQElasticaBundle 是否已经过时,相对于当前的 Elastica 库?
  2. 还是我的自动加载出了问题。 PS:我正在使用作曲家自动加载机?

应用程序/自动加载.php

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

FOQElasticaBundle安装步骤适用于Symfony 2.0

在SF2.1中,你必须使用composer安装你的捆绑包,所以只需将其添加到你的composer.json文件中:

"ruflin/elastica": "0.19.8"这里的例子

然后运行以下命令:

composer update

最后一步是:

composer dumpautoload

最后一步为您生成自动加载文件