1 | <?php |
||
22 | class Loader implements SingletonInterface |
||
23 | { |
||
24 | /** |
||
25 | * The different implementations and the order of the execution. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $implementations = [ |
||
30 | // class replacement |
||
31 | 'Xclass', |
||
32 | 'AlternativeImplementations', |
||
33 | // additional functions |
||
34 | 'Hooks', |
||
35 | 'Slots', |
||
36 | // smart object management |
||
37 | 'SmartObjects', |
||
38 | 'ContentObjects', |
||
39 | 'TcaFiles', |
||
40 | 'ExtensionTypoScriptSetup', |
||
41 | 'ContextSensitiveHelps', |
||
42 | // non-critical |
||
43 | 'Plugins', |
||
44 | 'FlexForms', |
||
45 | 'CommandController', |
||
46 | 'StaticTyposcript', |
||
47 | 'ExtensionId', |
||
48 | 'TypeConverter', |
||
49 | 'BackendLayout', |
||
50 | 'SoapServer', |
||
51 | 'JsonServer', |
||
52 | 'LanguageOverride', |
||
53 | 'Icon', |
||
54 | 'Gridelement', |
||
55 | 'FluidNamespace', |
||
56 | ]; |
||
57 | |||
58 | /** |
||
59 | * The Extension key. |
||
60 | * |
||
61 | * @var string |
||
62 | */ |
||
63 | protected $extensionKey; |
||
64 | |||
65 | /** |
||
66 | * The vendorName. |
||
67 | * |
||
68 | * @var string |
||
69 | */ |
||
70 | protected $vendorName; |
||
71 | |||
72 | /** |
||
73 | * Set to tro, if there is no valid autoloader cache. |
||
74 | * |
||
75 | * @var bool |
||
76 | */ |
||
77 | protected $disableFirstCall = false; |
||
78 | |||
79 | /** |
||
80 | * Default cache configuration. |
||
81 | * |
||
82 | * @var array |
||
83 | */ |
||
84 | protected $cacheConfiguration = [ |
||
85 | 'backend' => SimpleFileBackend::class, |
||
86 | 'frontend' => PhpFrontend::class, |
||
87 | 'groups' => [ |
||
88 | 'system', |
||
89 | ], |
||
90 | 'options' => [ |
||
91 | 'defaultLifetime' => 0, |
||
92 | ], |
||
93 | ]; |
||
94 | |||
95 | /** |
||
96 | * Build up the object. |
||
97 | * If there is no valid cache in the LocalConfiguration add one. |
||
98 | */ |
||
99 | public function __construct() |
||
111 | |||
112 | /** |
||
113 | * Call this method in the ext_tables.php file. |
||
114 | * |
||
115 | * @param string $vendorName |
||
116 | * @param string $extensionKey |
||
117 | * @param array $implementations |
||
118 | */ |
||
119 | public static function extTables($vendorName, $extensionKey, array $implementations = []) |
||
126 | |||
127 | /** |
||
128 | * Call this method in the ext_localconf.php file. |
||
129 | * |
||
130 | * @param string $vendorName |
||
131 | * @param string $extensionKey |
||
132 | * @param array $implementations |
||
133 | */ |
||
134 | public static function extLocalconf($vendorName, $extensionKey, array $implementations = []) |
||
141 | |||
142 | /** |
||
143 | * Allow non Doctrine annotations |
||
144 | */ |
||
145 | public static function allowNonDoctrineAnnotations() |
||
146 | { |
||
147 | static $done = false; |
||
148 | if ($done) { |
||
149 | return; |
||
150 | } |
||
151 | $done = true; |
||
152 | $is9orHigher = VersionNumberUtility::convertVersionNumberToInteger(TYPO3_branch) >= VersionNumberUtility::convertVersionNumberToInteger('9.0'); |
||
153 | if ($is9orHigher) { |
||
154 | AnnotationReader::addGlobalIgnoredName('signalClass'); |
||
155 | AnnotationReader::addGlobalIgnoredName('signalName'); |
||
156 | AnnotationReader::addGlobalIgnoredName('noHeader'); |
||
157 | AnnotationReader::addGlobalIgnoredName('wizardTab'); |
||
158 | AnnotationReader::addGlobalIgnoredName('db'); |
||
159 | AnnotationReader::addGlobalIgnoredName('recordType'); |
||
160 | AnnotationReader::addGlobalIgnoredName('parentClass'); |
||
161 | AnnotationReader::addGlobalIgnoredName('hook'); |
||
162 | AnnotationReader::addGlobalIgnoredName('plugin'); |
||
163 | AnnotationReader::addGlobalIgnoredName('noCache'); |
||
164 | AnnotationReader::addGlobalIgnoredName('enableRichText'); |
||
165 | AnnotationReader::addGlobalIgnoredName('parentClass'); |
||
166 | AnnotationReader::addGlobalIgnoredName('smartExclude'); |
||
167 | } |
||
168 | } |
||
169 | |||
170 | /** |
||
171 | * Load the ext tables information. |
||
172 | * |
||
173 | * @param string $vendorName |
||
174 | * @param string $extensionKey |
||
175 | * @param array $implementations |
||
176 | */ |
||
177 | public function loadExtTables($vendorName, $extensionKey, array $implementations = []) |
||
195 | |||
196 | /** |
||
197 | * Load the ext localconf information. |
||
198 | * |
||
199 | * @param string $vendorName |
||
200 | * @param string $extensionKey |
||
201 | * @param array $implementations |
||
202 | */ |
||
203 | public function loadExtLocalconf($vendorName, $extensionKey, array $implementations = []) |
||
221 | |||
222 | /** |
||
223 | * Get the extension key. |
||
224 | * |
||
225 | * @return string |
||
226 | */ |
||
227 | public function getExtensionKey() |
||
231 | |||
232 | /** |
||
233 | * Get the vendor name. |
||
234 | * |
||
235 | * @return string |
||
236 | */ |
||
237 | public function getVendorName() |
||
241 | |||
242 | /** |
||
243 | * check if the class is loadable and is instantiable |
||
244 | * (exists and is no interface or abstraction etc.). |
||
245 | * |
||
246 | * @param $class |
||
247 | * |
||
248 | * @return bool |
||
249 | */ |
||
250 | public function isInstantiableClass($class) |
||
254 | |||
255 | /** |
||
256 | * Build the Autoloader objects. |
||
257 | * |
||
258 | * @param array $objectNames |
||
259 | * |
||
260 | * @return array |
||
261 | */ |
||
262 | protected function buildAutoLoaderObjects(array $objectNames = []) |
||
280 | |||
281 | /** |
||
282 | * Get the Autoloader Names in the right order. |
||
283 | * |
||
284 | * @param array $objectNames |
||
285 | * |
||
286 | * @return array |
||
287 | */ |
||
288 | protected function getAutoLoaderNamesInRightOrder(array $objectNames = []) |
||
305 | |||
306 | /** |
||
307 | * Prepare the autoLoader information. |
||
308 | * |
||
309 | * @param array $objects |
||
310 | * @param int $type |
||
311 | * |
||
312 | * @return array |
||
313 | */ |
||
314 | protected function prepareAutoLoaderObjects(array $objects, $type) |
||
330 | |||
331 | /** |
||
332 | * Build the loader information. |
||
333 | * |
||
334 | * @param $objects |
||
335 | * @param $type |
||
336 | * |
||
337 | * @return array |
||
338 | */ |
||
339 | protected function buildLoaderInformation($objects, $type) |
||
349 | |||
350 | /** |
||
351 | * Get the cache manager. |
||
352 | * |
||
353 | * @return \TYPO3\CMS\Core\Cache\CacheManager |
||
354 | */ |
||
355 | protected function getCacheManager() |
||
359 | } |
||
360 |