Skip to content

Commit

Permalink
Merge pull request #186 from madmatt/pulls/fix-configure
Browse files Browse the repository at this point in the history
FIX: coreIsActive() failed when using a namespaced core
  • Loading branch information
robbieaverill committed Dec 5, 2017
2 parents ceff657 + 7bacda9 commit 44f7bc0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Solr/Services/SolrService.php
Expand Up @@ -36,8 +36,14 @@ protected function coreCommand($command, $core, $params = array())
*/
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);
}

/**
Expand Down

0 comments on commit 44f7bc0

Please sign in to comment.