Rev 1116 | Rev 1183 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1116 | Rev 1130 | ||
---|---|---|---|
Line 186... | Line 186... | ||
186 | public function tree_search(string $request) { |
186 | public function tree_search(string $request) { |
187 | return false; |
187 | return false; |
188 | } |
188 | } |
189 | 189 | ||
190 | /** |
190 | /** |
191 | * @param $dir |
191 | * @param string $dir |
192 | * @param $basepath |
192 | * @param string|null $basepath |
193 | * @param $results |
193 | * @param array $results |
194 | * @return array|mixed |
194 | * @return array |
195 | */ |
195 | */ |
196 | private static function getDirContents($dir, $basepath = null, &$results = array()) { |
196 | private static function getDirContents(string $dir, string $basepath = null, array &$results = array()): array { |
197 | if (is_null($basepath)) $basepath = $dir; |
197 | if (is_null($basepath)) $basepath = $dir; |
198 | $basepath = realpath($basepath) . DIRECTORY_SEPARATOR; |
198 | $basepath = realpath($basepath) . DIRECTORY_SEPARATOR; |
199 | $dir = realpath($dir) . DIRECTORY_SEPARATOR; |
199 | $dir = realpath($dir) . DIRECTORY_SEPARATOR; |
200 | $files = scandir($dir); |
200 | $files = scandir($dir); |
201 | foreach ($files as $file) { |
201 | foreach ($files as $file) { |
Line 214... | Line 214... | ||
214 | } |
214 | } |
215 | return $results; |
215 | return $results; |
216 | } |
216 | } |
217 | 217 | ||
218 | /** |
218 | /** |
219 | * @param $checksumfile |
219 | * @param string $checksumfile |
220 | * @return array|false |
220 | * @return array|false |
221 | */ |
221 | */ |
222 | private static function checksumFileToArray($checksumfile) { |
222 | private static function checksumFileToArray(string $checksumfile) { |
223 | $out = array(); |
223 | $out = array(); |
224 | 224 | ||
225 | $cont = url_get_contents($checksumfile); |
225 | $cont = url_get_contents($checksumfile); |
226 | if ($cont === false) return false; |
226 | if ($cont === false) return false; |
227 | $lines = explode("\n", $cont); |
227 | $lines = explode("\n", $cont); |