FIX: coreIsActive() failed when using a namespaced core

This commit is contained in:
Matt Peel 2017-12-05 13:38:35 +13:00
parent ceff657c62
commit 7bacda9a0f
No known key found for this signature in database
GPG Key ID: 37216222E10987D1
1 changed files with 7 additions and 1 deletions

View File

@ -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);
}
/**