添加 pear/xml_parser 到 compser.json

Add pear/xml_parser to compser.json

我正在尝试将 pear/xml_serializer 包含在我的 Laravel 项目中。所以,在 composer.json 文件中我做

"repositories": {
    "phppear": {
        "type": "pear",
        "url": "http://pear.php.net"
    }
},

加载 repo,然后我将它包含在 require 部分中,如下所示:

"require": {
    ...
    "pear/xml_serializer": "dev-master"
},

这很好用。问题是这个包需要 pear/xml_parser,但是做

"require": {
    ...
    "pear/xml_parser": "dev-master",
    "pear/xml_serializer": "dev-master"
},

无效。 xml_parser2 也没有。我收到此错误:

The requested package pear/xml_parser2 could not be found in any version, there may be a typo in the package name.

我不得不假设这意味着它找不到包,但我不知道如何加载它。我已经尝试了上述命令的几种不同变体。包裹在这里:

http://pear.php.net/package/xml_serializer http://pear.php.net/package/xml_parser2

但是只能找到第一个?我需要从其他地方获取 xml_parser 吗?

感谢您的帮助。

请试一试:

{
    "require": {
        "pear-pear.php.net/xml_parser": "*",
        "pear-pear.php.net/xml_serializer": "*"
    },
    "repositories": [
        {
            "type": "pear",
            "url": "http://pear.php.net"
        }
    ]
}

结果:

 ...
  - Installing pear-pear.php.net/xml_parser (1.3.4)
  - Installing pear-pear.php.net/xml_serializer (0.20.2)