1 | <?php |
||
22 | class AopComposerLoader |
||
23 | { |
||
24 | |||
25 | /** |
||
26 | * Instance of original autoloader |
||
27 | * |
||
28 | * @var ClassLoader |
||
29 | */ |
||
30 | protected $original = null; |
||
31 | |||
32 | /** |
||
33 | * AOP kernel options |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | protected $options = []; |
||
38 | |||
39 | /** |
||
40 | * File enumerator |
||
41 | * |
||
42 | * @var Enumerator |
||
43 | */ |
||
44 | protected $fileEnumerator; |
||
45 | |||
46 | /** |
||
47 | * Cache state |
||
48 | * |
||
49 | * @var array |
||
50 | */ |
||
51 | private $cacheState; |
||
52 | |||
53 | /** |
||
54 | * Was initialization successful or not |
||
55 | * |
||
56 | * @var bool |
||
57 | */ |
||
58 | private static $wasInitialized = false; |
||
59 | |||
60 | /** |
||
61 | * Constructs an wrapper for the composer loader |
||
62 | * |
||
63 | * @param ClassLoader $original Instance of current loader |
||
64 | * @param AspectContainer $container Instance of the container |
||
65 | * @param array $options Configuration options |
||
66 | */ |
||
67 | public function __construct(ClassLoader $original, AspectContainer $container, array $options = []) |
||
92 | |||
93 | /** |
||
94 | * Initialize aspect autoloader |
||
95 | * |
||
96 | * Replaces original composer autoloader with wrapper |
||
97 | * |
||
98 | * @param array $options Aspect kernel options |
||
99 | * @param AspectContainer $container |
||
100 | * |
||
101 | * @return bool was initialization sucessful or not |
||
102 | */ |
||
103 | public static function init(array $options = [], AspectContainer $container) |
||
131 | |||
132 | /** |
||
133 | * Autoload a class by it's name |
||
134 | */ |
||
135 | public function loadClass($class) |
||
143 | |||
144 | /** |
||
145 | * {@inheritDoc} |
||
146 | */ |
||
147 | public function findFile($class) |
||
169 | |||
170 | /** |
||
171 | * Whether or not loader was initialized |
||
172 | * |
||
173 | * @return bool |
||
174 | */ |
||
175 | public static function wasInitialized() |
||
179 | } |
||
180 |