使用composer安装PEAR扩展名HTTP_Request2 [英] Install PEAR extension HTTP_Request2 with composer

查看:143
本文介绍了使用composer安装PEAR扩展名HTTP_Request2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 composer.json 文件:

{
    "name": "vendor/Project",
    "description": "description_text",
    "repositories": [
        {
            "type": "pear",
            "url": "http://pear.php.net"
        }
    ],
    "require": {
        "jakeasmith/http_build_url": "dev-master",
        "phpmailer/phpmailer": "dev-master",
        "pear-pear/Text_Diff": "*",
        "pear-pear/Net_IDNA2": "*",
        "pear-pear/HTTP_Request2": "2.2.1"
    },
    "require-dev": {
        "phpunit/phpunit": "< 4.0.0"
    }
}

执行命令 php composer.phar install 我得到了:

Loading composer repositories with package information
Initializing PEAR repository http://pear.php.net
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for pear-pear/http_request2 2.2.1 -> satisfiable by pear-pear.php.net/HTTP_Request2[2.2.1].
    - pear-pear.php.net/HTTP_Request2 2.2.1 required pear-pear.php.net/net_url2 >=2.0.0.0 -> no matching package found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-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.

为什么会出现错误?我是否应该将所有梨依赖项真正存储在我的composer.json文件中以作为 HTTP_Request2 扩展名?

Why I'm getting an error? should I really store all pear dependencies in my composer.json file for the HTTP_Request2 extension?

P.S。如果我运行 php composer.phar install

P.S. If I run php composer.phar install with

"pear-pear/Archive_Tar": "*",
"pear-pear/Console_Getopt": "*",
"pear-pear/Structures_Graph": "*",
"pear-pear/XML_Util": "*",
"pear-pear/PEAR": "*",
"pear-pear/Net_URL2": "*"

,然后添加一个字符串: pear-pear / HTTP_Request2: 2.2.1 和运行 php composer.phar更新-一切都像魔术一样!但是我认为这不是正确的方法。

and after this add a string: "pear-pear/HTTP_Request2": "2.2.1" and run php composer.phar update - everything is work like a magic! But I don't think that this is the right way.

推荐答案

通过重命名解决:

"pear-pear/HTTP_Request2": "2.2.1"

"pear-pear.php.net/HTTP_Request2": "2.2.1"

这篇关于使用composer安装PEAR扩展名HTTP_Request2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆