| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | public static function scanAllFiles($dir, $exclude = '/^(.{1,2}|\.htaccess)$/s') |
||
| 28 | { |
||
| 29 | $di = new RecursiveDirectoryIterator($dir); |
||
| 30 | $result = []; |
||
| 31 | foreach (new RecursiveIteratorIterator($di) as $filename => $file) { |
||
| 32 | $basename = basename($filename); |
||
|
|
|||
| 33 | if (preg_match($exclude, $basename)) { |
||
| 34 | continue; |
||
| 35 | } |
||
| 36 | $b['path'] = realpath($filename); |
||
| 37 | $b['data'] = \Filemanager\file::get(realpath($filename), true); |
||
| 38 | $b['folder'] = dirname(realpath($filename)); |
||
| 39 | $b['filename'] = $basename; |
||
| 40 | $b['size'] = $file->getSize(); |
||
| 41 | $result[] = $b; |
||
| 42 | } |
||
| 43 | |||
| 44 | return (array) $result; |
||
| 45 | } |
||
| 52 |