Comments (6)
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.
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.
I completely agree about replacing pest with guzzle. Deserves a new issue # I think.
from stravaphp.
Voila: #43
from stravaphp.
#43 is done. We'll have to check if file uploads work as expected. @harhoo could you try this?
from stravaphp.
Outdated, closing
from stravaphp.
Related Issues (20)
- Refresh Tokens Update HOT 2
- Integration with Laravel project
- Handling Strava's conversion to oauth2 HOT 11
- Is this repo still maintained? HOT 6
- getAthleteActivities is buggy when using parameters
- getResponse doesn't throw, it already catches HOT 3
- PHPUnit tests fail when running locally HOT 2
- Laravel 8 incompatibility HOT 6
- Can you do a point release? HOT 5
- Where is autoload.php HOT 2
- Upload gpx file failed HOT 1
- Wrong scopes in README.md code examples HOT 1
- Library Compatibility HOT 11
- GitHub Link Broken HOT 3
- Scrutinizer HOT 3
- Setup Packagist for automatic updates HOT 9
- Webhook Subscriptions HOT 2
- Fix tests after type hints HOT 1
- getSegmentLeaderboard not working HOT 5
- Having trouble getting OAuth2 to work and missing refresh token HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stravaphp.