Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allowing user agent to be overridden and actually using it in the req…

…uest.

Closes gh-12
  • Loading branch information...
commit f0801e04f55e890a360c70bfeb12191429b7ae1e 1 parent 5ef22ea
@jmathai authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 EpiFoursquare.php
View
6 EpiFoursquare.php
@@ -51,6 +51,11 @@ public function setTimeout($requestTimeout = null, $connectionTimeout = null)
$this->connectionTimeout = floatval($connectionTimeout);
}
+ public function setUserAgent($agent)
+ {
+ $this->userAgent = $agent;
+ }
+
public function useApiVersion($version = null)
{
$this->apiVersion = $version;
@@ -112,6 +117,7 @@ private function request($method, $endpoint, $params = null)
if($method === 'GET')
$url .= is_null($params) ? '' : '?'.http_build_query($params, '', '&');
$ch = curl_init($url);
+ curl_setopt($ch, CURLOPT_USERAGENT, $this->userAgent);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, $this->requestTimeout);

6 comments on commit f0801e0

@boinggg

how do i know when a commit is closed or not?

@jmathai
Owner

Sorry, what I meant to say was that the changes are available once the issue is closed. If you see it here on Github (like the above diff) then it means downloading master will get you those changes. So if you download now you should be good to go.

In the issue I'll either explicitly say it's been fixed or one of the messages will have something like "Closes gh-XX" where XX is the issue number. You can also see what the status of an issue is by looking at the right hand side tabs (Open/Closed).

@boinggg

so commits are instantly avail in master dl?

@jmathai
Owner

I usually push right after I make a change, so yea.

@alykhan

Does this project use the same EpiOAuth.php as the twitter project? I noticed that its missing from the download.

@jmathai
Owner
Please sign in to comment.
Something went wrong with that request. Please try again.