public function GoogleMini::query in Google Search Appliance 6.2
Same name and namespace in other branches
- 5 GoogleMini.php \GoogleMini::query()
1 call to GoogleMini::query()
- DrupalGoogleMini::query in ./DrupalGoogleMini.php
1 method overrides GoogleMini::query()
- DrupalGoogleMini::query in ./DrupalGoogleMini.php
File
- ./GoogleMini.php, line 296
Class
- GoogleMini
Code
public function query($iteratorClass = 'GoogleMiniResultIterator') {
$query = $this
->buildQuery();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $query);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
if ($timeout = variable_get('google_appliance_timeout', FALSE)) {
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
}
$resultXML = curl_exec($ch);
if ($this->debug) {
$this
->log('Made cURL request to ' . $query);
}
if (!$resultXML) {
if ($this->debug) {
$this
->log('cURL error #' . curl_errno($ch) . ': ' . curl_error($ch));
}
throw new GoogleMiniResultException('There was a cURL error while connecting with the Google device.');
return FALSE;
}
return self::resultFactory($resultXML, $iteratorClass);
}