Skip to content

Commit

Permalink
Updated the google_oauth library to allow debug information to be wri…
Browse files Browse the repository at this point in the history
…tten to the log. Also changed the way the curl header was being set because it was not being set correctly, though it didn't seem to cause an issue.
  • Loading branch information
Jim committed Dec 8, 2011
1 parent d1df6c2 commit 1214c5f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion libraries/google_oauth.php
Expand Up @@ -44,6 +44,9 @@ class google_oauth
//google service you are authenticating against.
const SCOPE = 'https://gdata.youtube.com'; //YouTube

//Set this flag to true for detailed logging.
const DEBUG = false;

//Array that should contain the consumer secret and
//key which should be passed into the constructor.
private $_consumer = false;
Expand Down Expand Up @@ -162,9 +165,16 @@ private function _connect($url, $auth)
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array($auth));
curl_setopt($ch, CURLOPT_HTTPHEADER, explode("\r\n", $auth));
curl_setopt($ch, CURLINFO_HEADER_OUT, true);

$response = curl_exec($ch);

if(self::DEBUG)
{
error_log(print_r(curl_getinfo($ch), true));
error_log($response);
}
curl_close($ch);
return $response;
}
Expand Down

0 comments on commit 1214c5f

Please sign in to comment.