protected function getConnectionStatus(array $solrConnection)
    {
        $header = 'Your site has contacted the Apache Solr server.';
        $this->responseStatus = Status::OK;

        $solrAdmin = $this->connectionManager
            ->getSolrConnectionForNodes($solrConnection['read'], $solrConnection['write'])
            ->getAdminService();

        $solrVersion = $this->checkSolrVersion($solrAdmin);
        $accessFilter = $this->checkAccessFilter($solrAdmin);
        $pingTime = $this->checkPingTime($solrAdmin);
        $configName = $this->checkSolrConfigName($solrAdmin);
        $schemaName = $this->checkSolrSchemaName($solrAdmin);

        if ($this->responseStatus !== Status::OK) {
            $header = 'Failed contacting the Solr server.';
        }

        $variables = [
            'header' => $header,
            'connection' => $solrConnection,
            'solr' => $solrAdmin,
            'solrVersion' => $solrVersion,
            'pingTime' => $pingTime,
            'configName' => $configName,
            'schemaName' => $schemaName,
            'accessFilter' => $accessFilter
        ];

        $report = $this->getRenderedReport('SolrStatus.html', $variables);
        return GeneralUtility::makeInstance(
            Status::class,
            /** @scrutinizer ignore-type */ 'Apache Solr',
            /** @scrutinizer ignore-type */ '',
            /** @scrutinizer ignore-type */ $report,
            /** @scrutinizer ignore-type */ $this->responseStatus
        );
    }
protected function getConnectionStatus(array $solrConnection)
    {
        $header = 'Your site has contacted the Apache Solr server.';
        $this->responseStatus = Status::OK;

        $solrAdmin = $this->connectionManager
            ->getSolrConnectionForNodes($solrConnection['read'], $solrConnection['write'])
            ->getAdminService();

        $solrVersion = $this->checkSolrVersion($solrAdmin);
        $accessFilter = $this->checkAccessFilter($solrAdmin);
        $pingTime = $this->checkPingTime($solrAdmin);
        $configName = $this->checkSolrConfigName($solrAdmin);
        $schemaName = $this->checkSolrSchemaName($solrAdmin);

        if ($this->responseStatus !== Status::OK) {
            $header = 'Failed contacting the Solr server.';
        }

        $variables = [
            'header' => $header,
            'connection' => $solrConnection,
            'solr' => $solrAdmin,
            'solrVersion' => $solrVersion,
            'pingTime' => $pingTime,
            'configName' => $configName,
            'schemaName' => $schemaName,
            'accessFilter' => $accessFilter
        ];

        $report = $this->getRenderedReport('SolrStatus.html', $variables);
        return GeneralUtility::makeInstance(
            Status::class,
            /** @scrutinizer ignore-type */ 'Apache Solr',
            /** @scrutinizer ignore-type */ '',
            /** @scrutinizer ignore-type */ $report,
            /** @scrutinizer ignore-type */ $this->responseStatus
        );
    }
protected function getConnectionStatus ( array $ solrConnection ) { $ header = 'Your site has contacted the Apache Solr server.' ; $ this -> responseStatus = Status :: OK ; $ solrAdmin = $ this -> connectionManager -> getSolrConnectionForNodes ( $ solrConnection [ 'read' ] , $ solrConnection [ 'write' ] ) -> getAdminService ( ) ; $ solrVersion = $ this -> checkSolrVersion ( $ solrAdmin ) ; $ accessFilter = $ this -> checkAccessFilter ( $ solrAdmin ) ; $ pingTime = $ this -> checkPingTime ( $ solrAdmin ) ; $ configName = $ this -> checkSolrConfigName ( $ solrAdmin ) ; $ schemaName = $ this -> checkSolrSchemaName ( $ solrAdmin ) ; if ( $ this -> responseStatus !== Status :: OK ) { $ header = 'Failed contacting the Solr server.' ; } $ variables = [ 'header' => $ header , 'connection' => $ solrConnection , 'solr' => $ solrAdmin , 'solrVersion' => $ solrVersion , 'pingTime' => $ pingTime , 'configName' => $ configName , 'schemaName' => $ schemaName , 'accessFilter' => $ accessFilter ] ; $ report = $ this -> getRenderedReport ( 'SolrStatus.html' , $ variables ) ; return GeneralUtility :: makeInstance ( Status :: class , /** @scrutinizer ignore-type */ 'Apache Solr' , /** @scrutinizer ignore-type */ '' , /** @scrutinizer ignore-type */ $ report , /** @scrutinizer ignore-type */ $ this -> responseStatus ) ; }
Checks whether a Solr server is available and provides some information.

@param array $solrConnection Solr connection parameters
@return Status Status of the Solr connection
Checks whether a Solr server is available and provides some information .