protected function gapi::httpRequest in Google Analytics Statistics 7
Same name and namespace in other branches
- 7.x inc/gapi.class.php \gapi::httpRequest()
Perform http request
Parameters
Array $get_variables:
Array $post_variables:
Array $headers:
3 calls to gapi::httpRequest()
- gapi::authenticateUser in includes/
gapi.class.php - Authenticate Google Account with Google
- gapi::requestAccountData in includes/
gapi.class.php - Request account data from Google Analytics
- gapi::requestReportData in includes/
gapi.class.php - Request report data from Google Analytics
File
- includes/
gapi.class.php, line 455
Class
- gapi
- GAPI - Google Analytics PHP Interface
Code
protected function httpRequest($url, $get_variables = null, $post_variables = null, $headers = null) {
$interface = gapi::http_interface;
if (gapi::http_interface == 'auto') {
if (function_exists('curl_exec')) {
$interface = 'curl';
}
else {
$interface = 'fopen';
}
}
if ($interface == 'curl') {
return $this
->curlRequest($url, $get_variables, $post_variables, $headers);
}
elseif ($interface == 'fopen') {
return $this
->fopenRequest($url, $get_variables, $post_variables, $headers);
}
else {
throw new Exception('Invalid http interface defined. No such interface "' . gapi::http_interface . '"');
}
}