Lines Matching refs:file
44 while (($file = readdir($dh)) !== false) {
45 if (preg_match('/^[\._]/', $file)) continue; //skip hidden files and upper dirs
46 if (is_dir($base . '/' . $dir . '/' . $file)) {
47 $dirs[] = $dir . '/' . $file;
50 $files[] = $dir . '/' . $file;
51 $filepaths[] = $base . '/' . $dir . '/' . $file;
70 foreach ($files as $file) {
71 call_user_func_array($func, [&$data, $base, $file, 'f', $lvl, $opts]);
105 * @param string $file
112 function search_qsearch(&$data, $base, $file, $type, $lvl, $opts) argument
119 return search_universal($data, $base, $file, $type, $lvl, $opts);
131 * @param string $file
138 function search_index(&$data, $base, $file, $type, $lvl, $opts) argument
148 'depth' => preg_match('#^' . preg_quote($file, '#') . '(/|$)#', '/' . $ns) ? 0 : -1,
151 return search_universal($data, $base, $file, $type, $lvl, $opts);
161 * @param string $file
168 function search_namespaces(&$data, $base, $file, $type, $lvl, $opts) argument
171 return search_universal($data, $base, $file, $type, $lvl, $opts);
186 * @param string $file
193 function search_media(&$data, $base, $file, $type, $lvl, $opts) argument
198 $depth = substr_count($file, '/');
204 $info['id'] = pathID($file, true);
222 $info['file'] = PhpString::basename($file);
223 $info['size'] = filesize($base . '/' . $file);
224 $info['mtime'] = filemtime($base . '/' . $file);
225 $info['writable'] = is_writable($base . '/' . $file);
226 if (preg_match("/\.(jpe?g|gif|png)$/", $file)) {
228 $info['meta'] = new JpegMeta($base . '/' . $file);
253 * @param string $file
260 function search_mediafiles(&$data, $base, $file, $type, $lvl, $opts) argument
266 $depth = substr_count($file, '/');
271 $id = pathID($file, true);
301 * @param string $file
308 function search_list(&$data, $base, $file, $type, $lvl, $opts) argument
313 if (str_ends_with($file, '.txt')) {
315 $id = pathID($file);
333 * @param string $file
340 function search_pagename(&$data, $base, $file, $type, $lvl, $opts) argument
345 if (!str_ends_with($file, '.txt')) return true;
349 if (str_contains($file, (string) $opts['query'])) {
351 $id = pathID($file);
372 * @param string $file
379 function search_allpages(&$data, $base, $file, $type, $lvl, $opts) argument
382 $parts = explode('/', ltrim($file, '/'));
397 if (!str_ends_with($file, '.txt')) return true;
400 $item['id'] = pathID($file);
405 $item['rev'] = filemtime($base . '/' . $file);
407 $item['size'] = filesize($base . '/' . $file);
491 * @param string $file - current file or directory relative to $base
500 function search_universal(&$data, $base, $file, $type, $lvl, $opts) argument
506 $item['id'] = pathID($file, ($type == 'd' || !empty($opts['keeptxt'])));
520 $depth = substr_count($file, '/');
529 $match = empty($opts['recmatch']) || preg_match('/' . $opts['recmatch'] . '/', $file);
552 …if (!empty($opts['dirmatch']) && !preg_match('/' . $opts['dirmatch'] . '/', $file)) return $return;
557 if (!empty($opts['pagesonly']) && !str_ends_with($file, '.txt')) return $return;
559 …if (!empty($opts['filematch']) && !preg_match('/' . $opts['filematch'] . '/', $file)) return $retu…
569 $item['file'] = PhpString::basename($file);
570 $item['size'] = filesize($base . '/' . $file);
571 $item['mtime'] = filemtime($base . '/' . $file);
573 $item['writable'] = is_writable($base . '/' . $file);
574 $item['executable'] = is_executable($base . '/' . $file);
578 if (!empty($opts['hash'])) $item['hash'] = md5(io_readFile($base . '/' . $file, false));