在Symfony2中安装EWZRecaptchaBundle

时间:2014-01-22 14:43:55

标签: symfony bundle recaptcha

我正在使用symfony 2.4.0,我想安装EWZRecaptchaBundle来为我的表单添加验证码,所以我将这行添加到composer.json

"require": {
         //...
        "excelwebzone/recaptcha-bundle": "2.0.*"
        //...
    }

我运行此命令

composer update

但它没有成功安装捆绑包,这是我在命令中得到的错误消息

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package excelwebzone/recaptcha-bundle could not be found in
any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your min
imum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common
 problems.

对于记录,这是我要安装的软件包的Github链接:

https://github.com/excelwebzone/EWZRecaptchaBundle

任何想法??

注意:

  • 我使用命令行作为管理员。
  • 我也测试了这一行:&#34;&#34; excelwebzone / recaptcha-bundle&#34;:&#34; dev-master&#34;
  • 当我将最小稳定性设置设置为:&#34; dev&#34;时,结果相同。或&#34;稳定&#34;

2 个答案:

答案 0 :(得分:2)

尝试使用此要求:

"excelwebzone/recaptcha-bundle": "dev-master"

因为2.0.x-dev正在开发中。或使用旧的稳定版本:

"excelwebzone/recaptcha-bundle": "v1.0.0"

答案 1 :(得分:1)

维克多,你完全正确。但是有些人可能仍会遇到版本控制问题。 除非使用确切的1.0版本,否则仍会有问题。

所以做完要求之后:

composer require "excelwebzone/recaptcha-bundle"

您将添加版本1.0,如:

Please provide a version constraint for the excelwebzone/recaptcha-bundle requirement: 1.0.*