0

我在此https://github.com/Exercise/FOQElasticaBundle#readme之后设置了 FOQElasticaBundle ,使用 git 子模块安装了 Elastica 和 FOQElasticaBundle。

当我尝试应用程序/控制台时,它给出了错误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.php 中加载 Elastica_Client 类,但自名为 Client 的类以来一无所获。

我随机浏览了 elastica repo https://github.com/ruflin/Elastica/blob/v0.18.6.0/lib/Elastica/Client.php,发现该类之前命名为 Elastica_Client。

问题是

  1. 与当前的 Elastica 库相比,FOQElasticaBundle 是否已过时?
  2. 还是我的自动加载出了什么问题。ps:我正在使用作曲家自动加载器?

应用程序/自动加载.php

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

1 回答 1

1

FOQElasticaBundle安装步骤适用于 Symfony 2.0

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

"ruflin/elastica": "0.19.8"这是一个例子

然后运行这个命令:

composer update

最后一步是:

composer dumpautoload

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

于 2013-01-23T03:43:42.057 回答