Lines Matching refs:filename
177 * Generate a filename for the feed cache file. The result will be $_SERVER["SCRIPT_NAME"] with the extension changed
182 * @return string the feed cache filename
197 * @param string $filename
199 protected function _redirect($filename)
212 //header("Location: ".$filename);
214 header("Content-Type: ".$this->contentType."; charset=".$this->encoding."; filename=".basename($filename));
215 if (preg_match('/\.(kml|gpx)$/', $filename)) {
216 header("Content-Disposition: attachment; filename=".basename($filename));
218 header("Content-Disposition: inline; filename=".basename($filename));
220 readfile($filename);
232 * @param string $filename optional the filename where a recent version of the feed is saved. If not specified,
233 * the filename is $_SERVER["SCRIPT_NAME"] with the extension changed to .xml (see
238 public function useCached($filename = "", $timeout = 3600)
241 if ($filename == "") {
242 $filename = $this->_generateFilename();
244 if (file_exists($filename) AND (time() - filemtime($filename) < $timeout)) {
245 $this->_redirect($filename);
254 * @param string $filename optional the filename where a recent version of the feed is saved. If not
255 * specified, the filename is $_SERVER["SCRIPT_NAME"] with the extension changed to .xml
260 public function saveFeed($filename = "", $displayContents = true)
262 if ($filename == "") {
263 $filename = $this->_generateFilename();
265 $feedFile = fopen($filename, "w+");
270 $this->_redirect($filename);