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 | 11 | public function __construct() |
|
121 | |||
122 | /** |
||
123 | * Returns a pointcut by identifier |
||
124 | * |
||
125 | * @param string $id Pointcut identifier |
||
126 | * |
||
127 | * @return Aop\Pointcut |
||
128 | */ |
||
129 | 1 | public function getPointcut($id) |
|
133 | |||
134 | /** |
||
135 | * Store the pointcut in the container |
||
136 | * |
||
137 | * @param Aop\Pointcut $pointcut Instance |
||
138 | * @param string $id Key for pointcut |
||
139 | */ |
||
140 | 1 | public function registerPointcut(Aop\Pointcut $pointcut, $id) |
|
144 | |||
145 | /** |
||
146 | * Returns an advisor by identifier |
||
147 | * |
||
148 | * @param string $id Advisor identifier |
||
149 | * |
||
150 | * @return Aop\Advisor |
||
151 | */ |
||
152 | public function getAdvisor($id) |
||
156 | |||
157 | /** |
||
158 | * Store the advisor in the container |
||
159 | * |
||
160 | * @param Aop\Advisor $advisor Instance |
||
161 | * @param string $id Key for advisor |
||
162 | */ |
||
163 | 1 | public function registerAdvisor(Aop\Advisor $advisor, $id) |
|
167 | |||
168 | /** |
||
169 | * Returns an aspect by id or class name |
||
170 | * |
||
171 | * @param string $aspectName Aspect name |
||
172 | * |
||
173 | * @return Aop\Aspect |
||
174 | */ |
||
175 | 1 | public function getAspect($aspectName) |
|
179 | |||
180 | /** |
||
181 | * Register an aspect in the container |
||
182 | * |
||
183 | * @param Aop\Aspect $aspect Instance of concrete aspect |
||
184 | */ |
||
185 | 1 | public function registerAspect(Aop\Aspect $aspect) |
|
191 | |||
192 | /** |
||
193 | * Add an AOP resource to the container |
||
194 | * |
||
195 | * Resources is used to check the freshness of AOP cache |
||
196 | */ |
||
197 | 2 | public function addResource($resource) |
|
202 | |||
203 | /** |
||
204 | * Returns list of AOP resources |
||
205 | * |
||
206 | * @return array |
||
207 | */ |
||
208 | public function getResources() |
||
212 | |||
213 | /** |
||
214 | * Checks the freshness of AOP cache |
||
215 | * |
||
216 | * @param integer $timestamp |
||
217 | * |
||
218 | * @return bool Whether or not concrete file is fresh |
||
219 | */ |
||
220 | 1 | public function isFresh($timestamp) |
|
228 | } |
||
229 |