XOOPS  2.6.0
downloader.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 */
11 
28 abstract class XoopsDownloader
29 {
30 
34  protected $mimetype;
35 
39  protected $ext;
40 
44  protected $archiver;
45 
46 
53  protected function _header($filename)
54  {
55  if (function_exists('mb_http_output')) {
56  mb_http_output('pass');
57  }
58  header('Content-Type: ' . $this->mimetype);
59  if (preg_match("/MSIE ([0-9]\.[0-9]{1,2})/", $_SERVER['HTTP_USER_AGENT'])) {
60  header('Content-Disposition: attachment; filename="' . $filename . '"');
61  header('Expires: 0');
62  header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
63  header('Pragma: public');
64  } else {
65  header('Content-Disposition: attachment; filename="' . $filename . '"');
66  header('Expires: 0');
67  header('Pragma: no-cache');
68  }
69  }
70 
77  abstract function addFile($filepath, $newfilename = null);
78 
85  abstract function addBinaryFile($filepath, $newfilename = null);
86 
94  abstract function addFileData(&$data, $filename, $time = 0);
95 
103  abstract function addBinaryFileData(&$data, $filename, $time = 0);
104 
111  abstract function download($name, $gzip = true);
112 }
addFile($filepath, $newfilename=null)
download($name, $gzip=true)
$_SERVER['REQUEST_URI']
addBinaryFileData(&$data, $filename, $time=0)
addBinaryFile($filepath, $newfilename=null)
addFileData(&$data, $filename, $time=0)
_header($filename)
Definition: downloader.php:53