public function getStatus()
    {
        $reports = [];
            /** @var $connectionManager ConnectionManager */
        $connectionManager = GeneralUtility::makeInstance(ConnectionManager::class);
        $solrConnections = $connectionManager->getAllConnections();

        foreach ($solrConnections as $solrConnection) {
            $adminService = $solrConnection->getAdminService();
            /** @var $solrConnection SolrConnection */
            if (!$adminService->ping()) {
                $url = $adminService->__toString();
                $pingFailedMsg = 'Could not ping solr server, can not check version ' . (string)$url;
                $status = GeneralUtility::makeInstance(
                    Status::class,
                    /** @scrutinizer ignore-type */ 'Apache Solr Version',
                    /** @scrutinizer ignore-type */ 'Not accessible',
                    /** @scrutinizer ignore-type */ $pingFailedMsg,
                    /** @scrutinizer ignore-type */ Status::ERROR
                );
                $reports[] = $status;
                continue;
            }

            $isWrongSchema = $adminService->getSchema()->getName() != self::RECOMMENDED_SCHEMA_VERSION;
            if ($isWrongSchema) {
                $variables = ['solr' => $adminService, 'recommendedVersion' => self::RECOMMENDED_SCHEMA_VERSION];
                $report = $this->getRenderedReport('SchemaStatus.html', $variables);
                $status = GeneralUtility::makeInstance(
                    Status::class,
                    /** @scrutinizer ignore-type */ 'Schema Version',
                    /** @scrutinizer ignore-type */ 'Unsupported Schema',
                    /** @scrutinizer ignore-type */ $report,
                    /** @scrutinizer ignore-type */ Status::WARNING
                );
                $reports[] = $status;
            }
        }

        return $reports;
    }
public function getStatus()
    {
        $reports = [];
            /** @var $connectionManager ConnectionManager */
        $connectionManager = GeneralUtility::makeInstance(ConnectionManager::class);
        $solrConnections = $connectionManager->getAllConnections();

        foreach ($solrConnections as $solrConnection) {
            $adminService = $solrConnection->getAdminService();
            /** @var $solrConnection SolrConnection */
            if (!$adminService->ping()) {
                $url = $adminService->__toString();
                $pingFailedMsg = 'Could not ping solr server, can not check version ' . (string)$url;
                $status = GeneralUtility::makeInstance(
                    Status::class,
                    /** @scrutinizer ignore-type */ 'Apache Solr Version',
                    /** @scrutinizer ignore-type */ 'Not accessible',
                    /** @scrutinizer ignore-type */ $pingFailedMsg,
                    /** @scrutinizer ignore-type */ Status::ERROR
                );
                $reports[] = $status;
                continue;
            }

            $isWrongSchema = $adminService->getSchema()->getName() != self::RECOMMENDED_SCHEMA_VERSION;
            if ($isWrongSchema) {
                $variables = ['solr' => $adminService, 'recommendedVersion' => self::RECOMMENDED_SCHEMA_VERSION];
                $report = $this->getRenderedReport('SchemaStatus.html', $variables);
                $status = GeneralUtility::makeInstance(
                    Status::class,
                    /** @scrutinizer ignore-type */ 'Schema Version',
                    /** @scrutinizer ignore-type */ 'Unsupported Schema',
                    /** @scrutinizer ignore-type */ $report,
                    /** @scrutinizer ignore-type */ Status::WARNING
                );
                $reports[] = $status;
            }
        }

        return $reports;
    }
public function getStatus ( ) { $ reports = [ ] ; /** @var $connectionManager ConnectionManager */ $ connectionManager = GeneralUtility :: makeInstance ( ConnectionManager :: class ) ; $ solrConnections = $ connectionManager -> getAllConnections ( ) ; foreach ( $ solrConnections as $ solrConnection ) { $ adminService = $ solrConnection -> getAdminService ( ) ; /** @var $solrConnection SolrConnection */ if ( ! $ adminService -> ping ( ) ) { $ url = $ adminService -> __toString ( ) ; $ pingFailedMsg = 'Could not ping solr server, can not check version ' . ( string ) $ url ; $ status = GeneralUtility :: makeInstance ( Status :: class , /** @scrutinizer ignore-type */ 'Apache Solr Version' , /** @scrutinizer ignore-type */ 'Not accessible' , /** @scrutinizer ignore-type */ $ pingFailedMsg , /** @scrutinizer ignore-type */ Status :: ERROR ) ; $ reports [ ] = $ status ; continue ; } $ isWrongSchema = $ adminService -> getSchema ( ) -> getName ( ) != self :: RECOMMENDED_SCHEMA_VERSION ; if ( $ isWrongSchema ) { $ variables = [ 'solr' => $ adminService , 'recommendedVersion' => self :: RECOMMENDED_SCHEMA_VERSION ] ; $ report = $ this -> getRenderedReport ( 'SchemaStatus.html' , $ variables ) ; $ status = GeneralUtility :: makeInstance ( Status :: class , /** @scrutinizer ignore-type */ 'Schema Version' , /** @scrutinizer ignore-type */ 'Unsupported Schema' , /** @scrutinizer ignore-type */ $ report , /** @scrutinizer ignore-type */ Status :: WARNING ) ; $ reports [ ] = $ status ; } } return $ reports ; }
Compiles a collection of schema version checks against each configured
Solr server. Only adds an entry if a schema other than the
recommended one was found.
Compiles a collection of schema version checks against each configured Solr server . Only adds an entry if a schema other than the recommended one was found .