/** * Central method for making a get operation against this Solr Server * * @param string $url * @param bool|float $timeout Read timeout in seconds * @return Apache_Solr_Response */ protected function _sendRawGet($url, $timeout = FALSE) { try { $response = parent::_sendRawGet($url, $timeout); } catch (Apache_Solr_HttpTransportException $e) { $response = $e->getResponse(); } if (Mage::getStoreConfig('log/query/rawGet')) { $logData = array('query url' => $url, 'response' => (array) $response); if (!empty($e)) { $logData['exception'] = $e->__toString(); } else { // trigger data parsing $response->response; $logData['response data'] = print_r($response, TRUE); } Mage::helper('solr')->getLogger()->debug('Querying Solr using GET', $logData); } return $response; }
/** * Central method for making a get operation against this Solr Server * * @param string $url * @param float $timeout Read timeout in seconds * @return Apache_Solr_Response * * @throws Exception If a non 200 response status is returned */ protected function _sendRawGet($url, $timeout = FALSE) { stream_context_set_option($this->_getContext, 'http', 'header', "Authorization: Basic " . base64_encode($this->getUserLogin() . ':' . $this->getPassword())); return parent::_sendRawGet($url, $timeout); }
/** * Central method for making a get operation against this Solr Server * * @param string $url * @param float|boolean $timeout Read timeout in seconds * @return \Apache_Solr_Response */ protected function _sendRawGet($url, $timeout = false) { $logSeverity = 0; // info try { $response = parent::_sendRawGet($url, $timeout); } catch (\Apache_Solr_HttpTransportException $e) { $logSeverity = 3; // fatal error $response = $e->getResponse(); } if ($this->configuration->getLoggingQueryRawGet() || $response->getHttpStatus() != 200) { $logData = array('query url' => $url, 'response' => (array) $response); if (!empty($e)) { $logData['exception'] = $e->__toString(); } else { // trigger data parsing $response->response; $logData['response data'] = print_r($response, true); } GeneralUtility::devLog('Querying Solr using GET', 'solr', $logSeverity, $logData); } return $response; }
/** * Executes Solr url command * **@param String $url Solr command * @return void * @access public */ public function executeUrl($url, $timeout = 6000) { //write request to log file $this->log("solr request: {$url}", LOG_DEBUG); try { $service = new Apache_Solr_Service(); $response = $service->_sendRawGet($url, $timeout); $response = serialize($response); //write response to log file $this->log("solr response: {$response}", LOG_DEBUG); } catch (Exception $e) { throw new Exception($e); } }
/** * Central method for making a get operation against this Solr Server * * @param string $url * @param float|boolean $timeout Read timeout in seconds * @return \Apache_Solr_Response */ protected function _sendRawGet($url, $timeout = FALSE) { $logSeverity = 0; // info try { $response = parent::_sendRawGet($url, $timeout); } catch (\Apache_Solr_HttpTransportException $e) { $logSeverity = 3; // fatal error $response = $e->getResponse(); } if ($GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['logging.']['query.']['rawGet'] || $response->getHttpStatus() != 200) { $logData = array('query url' => $url, 'response' => (array) $response); if (!empty($e)) { $logData['exception'] = $e->__toString(); } else { // trigger data parsing $response->response; $logData['response data'] = print_r($response, TRUE); } GeneralUtility::devLog('Querying Solr using GET', 'solr', $logSeverity, $logData); } return $response; }
/** * Central method for making a get operation against this Solr Server * * @param string $url * @param float $timeout Read timeout in seconds * @return Apache_Solr_Response */ protected function _sendRawGet($url, $timeout = FALSE) { $logSeverity = 0; // info try { $response = parent::_sendRawGet($url, $timeout); } catch (Apache_Solr_HttpTransportException $e) { $logSeverity = 3; // fatal error } if ($GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['logging.']['query.']['rawGet']) { t3lib_div::devLog('Querying Solr using GET', 'tx_solr', $logSeverity, array('query url' => $url, 'raw response' => (array) $response)); } return $response; }