1 | <?php |
||
14 | class MaglLegacy |
||
15 | { |
||
16 | |||
17 | const EVENT_SHORT_CIRCUIT_RESPONSE = 'magl-short-circuit-response'; |
||
18 | |||
19 | /** |
||
20 | * |
||
21 | * @var MaglLegacy |
||
22 | */ |
||
23 | private static $instance = null; |
||
24 | |||
25 | /** |
||
26 | * |
||
27 | * @var ApplicationInterface |
||
28 | */ |
||
29 | private $application; |
||
30 | |||
31 | /** |
||
32 | * |
||
33 | * @var string full path of the requested file (may be used within your legacy application) |
||
34 | */ |
||
35 | private $legacyScriptFilename = null; |
||
36 | |||
37 | /** |
||
38 | * |
||
39 | * @var string url path of the requested file (may be used within your legacy application) |
||
40 | */ |
||
41 | private $legacyScriptName = null; |
||
42 | |||
43 | /** |
||
44 | * |
||
45 | * @return MaglLegacy |
||
46 | */ |
||
47 | 13 | public static function getInstance() |
|
48 | { |
||
49 | 13 | if (null === self::$instance) { |
|
50 | self::$instance = new static(); |
||
51 | } |
||
52 | |||
53 | 13 | return self::$instance; |
|
54 | } |
||
55 | |||
56 | /** |
||
57 | * @codeCoverageIgnore |
||
58 | */ |
||
59 | private function __construct() |
||
63 | |||
64 | /** |
||
65 | * @codeCoverageIgnore |
||
66 | */ |
||
67 | private function __clone() |
||
71 | |||
72 | 8 | public function setApplication(ApplicationInterface $application) |
|
76 | |||
77 | /** |
||
78 | * |
||
79 | * @return ApplicationInterface |
||
80 | */ |
||
81 | 1 | public function getApplication() |
|
85 | |||
86 | /** |
||
87 | * |
||
88 | * @return ServiceLocatorInterface |
||
89 | */ |
||
90 | public static function getServiceManager() |
||
94 | |||
95 | /** |
||
96 | * |
||
97 | * @return EventManagerInterface |
||
98 | */ |
||
99 | public static function getEventManager() |
||
103 | |||
104 | /** |
||
105 | * |
||
106 | * @return string the full path of the requested legacy filename |
||
107 | */ |
||
108 | 1 | public function getLegacyScriptFilename() |
|
112 | |||
113 | /** |
||
114 | * |
||
115 | * @param string $legacyScriptFilename |
||
116 | * @return boolean true, if the script filenamename was set, false otherwise, e.g. it has already been set |
||
117 | */ |
||
118 | 6 | public function setLegacyScriptFilename($legacyScriptFilename) |
|
122 | |||
123 | /** |
||
124 | * |
||
125 | * @return string the URI path of the requested legacy filename |
||
126 | */ |
||
127 | 1 | public function getLegacyScriptName() |
|
131 | |||
132 | /** |
||
133 | * |
||
134 | * @param string $legacyScriptName |
||
135 | * @return boolean true, if the script name was set, false otherwise, e.g. it has already been set |
||
136 | */ |
||
137 | 6 | public function setLegacyScriptName($legacyScriptName) |
|
141 | |||
142 | /** |
||
143 | * @param string $varName the variable to be set |
||
144 | * @param string $varValue the value |
||
145 | */ |
||
146 | 7 | private function setVarOnce($varName, $varValue) |
|
156 | } |
||
157 |