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 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法