Conditions | 6 |
Paths | 5 |
Total Lines | 27 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 42 |
Changes | 0 |
1 | <?php |
||
22 | public function handle() |
||
23 | { |
||
24 | // TODO: Probably walk through all known handlers and query them whether they're |
||
25 | // responsible/capable for answering the request or not. Take the best match. |
||
26 | |||
27 | if (isset($_REQUEST['unique']) && substr($_REQUEST['unique'], 0, 8) == 'synology') { |
||
28 | $handler = new SynologyHandler($this->config); |
||
29 | } elseif ($_SERVER['REQUEST_METHOD'] == 'GET') { |
||
30 | // GET-request, probably browser --> show HTML |
||
31 | $arch = trim($_GET['arch']); |
||
32 | $fullList = trim($_GET['fulllist']); |
||
33 | |||
34 | if ($arch) { |
||
35 | // Architecture is set --> show packages for that arch |
||
36 | $handler = new BrowserPackageListHandler($this->config); |
||
37 | } elseif ($fullList) { |
||
38 | // No architecture, but full list of packages requested --> show simple list |
||
39 | $handler = new BrowserAllPackagesListHandler($this->config); |
||
40 | } else { |
||
41 | // Nothing specific requested --> show models overview |
||
42 | $handler = new BrowserDeviceListHandler($this->config); |
||
43 | } |
||
44 | } else { |
||
45 | $handler = new NotFoundHandler($this->config); |
||
46 | } |
||
47 | $handler->handle(); |
||
48 | } |
||
49 | } |
||
50 |