我使用git子模块安装了FOQElasticaBundle,在这个https://github.com/Exercise/FOQElasticaBundle#readme之后安装了Elastica和FOQElasticaBundle。
当我尝试app/控制台时,它会给出错误的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试图在供应商/Elastica/lib/Elastica/Client.php中加载Elastica_Client类,但是在名为Client的类中没有发现任何东西。
我随机浏览了elastica https://github.com/ruflin/Elastica/blob/v0.18.6.0/lib/Elastica/Client.php,并发现以前名为Elastica_Client的类。
问题是
app/autooload.php
$loader->add('Elastica', __DIR__.'/../vendor/elastica/lib');
$loader->add('FOQ', __DIR__.'/../vendor/bundles');发布于 2013-01-23 03:43:42
FOQElasticaBundle安装步骤适用于Symfony 2.0
在SF2.1中,您必须使用composer安装包,所以只需将其添加到composer.json文件中即可:
"ruflin/elastica": "0.19.8"这里有一个例子
然后运行以下命令:
composer update
最后一步是:
composer dumpautoload
最后一步为您生成autoloads文件。
https://stackoverflow.com/questions/14455991
复制相似问题