public function getAvailableSites($stopOnInvalidSite = false)
    {
        $sites = [];
        $cacheId = 'SiteRepository' . '_' . 'getAvailableSites';

        $methodResult = $this->runtimeCache->get($cacheId);
        if (!empty($methodResult)) {
            return $methodResult;
        }

        $servers = $this->getSolrServersFromRegistry();
        foreach ($servers as $server) {
            if (isset($sites[$server['rootPageUid']])) {
                //get each site only once
                continue;
            }

            try {
                $sites[$server['rootPageUid']] = $this->buildSite($server['rootPageUid']);
            } catch (\InvalidArgumentException $e) {
                if ($stopOnInvalidSite) {
                    throw $e;
                }
            }
        }

        $methodResult = $sites;
        $this->runtimeCache->set($cacheId, $methodResult);

        return $methodResult;
    }
public function getAvailableSites($stopOnInvalidSite = false)
    {
        $sites = [];
        $cacheId = 'SiteRepository' . '_' . 'getAvailableSites';

        $methodResult = $this->runtimeCache->get($cacheId);
        if (!empty($methodResult)) {
            return $methodResult;
        }

        $servers = $this->getSolrServersFromRegistry();
        foreach ($servers as $server) {
            if (isset($sites[$server['rootPageUid']])) {
                //get each site only once
                continue;
            }

            try {
                $sites[$server['rootPageUid']] = $this->buildSite($server['rootPageUid']);
            } catch (\InvalidArgumentException $e) {
                if ($stopOnInvalidSite) {
                    throw $e;
                }
            }
        }

        $methodResult = $sites;
        $this->runtimeCache->set($cacheId, $methodResult);

        return $methodResult;
    }
public function getAvailableSites ( $ stopOnInvalidSite = false ) { $ sites = [ ] ; $ cacheId = 'SiteRepository' . '_' . 'getAvailableSites' ; $ methodResult = $ this -> runtimeCache -> get ( $ cacheId ) ; if ( ! empty ( $ methodResult ) ) { return $ methodResult ; } $ servers = $ this -> getSolrServersFromRegistry ( ) ; foreach ( $ servers as $ server ) { if ( isset ( $ sites [ $ server [ 'rootPageUid' ] ] ) ) { //get each site only once continue ; } try { $ sites [ $ server [ 'rootPageUid' ] ] = $ this -> buildSite ( $ server [ 'rootPageUid' ] ) ; } catch ( \ InvalidArgumentException $ e ) { if ( $ stopOnInvalidSite ) { throw $ e ; } } } $ methodResult = $ sites ; $ this -> runtimeCache -> set ( $ cacheId , $ methodResult ) ; return $ methodResult ; }
Gets all available TYPO3 sites with Solr configured.

@param bool $stopOnInvalidSite
@return Site[] An array of available sites
Gets all available TYPO3 sites with Solr configured .