Merge pull request #186 from madmatt/pulls/fix-configure

FIX: coreIsActive() failed when using a namespaced core
This commit is contained in:
Robbie Averill 2017-12-05 14:33:36 +13:00 committed by GitHub
commit 44f7bc02fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);
}
/**