public function getFeed($targetHandle)
    {
        if ($this->config->isRealTime()) {
            $this->generateFeed($targetHandle);
            return $this;
        }

        $feedFile = $this->config->getDefaultFeedFile();
        if (file_exists($feedFile)) {
            $sourceHandle = @fopen($feedFile, 'rb');
            if (!$sourceHandle) {
                $this->log->throwException(new FeedException(sprintf('Could not open feed path "%s" for reading', $feedFile)));
            }

            while (!feof($sourceHandle)) {
                fwrite($targetHandle, fread($sourceHandle, self::FEED_COPY_BUFFER_SIZE));
            }
            fclose($sourceHandle);
        } else {
            $this->generateToFile($feedFile, $this->config->isValidate());
            $this->getFeed($targetHandle);
        }

        return $this;
    }
public function getFeed($targetHandle)
    {
        if ($this->config->isRealTime()) {
            $this->generateFeed($targetHandle);
            return $this;
        }

        $feedFile = $this->config->getDefaultFeedFile();
        if (file_exists($feedFile)) {
            $sourceHandle = @fopen($feedFile, 'rb');
            if (!$sourceHandle) {
                $this->log->throwException(new FeedException(sprintf('Could not open feed path "%s" for reading', $feedFile)));
            }

            while (!feof($sourceHandle)) {
                fwrite($targetHandle, fread($sourceHandle, self::FEED_COPY_BUFFER_SIZE));
            }
            fclose($sourceHandle);
        } else {
            $this->generateToFile($feedFile, $this->config->isValidate());
            $this->getFeed($targetHandle);
        }

        return $this;
    }
public function getFeed ( $ targetHandle ) { if ( $ this -> config -> isRealTime ( ) ) { $ this -> generateFeed ( $ targetHandle ) ; return $ this ; } $ feedFile = $ this -> config -> getDefaultFeedFile ( ) ; if ( file_exists ( $ feedFile ) ) { $ sourceHandle = @ fopen ( $ feedFile , 'rb' ) ; if ( ! $ sourceHandle ) { $ this -> log -> throwException ( new FeedException ( sprintf ( 'Could not open feed path "%s" for reading' , $ feedFile ) ) ) ; } while ( ! feof ( $ sourceHandle ) ) { fwrite ( $ targetHandle , fread ( $ sourceHandle , self :: FEED_COPY_BUFFER_SIZE ) ) ; } fclose ( $ sourceHandle ) ; } else { $ this -> generateToFile ( $ feedFile , $ this -> config -> isValidate ( ) ) ; $ this -> getFeed ( $ targetHandle ) ; } return $ this ; }
Get latest generated feed and write to resource or create new if real time is enabled.

@param resource $targetHandle
@return $this
@throws FeedException
Get latest generated feed and write to resource or create new if real time is enabled .