1 <?php
2
3 namespace rpf\system;
4 use rpf\api\api;
5 use rpf\extension\extension;
6 use rpf\system\module\exception;
7 use rpf\system\module\log;
8 use rpf\system\module\moduleManager;
9
10 11 12 13 14 15 16 17 18
19 class module
20 {
21 22 23
24 private $module;
25
26 public function __construct()
27 {
28 if (!isset($GLOBALS['rpfModule']))
29 {
30 $GLOBALS['rpfModule'] = new moduleManager();
31 }
32 $this->module =& $GLOBALS['rpfModule'];
33 }
34
35 36 37 38
39 public function getApi()
40 {
41 return $this->getModule('\rpf\api\api');
42 }
43
44 45 46 47
48 public function getExtension()
49 {
50 return $this->getModule('\rpf\extension\extension');
51 }
52
53 54 55
56 public function getException()
57 {
58 return $this->getModule('exception');
59 }
60
61
62 63 64 65 66 67 68 69
70 protected function getModule($name)
71 {
72 return $this->module->get($name);
73 }
74
75
76 protected function addModule($nameOrObject)
77 {
78 return $this->module->add($nameOrObject);
79 }
80 }