private function isSolrRunning() { // ping solr, to find out if it is (already) running $ini = eZINI::instance('solr.ini'); $url = $ini->variable('SolrBase', 'SearchServerURI'); $solrBase = new eZSolrBase($url); $pingResult = $solrBase->ping(); return isset($pingResult['status']) && $pingResult['status'] === 'OK'; }
/** * Tells whether $coreUrl allows to reach a running Solr. * If $coreUrl is false, the default Solr Url from solr.ini is used * * @param mixed $coreUrl * @return bool */ protected function isSolrRunning($coreUrl = false) { $solrBase = new eZSolrBase($coreUrl); $pingResult = $solrBase->ping(); return isset($pingResult['status']) && $pingResult['status'] === 'OK'; }
if (is_object($doc)) { if (is_object($doc->Doc)) { $doc->Doc->formatOutput = true; $xml[] = $doc->Doc->saveXML($doc->RootElement); } else { $dom = new DOMDocument(); $dom->preserveWhiteSpace = FALSE; $dom->loadXML($doc->docToXML()); $dom->formatOutput = TRUE; $xml[] = $dom->saveXML($dom->documentElement); } } } $solrBase = new eZSolrBase(); $version = json_decode(eZHTTPTool::getDataByURL($solrBase->SearchServerURI . '/admin/system/?wt=json'), true); $solr = array('ping' => trim(print_r($solrBase->ping(), 1)), 'version' => trim(print_r($version, 1))); } else { $error = "Current user can not read object {$objectID}"; } } else { $error = "Object {$objectID} not found"; } } $tpl->setVariable('error', $error); $tpl->setVariable('info', $info); $tpl->setVariable('detail', $detail); $tpl->setVariable('xml', $xml); $tpl->setVariable('solr', $solr); echo $tpl->fetch('design:index/object.tpl'); eZDisplayDebug(); eZExecution::cleanExit();