protected function indexItem(Item $item, TypoScriptConfiguration $configuration)
    {
        $indexer = $this->getIndexerByItem($item->getIndexingConfigurationName(), $configuration);

        // Remember original http host value
        $originalHttpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : null;

        $itemChangedDate = $item->getChanged();
        $itemChangedDateAfterIndex = 0;

        try {
            $this->initializeHttpServerEnvironment($item);
            $itemIndexed = $indexer->index($item);

            // update IQ item so that the IQ can determine what's been indexed already
            if ($itemIndexed) {
                $this->indexQueue->updateIndexTimeByItem($item);
                $itemChangedDateAfterIndex = $item->getChanged();
            }

            if ($itemChangedDateAfterIndex > $itemChangedDate && $itemChangedDateAfterIndex > time()) {
                $this->indexQueue->setForcedChangeTimeByItem($item, $itemChangedDateAfterIndex);
            }
        } catch (\Exception $e) {
            $this->restoreOriginalHttpHost($originalHttpHost);
            throw $e;
        }

        $this->restoreOriginalHttpHost($originalHttpHost);

        return $itemIndexed;
    }
protected function indexItem(Item $item, TypoScriptConfiguration $configuration)
    {
        $indexer = $this->getIndexerByItem($item->getIndexingConfigurationName(), $configuration);

        // Remember original http host value
        $originalHttpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : null;

        $itemChangedDate = $item->getChanged();
        $itemChangedDateAfterIndex = 0;

        try {
            $this->initializeHttpServerEnvironment($item);
            $itemIndexed = $indexer->index($item);

            // update IQ item so that the IQ can determine what's been indexed already
            if ($itemIndexed) {
                $this->indexQueue->updateIndexTimeByItem($item);
                $itemChangedDateAfterIndex = $item->getChanged();
            }

            if ($itemChangedDateAfterIndex > $itemChangedDate && $itemChangedDateAfterIndex > time()) {
                $this->indexQueue->setForcedChangeTimeByItem($item, $itemChangedDateAfterIndex);
            }
        } catch (\Exception $e) {
            $this->restoreOriginalHttpHost($originalHttpHost);
            throw $e;
        }

        $this->restoreOriginalHttpHost($originalHttpHost);

        return $itemIndexed;
    }
protected function indexItem ( Item $ item , TypoScriptConfiguration $ configuration ) { $ indexer = $ this -> getIndexerByItem ( $ item -> getIndexingConfigurationName ( ) , $ configuration ) ; // Remember original http host value $ originalHttpHost = isset ( $ _SERVER [ 'HTTP_HOST' ] ) ? $ _SERVER [ 'HTTP_HOST' ] : null ; $ itemChangedDate = $ item -> getChanged ( ) ; $ itemChangedDateAfterIndex = 0 ; try { $ this -> initializeHttpServerEnvironment ( $ item ) ; $ itemIndexed = $ indexer -> index ( $ item ) ; // update IQ item so that the IQ can determine what's been indexed already if ( $ itemIndexed ) { $ this -> indexQueue -> updateIndexTimeByItem ( $ item ) ; $ itemChangedDateAfterIndex = $ item -> getChanged ( ) ; } if ( $ itemChangedDateAfterIndex > $ itemChangedDate && $ itemChangedDateAfterIndex > time ( ) ) { $ this -> indexQueue -> setForcedChangeTimeByItem ( $ item , $ itemChangedDateAfterIndex ) ; } } catch ( \ Exception $ e ) { $ this -> restoreOriginalHttpHost ( $ originalHttpHost ) ; throw $ e ; } $ this -> restoreOriginalHttpHost ( $ originalHttpHost ) ; return $ itemIndexed ; }
Indexes an item from the Index Queue.

@param Item $item An index queue item to index
@param TypoScriptConfiguration $configuration
@return bool TRUE if the item was successfully indexed, FALSE otherwise
Indexes an item from the Index Queue .