arendjantetteroo / guzzle-toggl

A Toggl API client based on guzzle
MIT License
88 stars 42 forks source link

Dependance on gimler/guzzle-description-loader is too old #37

Closed PierreGranger closed 3 months ago

PierreGranger commented 2 years ago

Hello,

I'm having troubles trying to use this in a recent project, because the dependance on gimler/guzzle-description-loader is too limitative : https://github.com/gimler/guzzle-description-loader/blob/master/composer.json

    "require": {
        "php": ">=5.5.0",
        "symfony/config": "~3.0",
        "symfony/yaml": "~3.0"
    },

gimler/guzzle-description-loader has not been updated since 2015, and can cause problmes for any symfony project with config or yaml in versions upper than 3.0.

Here are the logs i'm getting :

- gimler/guzzle-description-loader v0.0.4 requires symfony/config ~3.0 -> found symfony/config[v3.0.0-BETA1, ..., 3.4.x-dev] but the package is fixed to v5.2.12 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- ajt/guzzle-toggl v1.3.0 requires gimler/guzzle-description-loader ^0.0.4 -> satisfiable by gimler/guzzle-description-loader[v0.0.4].
- Root composer.json requires ajt/guzzle-toggl ^1.3 -> satisfiable by ajt/guzzle-toggl[v1.3.0].

Some forks of gimler/guzzle-description-loader update the composer.json dependancies : https://github.com/arthurkirkosa/guzzle-description-loader https://github.com/scs-ben/guzzle-description-loader

Regards,

arendjantetteroo commented 2 years ago

@PierreGranger Hi, thanks for your comment. I think the forks you linked to have gone missing from your comment?

I'm open to a pull request that updates the composer.json file to a workable set of dependencies. I'm pretty sure that config and yaml in sf5/6 still work like they did in 3, so if there is a loader fork that supports all of them i can put it in the composer.json. As a workaround you can probably put a repository in your composer.json to replace the gimler loader package?

PierreGranger commented 2 years ago

Oops sorry, i updated the links in the initial commit.

Thanks for your reply. Tbh i don't know how can i force the use of a gimler replacer, as it's not a direct dependancy on my project ?

This one looks the most recent : arthur.kirkosa/guzzle-description-loader

but the last update may be a bit excessive :

"symfony/config": "*",
"symfony/yaml": "*"

Also he did not pushed a tagued release with the last edits on packagist.

My use of toggl API was really light (I just needed to retrieve time entries) so i've switched to a simple http call, in my case it will be enough.

Thanks for your read

arendjantetteroo commented 2 years ago

@PierreGranger thanks for the update.

jonrodsan commented 2 years ago

Hi there!

@PierreGranger, I was facing the same issue, so I install dependencies manually, including arthurkirkosa from here: https://packagist.org/packages/arthurkirkosa/guzzle-description-loader

After that, I modify the composer.lock including the data of the package, but changing the dependencies:

{
    "name": "ajt/guzzle-toggl",
    "type": "library",
    "version": "1.3.0",
    "source": {
        "type": "git",
        "url": "https://github.com/arendjantetteroo/guzzle-toggl",
        "reference": "857ed9454425b1c76980b13fd2f8d18f2b914625"
    },
    "description": "Toggl API client written on top of Guzzle PHP.",
    "keywords": ["toggl", "ajt", "api", "guzzle"],
    "homepage": "http://github.com/arendjantetteroo/guzzle-toggl",
    "license": "MIT",
    "authors": [
        {
            "name": "Arend-Jan Tetteroo",
            "homepage": "http://www.arendjantetteroo.nl"
        }
    ],
    "require": {
        "guzzlehttp/guzzle": "^7.3",
        "guzzlehttp/guzzle-services": "^1.2",
        "arthurkirkosa/guzzle-description-loader": "^0.0.7"
    },
    "autoload": {
        "psr-0": {"AJT": "src/"}
    }
}

After that just run composer install. It seems it works fine.

By the way, I was facing another issut when I try to execute $workspaces = $toggl_client->getWorkspaces(array()); it returns:

There was an error executing the GetWorkspaces command: Warning: curl_setopt_array(): Cannot represent a stream of type Output as a STDIO FILE*.

Trying thigs I discover it is caused by 'debug'=>true put in here TogglClient::factory();. Just to mention it.

Have a nice day!

arendjantetteroo commented 3 months ago

It seems this is the most recent/maintained version of the loader: https://github.com/Inveniem/guzzle-description-loader

As the old one is still on symfony 3, it might be time to upgrade to this one instead.