J7mbo / twitter-api-php

The simplest PHP Wrapper for Twitter API v1.1 calls
MIT License
1.82k stars 800 forks source link

Suggestion for localhost environment #173

Closed Antibioticvz closed 8 years ago

Antibioticvz commented 8 years ago

I have to add (Line 298)

curl_setopt($feed, CURLOPT_CAINFO, "B:/Bitnami/wordpress/php/cacert.pem");

to make it work on my localhost but I'm sure it should be a better solution... Looking for an advice how to improve my own code to prevent this kind of issue.

J7mbo commented 8 years ago

You need to set up cURL properly on your machine so it knows where to find your pem. I think you can do this via command line calls.

However, if you look at the method signature of performRequest(), you'll see you can pass a second parameter which is an array of cURL parameters.

You would call:

performRequest(true, ['CURLOPT_CAINFO' => "B:/Bitnami/wordpress/php/cacert.pem"]);
Antibioticvz commented 8 years ago

Thanks for that! Is it a good practice to provide cacert.pem file in my plugin project ? Just in case that someone wanna use it on localhost.

J7mbo commented 8 years ago

Hi, this is an old one. I'm just going through and cleaning up issues, although if you still need help, please feel free to reopen a new issue. Thanks.