donglang1894 2015-02-02 19:43
浏览 34
已采纳

将pear / xml_parser添加到composer.json

I'm trying to include pear/xml_serializer in my Laravel project. So, in the composer.json file I do

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

To load the repo, and then I include it in the require section like this:

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

And that works fine. The issue is that this package requires pear/xml_parser, but doing

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

Doesn't work. Neither does xml_parser2. I get this error:

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

I have to assume that means it can't find the package, but I can't figure out how to load it. I've tried several different variations of the commands above. The packages are here:

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

But only the first one can be found? Do I need to get the xml_parser from somewhere else?

Thanks for the help.

  • 写回答

1条回答 默认 最新

  • dotxxh0998 2015-02-02 19:55
    关注

    Please give this a try:

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

    Results in:

     ...
      - Installing pear-pear.php.net/xml_parser (1.3.4)
      - Installing pear-pear.php.net/xml_serializer (0.20.2)
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算