1: | <?php
|
2: | |
3: | |
4: | |
5: | |
6: | |
7: | |
8: | |
9: | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | |
16: | |
17: |
|
18: |
|
19: | defined('XOOPS_ROOT_PATH') || exit('Restricted access');
|
20: |
|
21: | |
22: | |
23: | |
24: |
|
25: | class XoopsDownloader
|
26: | {
|
27: | |
28: | |
29: | |
30: |
|
31: | public $mimetype;
|
32: | public $ext;
|
33: | public $archiver;
|
34: | |
35: | |
36: |
|
37: |
|
38: | |
39: | |
40: |
|
41: |
|
42: | public function __construct()
|
43: | {
|
44: |
|
45: | }
|
46: |
|
47: | |
48: | |
49: | |
50: | |
51: | |
52: |
|
53: | public 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 (\d\.\d{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: |
|
71: | |
72: | |
73: | |
74: | |
75: | |
76: |
|
77: | public function addFile($filepath, $newfilename = null)
|
78: | {
|
79: |
|
80: | }
|
81: |
|
82: | |
83: | |
84: | |
85: | |
86: | |
87: |
|
88: | public function addBinaryFile($filepath, $newfilename = null)
|
89: | {
|
90: |
|
91: | }
|
92: |
|
93: | |
94: | |
95: | |
96: | |
97: | |
98: | |
99: |
|
100: | public function addFileData(&$data, $filename, $time = 0)
|
101: | {
|
102: |
|
103: | }
|
104: |
|
105: | |
106: | |
107: | |
108: | |
109: | |
110: | |
111: |
|
112: | public function addBinaryFileData(&$data, $filename, $time = 0)
|
113: | {
|
114: |
|
115: | }
|
116: |
|
117: | |
118: | |
119: | |
120: | |
121: | |
122: |
|
123: | public function download($name, $gzip = true)
|
124: | {
|
125: |
|
126: | }
|
127: | }
|
128: | |