Git Product home page Git Product logo

Comments (6)

harhoo avatar harhoo commented on July 20, 2024 1

OK. So it looks like Pest isn't under development any more. Possibly this package should rewrite under Guzzle, but that's obviously a bit of a pain. What I've done is fork Pest and commit a fix for that. So in your composer.json (where you is the person using this package), you'll need to explicitly include pest as a dependency, and then overwrite it with my version (and then trick StravaPHP into using a dev release). So your composer.json will be something like this

{
    "require": {
        "educoder/pest": "dev-master as 1.0",
        "basvandorst/StravaPHP": "^1.0"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/harhoo/pest.git"
        }
    ],
    "config": {
        "preferred-install": "dist"
    },
    "minimum-stability": "stable"
}

from stravaphp.

harhoo avatar harhoo commented on July 20, 2024

I think this is possibly broken under PHP 5.6 and greater.

Basically, for Curl to upload files now, you need to use curl_file_create (or new CurlFile). However, Pest doesn't recognise this as multipart, so ends up up running http_build_query on the data.

So this works for me:

$path = realpath('file.tcx');
$path = new \CurlFile($path, null, basename($path));
return $client->uploadActivity($path, 'ride', 'Morning Ride', 'A test', 0, 1, 'tcx');

IF I change line 379 of Pest.php to multipart=true. Other than that, no luck at the moment.

from stravaphp.

vredeling avatar vredeling commented on July 20, 2024

I completely agree about replacing pest with guzzle. Deserves a new issue # I think.

from stravaphp.

vredeling avatar vredeling commented on July 20, 2024

Voila: #43

from stravaphp.

vredeling avatar vredeling commented on July 20, 2024

#43 is done. We'll have to check if file uploads work as expected. @harhoo could you try this?

from stravaphp.

vredeling avatar vredeling commented on July 20, 2024

Outdated, closing

from stravaphp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.