| Conditions | 3 |
| Paths | 4 |
| Total Lines | 22 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 11 | public function handle() { |
||
| 12 | |||
| 13 | # Check installation |
||
| 14 | |||
| 15 | if (!$this->installed) Request::redirect(INSTALL_PATH . '/install.php'); |
||
| 16 | |||
| 17 | # Connect to database |
||
| 18 | |||
| 19 | DB::connect(...array_values($this->database)); |
||
| 20 | |||
| 21 | # Get handler by requested url |
||
| 22 | |||
| 23 | $handler = (new Map())->handler($url = new Url(Request::get('url'))); |
||
| 24 | |||
| 25 | # Determine handler class |
||
| 26 | |||
| 27 | $class = ((false !== $handler) ? ('Handlers\\' . $handler) : 'Handlers\Site\Page'); |
||
| 28 | |||
| 29 | # ------------------------ |
||
| 30 | |||
| 31 | new $class($url); |
||
| 32 | } |
||
| 33 | } |
||
| 35 |