1 | <?php |
||
18 | class Dev extends Module |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * Library class instance |
||
23 | * @var \gplcart\core\Library |
||
24 | */ |
||
25 | protected $library; |
||
26 | |||
27 | /** |
||
28 | * @param Library $library |
||
29 | */ |
||
30 | public function __construct(Library $library) |
||
36 | |||
37 | /** |
||
38 | * Implements hook "construct" |
||
39 | */ |
||
40 | public function hookConstruct() |
||
44 | |||
45 | /** |
||
46 | * Implements hook "construct.controller" |
||
47 | * @param \gplcart\core\Controller $object |
||
48 | */ |
||
49 | public function hookConstructController($object) |
||
56 | |||
57 | /** |
||
58 | * Implements hook "destruct" |
||
59 | */ |
||
60 | public function hookDestruct() |
||
70 | |||
71 | /** |
||
72 | * Render and print dev toolbar |
||
73 | */ |
||
74 | protected function outputToolbar() |
||
87 | |||
88 | /** |
||
89 | * Implements hook "library.list" |
||
90 | * @param array $libraries |
||
91 | */ |
||
92 | public function hookLibraryList(array &$libraries) |
||
107 | |||
108 | /** |
||
109 | * Implements hook "route.list" |
||
110 | * @param array $routes |
||
111 | */ |
||
112 | public function hookRouteList(array &$routes) |
||
121 | |||
122 | /** |
||
123 | * Implements hook "module.enable.after" |
||
124 | */ |
||
125 | public function hookModuleEnableAfter() |
||
129 | |||
130 | /** |
||
131 | * Implements hook "module.disable.after" |
||
132 | */ |
||
133 | public function hookModuleDisableAfter() |
||
137 | |||
138 | /** |
||
139 | * Implements hook "module.install.after" |
||
140 | */ |
||
141 | public function hookModuleInstallAfter() |
||
145 | |||
146 | /** |
||
147 | * Implements hook "module.uninstall.after" |
||
148 | */ |
||
149 | public function hookModuleUninstallAfter() |
||
153 | |||
154 | } |
||
155 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: