首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >symfony2.1 FOQElasticaBundle类加载

symfony2.1 FOQElasticaBundle类加载
EN

Stack Overflow用户
提问于 2013-01-22 10:08:40
回答 1查看 440关注 0票数 0

我使用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的类。

问题是

  1. 与当前的Elastica库相比,FOQElasticaBundle是否过时了?
  2. 或者我的自拍有什么问题。ps:我用的是作曲家自动加载器?

app/autooload.php

代码语言:javascript
复制
$loader->add('Elastica', __DIR__.'/../vendor/elastica/lib');
$loader->add('FOQ', __DIR__.'/../vendor/bundles');
EN

回答 1

Stack Overflow用户

发布于 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文件。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14455991

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档