Search code examples
phpcomposer-phppear

Add pear/xml_parser to compser.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.


Solution

  • 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)