Logo Search packages:      
Sourcecode: websvn version File versions  Download package

FeedCreator::useCached ( filename = "",
timeout = 3600 
) [inherited]

Turns on caching and checks if there is a recent version of this feed in the cache. If there is, an HTTP redirect header is sent. To effectively use caching, you should create the FeedCreator object and call this method before anything else, especially before you do the time consuming task to build the feed (web fetching, for example).

Since:
1.4
Parameters:
filename string optional the filename where a recent version of the feed is saved. If not specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()).
timeout int optional the timeout in seconds before a cached version is refreshed (defaults to 3600 = 1 hour)

Definition at line 489 of file feedcreator.class.php.

References FeedCreator::_generateFilename(), and FeedCreator::_redirect().

                                                    {
        $this->_timeout = $timeout;
        if ($filename=="") {
            $filename = $this->_generateFilename();
        }
        if (file_exists($filename) AND (time()-filemtime($filename) < $timeout)) {
            $this->_redirect($filename);
        }
    }


Generated by  Doxygen 1.6.0   Back to index