| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function getFileInfo($path) |
||
| 20 | { |
||
| 21 | $file = $this->root.$path; |
||
| 22 | |||
| 23 | if (!file_exists($file)) { |
||
| 24 | $file = $this->root.'templates/_head.html.php'; |
||
| 25 | } |
||
| 26 | |||
| 27 | return [ |
||
| 28 | 'name' => str_replace($this->root, '', $file), |
||
| 29 | 'content' => file_get_contents($file), |
||
| 30 | 'last-modified' => date("Y-m-d H:i:s", filemtime($file)), |
||
| 31 | 'size' => filesize($file), |
||
| 32 | 'perms' => decoct(fileperms($file) & 0777), |
||
| 33 | ]; |
||
| 34 | } |
||
| 35 | |||
| 47 |