mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 12:05:29 +00:00
FIX: coreIsActive() failed when using a namespaced core
This commit is contained in:
parent
ceff657c62
commit
7bacda9a0f
@ -36,8 +36,14 @@ class SolrService extends SolrService_Core
|
||||
*/
|
||||
public function coreIsActive($core)
|
||||
{
|
||||
// Request the status of the full core name
|
||||
$result = $this->coreCommand('STATUS', $core);
|
||||
return isset($result->status->$core->uptime);
|
||||
|
||||
// Solr returns the core as the 'short name' of the class (e.g. Mysite\Search\SolrIndex -> SolrIndex)
|
||||
$reflection = new \ReflectionClass($core);
|
||||
$shortClass = $reflection->getShortName();
|
||||
|
||||
return isset($result->status->$shortClass->uptime);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user