upcloud-php-api icon indicating copy to clipboard operation
upcloud-php-api copied to clipboard

Composer package conflicts

Open rehmatworks opened this issue 6 years ago • 5 comments

Can anyone please elaborate why these packages are required in composer.json with a strict version?

doctrine/instantiator
doctrine/annotations

I see that these packages aren't being used anywhere in the code but they are resulting in conflicts while using this package with latest Laravel. If these packages are required by any dependency, then that dependency should handle these installations. Please shed some light on this issue.

rehmatworks avatar Jun 26 '19 14:06 rehmatworks

Good point, thank you! 👍

It seems to me that the original author of this library was working on using phpDocumentor (and Symfony) to generate a website for the documentation and added those dependencies. They seem unnecessary to me as well now.

We'll take a look to confirm and hopefully can remove those 😊

Darep avatar Jun 26 '19 15:06 Darep

Thank you :) That's great.

rehmatworks avatar Jun 26 '19 15:06 rehmatworks

In the meantime, if its an issue for you, you can create a fork, then in the fork create a branch named composer-fix and edit the upcloud-php-api composer.json in the fork/branch down to just:

"require": {
    "php": ">=5.5",
    "ext-curl": "*",
    "ext-json": "*",
    "ext-mbstring": "*",
    "guzzlehttp/guzzle": "^6.3"
  },

...then in your own project's composer.json file, do this to include your fork but not change all the names/etc:

"repositories":
    [
        {
            "type": "vcs",
            "url": "https://github.com/<your-account-name>/upcloud-php-api"
        }
    ],
"require": {
        /* ...your other requires... */
        "upcloudltd/upcloud-php-api": "dev-composer-fix"
    },

...and it should work fine. Use the library as documented. (And once they cut those un-needed dependencies, just revert your composer file to normal and update.)

Note that the dev- prefix in your composer file should not be part of the branch name you create...that's not a mistake. And feel free to use https://github.com/rgreer4/upcloud-php-api if you don't want to bother with the fork/edits.

wiretail avatar Aug 15 '19 05:08 wiretail

@rgreer4 Thank you. I wrote an entirely new package as I faced a lot of issues utilizing this official package.

rehmatworks avatar Aug 15 '19 17:08 rehmatworks

I created a PR for removing the packages, it worked for my tests at least: https://github.com/UpCloudLtd/upcloud-php-api/pull/22 – pretty much changes composer.json as @rgreer4 suggested here :) The composer.lock still contains a lot of doctrine and symfony requires though...

Darep avatar Aug 20 '19 11:08 Darep

Fixed in #49 and released in v2.2.0.

thevilledev avatar Jun 15 '23 06:06 thevilledev