Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | /** |
3 | * Pop PHP Framework (http://www.popphp.org/) |
4 | * |
5 | * @link https://github.com/popphp/popphp-framework |
6 | * @author Nick Sagona, III <dev@nolainteractive.com> |
7 | * @copyright Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com) |
8 | * @license http://www.popphp.org/license New BSD License |
9 | */ |
10 | |
11 | /** |
12 | * @namespace |
13 | */ |
14 | namespace Pop\Storage; |
15 | |
16 | use Pop\Http\Server\Upload; |
17 | |
18 | /** |
19 | * Storage adapter interface |
20 | * |
21 | * @category Pop |
22 | * @package Pop\Storage |
23 | * @author Nick Sagona, III <dev@nolainteractive.com> |
24 | * @copyright Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com) |
25 | * @license http://www.popphp.org/license New BSD License |
26 | * @version 1.0.1 |
27 | */ |
28 | interface AdapterInterface |
29 | { |
30 | |
31 | /** |
32 | * Is storage local |
33 | * |
34 | * @return boolean |
35 | */ |
36 | public function isLocal(); |
37 | |
38 | /** |
39 | * Set storage location |
40 | * |
41 | * @param string $location |
42 | * @return AbstractAdapter |
43 | */ |
44 | public function setLocation($location); |
45 | |
46 | /** |
47 | * Get storage location |
48 | * |
49 | * @return string |
50 | */ |
51 | public function getLocation(); |
52 | |
53 | /** |
54 | * Fetch file |
55 | * |
56 | * @param string $filename |
57 | * @return void |
58 | */ |
59 | public function fetchFile($filename); |
60 | |
61 | /** |
62 | * Upload file |
63 | * |
64 | * @param mixed $file |
65 | * @param string $dest |
66 | * @param Upload $upload |
67 | * @return string |
68 | */ |
69 | public function uploadFile($file, $dest = null, Upload $upload = null); |
70 | |
71 | /** |
72 | * Upload file |
73 | * |
74 | * @param string $fileStream |
75 | * @param string $filename |
76 | * @param string $folder |
77 | * @return string |
78 | */ |
79 | public function uploadFileStream($fileStream, $filename, $folder = null); |
80 | |
81 | /** |
82 | * Replace file |
83 | * |
84 | * @param string $filename |
85 | * @param string $contents |
86 | * @return void |
87 | */ |
88 | public function replaceFile($filename, $contents); |
89 | |
90 | /** |
91 | * Delete |
92 | * |
93 | * @param string $filename |
94 | * @return void |
95 | */ |
96 | public function deleteFile($filename); |
97 | |
98 | /** |
99 | * Remove a directory |
100 | * |
101 | * @param string $dir |
102 | * @return void |
103 | */ |
104 | public function rmdir($dir); |
105 | |
106 | /** |
107 | * Make a directory |
108 | * |
109 | * @param string $dir |
110 | * @return void |
111 | */ |
112 | public function mkdir($dir); |
113 | |
114 | /** |
115 | * Copy file |
116 | * |
117 | * @param string $filename |
118 | * @param string $to |
119 | * @return void |
120 | */ |
121 | public function copyFile($filename, $to); |
122 | |
123 | /** |
124 | * Rename file |
125 | * |
126 | * @param string $filename |
127 | * @param string $to |
128 | * @return void |
129 | */ |
130 | public function renameFile($filename, $to); |
131 | |
132 | /** |
133 | * File exists |
134 | * |
135 | * @param string $filename |
136 | * @return boolean |
137 | */ |
138 | public function fileExists($filename); |
139 | |
140 | /** |
141 | * Check if file is a file |
142 | * |
143 | * @param string $filename |
144 | * @return boolean |
145 | */ |
146 | public function isFile($filename); |
147 | |
148 | /** |
149 | * Get file size |
150 | * |
151 | * @param string $filename |
152 | * @return int |
153 | */ |
154 | public function getFileSize($filename); |
155 | |
156 | /** |
157 | * Get file type |
158 | * |
159 | * @param string $filename |
160 | * @return string |
161 | */ |
162 | public function getFileType($filename); |
163 | |
164 | /** |
165 | * Get file modified time |
166 | * |
167 | * @param string $filename |
168 | * @return int |
169 | */ |
170 | public function getFileMTime($filename); |
171 | |
172 | /** |
173 | * Create MD5 checksum of the file |
174 | * |
175 | * @param string $filename |
176 | * @return string |
177 | */ |
178 | public function md5File($filename); |
179 | |
180 | /** |
181 | * Load file lines into array |
182 | * |
183 | * @param string $filename |
184 | * @return array |
185 | */ |
186 | public function loadFile($filename); |
187 | |
188 | } |