Skip to content
Browse files

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


Closes gh-12
  • Loading branch information...
1 parent 5ef22ea commit f0801e04f55e890a360c70bfeb12191429b7ae1e @jmathai committed Feb 25, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 EpiFoursquare.php
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


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


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).


so commits are instantly avail in master dl?


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


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

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