1 | <?php |
||
25 | class GoAspectContainer extends Container implements AspectContainer |
||
26 | { |
||
27 | /** |
||
28 | * List of resources for application |
||
29 | * |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $resources = []; |
||
33 | |||
34 | /** |
||
35 | * Cached timestamp for resources |
||
36 | * |
||
37 | * @var integer |
||
38 | */ |
||
39 | protected $maxTimestamp = 0; |
||
40 | |||
41 | /** |
||
42 | * Constructor for container |
||
43 | */ |
||
44 | public function __construct() |
||
117 | |||
118 | /** |
||
119 | 11 | * Returns a pointcut by identifier |
|
120 | 11 | * |
|
121 | * @param string $id Pointcut identifier |
||
122 | * |
||
123 | * @return Aop\Pointcut |
||
124 | */ |
||
125 | public function getPointcut($id) |
||
129 | 1 | ||
130 | /** |
||
131 | 1 | * Store the pointcut in the container |
|
132 | * |
||
133 | * @param Aop\Pointcut $pointcut Instance |
||
134 | * @param string $id Key for pointcut |
||
135 | */ |
||
136 | public function registerPointcut(Aop\Pointcut $pointcut, $id) |
||
140 | 1 | ||
141 | /** |
||
142 | 1 | * Returns an advisor by identifier |
|
143 | 1 | * |
|
144 | * @param string $id Advisor identifier |
||
145 | * |
||
146 | * @return Aop\Advisor |
||
147 | */ |
||
148 | public function getAdvisor($id) |
||
152 | |||
153 | /** |
||
154 | * Store the advisor in the container |
||
155 | * |
||
156 | * @param Aop\Advisor $advisor Instance |
||
157 | * @param string $id Key for advisor |
||
158 | */ |
||
159 | public function registerAdvisor(Aop\Advisor $advisor, $id) |
||
163 | 1 | ||
164 | /** |
||
165 | 1 | * Returns an aspect by id or class name |
|
166 | 1 | * |
|
167 | * @param string $aspectName Aspect name |
||
168 | * |
||
169 | * @return Aop\Aspect |
||
170 | */ |
||
171 | public function getAspect($aspectName) |
||
175 | 1 | ||
176 | /** |
||
177 | 1 | * Register an aspect in the container |
|
178 | * |
||
179 | * @param Aop\Aspect $aspect Instance of concrete aspect |
||
180 | */ |
||
181 | public function registerAspect(Aop\Aspect $aspect) |
||
187 | 1 | ||
188 | 1 | /** |
|
189 | 1 | * Add an AOP resource to the container |
|
190 | 1 | * |
|
191 | * Resources is used to check the freshness of AOP cache |
||
192 | */ |
||
193 | public function addResource($resource) |
||
198 | |||
199 | 2 | /** |
|
200 | 2 | * Returns list of AOP resources |
|
201 | 2 | * |
|
202 | * @return array |
||
203 | */ |
||
204 | public function getResources() |
||
208 | |||
209 | /** |
||
210 | * Checks the freshness of AOP cache |
||
211 | * |
||
212 | * @param integer $timestamp |
||
213 | * |
||
214 | * @return bool Whether or not concrete file is fresh |
||
215 | */ |
||
216 | public function isFresh($timestamp) |
||
224 | } |
||
225 |