Conditions | 3 |
Paths | 3 |
Total Lines | 24 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function getRoutes() |
||
33 | { |
||
34 | $list = array(); |
||
35 | |||
36 | foreach (glob(__DIR__ . '/config/*.php') as $file) { |
||
37 | |||
38 | $command = pathinfo($file, PATHINFO_FILENAME); |
||
39 | $list[$command] = gplcart_config_get($file); |
||
40 | |||
41 | $method = $command; |
||
42 | $parts = explode('-', $command); |
||
43 | |||
44 | if (count($parts) > 1) { |
||
45 | $method = array_pop($parts); |
||
46 | } |
||
47 | |||
48 | $class_name = implode('', $parts); |
||
49 | |||
50 | $list[$command]['handlers']['controller'] = array( |
||
51 | "gplcart\\modules\\cli\\controllers\\$class_name", "cmd$method$class_name"); |
||
52 | } |
||
53 | |||
54 | return $list; |
||
55 | } |
||
56 | |||
58 |