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

FeedCreator::saveFeed ( filename = "",
displayContents = true 
) [inherited]

Saves this feed as a file on the local disk. After the file is saved, a redirect header may be sent to redirect the user to the newly created file.

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()).
redirect boolean optional send an HTTP redirect header or not. If true, the user will be automatically redirected to the created file.

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

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

                                                           {
        if ($filename=="") {
            $filename = $this->_generateFilename();
        }
        $feedFile = fopen($filename, "w+");
        if ($feedFile) {
            fputs($feedFile,$this->createFeed());
            fclose($feedFile);
            if ($displayContents) {
                $this->_redirect($filename);
            }
        } else {
            echo "<br /><b>Error creating feed file, please check write permissions.</b><br />";
        }
    }


Generated by  Doxygen 1.6.0   Back to index