1 | <?php |
||
26 | class GoAspectContainer extends Container implements AspectContainer |
||
27 | { |
||
28 | /** |
||
29 | * List of resources for application |
||
30 | * |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $resources = []; |
||
34 | |||
35 | /** |
||
36 | * Cached timestamp for resources |
||
37 | * |
||
38 | * @var integer |
||
39 | */ |
||
40 | protected $maxTimestamp = 0; |
||
41 | |||
42 | /** |
||
43 | * Constructor for container |
||
44 | */ |
||
45 | 9 | public function __construct() |
|
123 | |||
124 | /** |
||
125 | * Returns a pointcut by identifier |
||
126 | 1 | * |
|
127 | * @param string $id Pointcut identifier |
||
128 | 1 | * |
|
129 | * @return Aop\Pointcut |
||
130 | */ |
||
131 | public function getPointcut($id) |
||
135 | |||
136 | /** |
||
137 | 1 | * Store the pointcut in the container |
|
138 | * |
||
139 | 1 | * @param Aop\Pointcut $pointcut Instance |
|
140 | 1 | * @param string $id Key for pointcut |
|
141 | */ |
||
142 | public function registerPointcut(Aop\Pointcut $pointcut, $id) |
||
146 | |||
147 | /** |
||
148 | * Returns an advisor by identifier |
||
149 | * |
||
150 | * @param string $id Advisor identifier |
||
151 | * |
||
152 | * @return Aop\Advisor |
||
153 | */ |
||
154 | public function getAdvisor($id) |
||
158 | |||
159 | /** |
||
160 | 1 | * Store the advisor in the container |
|
161 | * |
||
162 | 1 | * @param Aop\Advisor $advisor Instance |
|
163 | 1 | * @param string $id Key for advisor |
|
164 | */ |
||
165 | public function registerAdvisor(Aop\Advisor $advisor, $id) |
||
169 | |||
170 | /** |
||
171 | * Returns an aspect by id or class name |
||
172 | 1 | * |
|
173 | * @param string $aspectName Aspect name |
||
174 | 1 | * |
|
175 | * @return Aop\Aspect |
||
176 | */ |
||
177 | public function getAspect($aspectName) |
||
181 | |||
182 | 1 | /** |
|
183 | * Register an aspect in the container |
||
184 | 1 | * |
|
185 | 1 | * @param Aop\Aspect $aspect Instance of concrete aspect |
|
186 | 1 | */ |
|
187 | 1 | public function registerAspect(Aop\Aspect $aspect) |
|
193 | |||
194 | 2 | /** |
|
195 | * Add an AOP resource to the container |
||
196 | 2 | * |
|
197 | 2 | * Resources is used to check the freshness of AOP cache |
|
198 | 2 | */ |
|
199 | public function addResource($resource) |
||
204 | |||
205 | /** |
||
206 | * Returns list of AOP resources |
||
207 | * |
||
208 | * @return array |
||
209 | */ |
||
210 | public function getResources() |
||
214 | |||
215 | /** |
||
216 | * Checks the freshness of AOP cache |
||
217 | 1 | * |
|
218 | * @param integer $timestamp |
||
219 | 1 | * |
|
220 | 1 | * @return bool Whether or not concrete file is fresh |
|
221 | */ |
||
222 | public function isFresh($timestamp) |
||
230 | } |
||
231 |