‪TYPO3CMS  ‪main
ServiceProvider.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
18 namespace ‪TYPO3\CMS\Core;
19 
20 use ArrayObject;
21 use Psr\Container\ContainerInterface;
22 use Psr\EventDispatcher\EventDispatcherInterface;
23 use Symfony\Component\Console\Command\HelpCommand;
24 use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as SymfonyEventDispatcherInterface;
25 use ‪TYPO3\CMS\Core\Adapter\EventDispatcherAdapter as SymfonyEventDispatcher;
29 use TYPO3\CMS\Core\DependencyInjection\ContainerBuilder;
32 use TYPO3\CMS\Core\Package\PackageManager;
35 
40 {
41  protected static function ‪getPackagePath(): string
42  {
43  return __DIR__ . '/../';
44  }
45 
46  protected static function ‪getPackageName(): string
47  {
48  return 'typo3/cms-core';
49  }
50 
51  public function ‪getFactories(): array
52  {
53  return [
54  SymfonyEventDispatcher::class => [ static::class, 'getSymfonyEventDispatcher' ],
55  Cache\CacheManager::class => [ static::class, 'getCacheManager' ],
56  Database\ConnectionPool::class => [ static::class, 'getConnectionPool' ],
57  Charset\CharsetConverter::class => [ static::class, 'getCharsetConverter' ],
58  Configuration\SiteConfiguration::class => [ static::class, 'getSiteConfiguration' ],
59  Command\ListCommand::class => [ static::class, 'getListCommand' ],
60  HelpCommand::class => [ static::class, 'getHelpCommand' ],
61  Command\CacheFlushCommand::class => [ static::class, 'getCacheFlushCommand' ],
62  Command\CacheWarmupCommand::class => [ static::class, 'getCacheWarmupCommand' ],
63  Command\DumpAutoloadCommand::class => [ static::class, 'getDumpAutoloadCommand' ],
64  Console\CommandApplication::class => [ static::class, 'getConsoleCommandApplication' ],
65  Console\CommandRegistry::class => [ static::class, 'getConsoleCommandRegistry' ],
66  Context\Context::class => [ static::class, 'getContext' ],
67  Core\BootService::class => [ static::class, 'getBootService' ],
68  Crypto\PasswordHashing\PasswordHashFactory::class => [ static::class, 'getPasswordHashFactory' ],
69  EventDispatcher\EventDispatcher::class => [ static::class, 'getEventDispatcher' ],
70  EventDispatcher\ListenerProvider::class => [ static::class, 'getEventListenerProvider' ],
71  FormProtection\FormProtectionFactory::class => [ static::class, 'getFormProtectionFactory' ],
72  Http\Client\GuzzleClientFactory::class => [ static::class, 'getGuzzleClientFactory' ],
73  Http\MiddlewareStackResolver::class => [ static::class, 'getMiddlewareStackResolver' ],
74  Http\RequestFactory::class => [ static::class, 'getRequestFactory' ],
75  Imaging\IconFactory::class => [ static::class, 'getIconFactory' ],
76  Imaging\IconRegistry::class => [ static::class, 'getIconRegistry' ],
77  Localization\LanguageServiceFactory::class => [ static::class, 'getLanguageServiceFactory' ],
78  Localization\LanguageStore::class => [ static::class, 'getLanguageStore' ],
79  Localization\Locales::class => [ static::class, 'getLocales' ],
80  Localization\LocalizationFactory::class => [ static::class, 'getLocalizationFactory' ],
81  Mail\TransportFactory::class => [ static::class, 'getMailTransportFactory' ],
82  Messaging\FlashMessageService::class => [ static::class, 'getFlashMessageService' ],
83  Middleware\ResponsePropagation::class => [ static::class, 'getResponsePropagationMiddleware' ],
84  Middleware\VerifyHostHeader::class => [ static::class, 'getVerifyHostHeaderMiddleware' ],
85  Package\FailsafePackageManager::class => [ static::class, 'getFailsafePackageManager' ],
86  Package\Cache\PackageDependentCacheIdentifier::class => [ static::class, 'getPackageDependentCacheIdentifier' ],
87  Routing\BackendEntryPointResolver::class => [ static::class, 'getBackendEntryPointResolver' ],
88  Routing\RequestContextFactory::class => [ static::class, 'getRequestContextFactory' ],
89  Registry::class => [ static::class, 'getRegistry' ],
90  Resource\Index\FileIndexRepository::class => [ static::class, 'getFileIndexRepository' ],
91  Resource\Index\MetaDataRepository::class => [ static::class, 'getMetaDataRepository' ],
92  Resource\Driver\DriverRegistry::class => [ static::class, 'getDriverRegistry' ],
93  Resource\ProcessedFileRepository::class => [ static::class, 'getProcessedFileRepository' ],
94  Resource\ResourceFactory::class => [ static::class, 'getResourceFactory' ],
95  Resource\StorageRepository::class => [ static::class, 'getStorageRepository' ],
96  Service\DependencyOrderingService::class => [ static::class, 'getDependencyOrderingService' ],
97  Service\FlexFormService::class => [ static::class, 'getFlexFormService' ],
98  Service\OpcodeCacheService::class => [ static::class, 'getOpcodeCacheService' ],
99  TimeTracker\TimeTracker::class => [ static::class, 'getTimeTracker' ],
100  TypoScript\TypoScriptStringFactory::class => [ static::class, 'getTypoScriptStringFactory' ],
101  TypoScript\TypoScriptService::class => [ static::class, 'getTypoScriptService' ],
102  TypoScript\AST\Traverser\AstTraverser::class => [ static::class, 'getAstTraverser' ],
103  TypoScript\AST\CommentAwareAstBuilder::class => [ static::class, 'getCommentAwareAstBuilder' ],
104  TypoScript\Tokenizer\LosslessTokenizer::class => [ static::class, 'getLosslessTokenizer'],
105  // @deprecated since v12, will be removed with v13 together with class PageTsConfigLoader.
106  'globalPageTsConfig' => [ static::class, 'getGlobalPageTsConfig' ],
107  'icons' => [ static::class, 'getIcons' ],
108  'middlewares' => [ static::class, 'getMiddlewares' ],
109  'content.security.policies' => [ static::class, 'getContentSecurityPolicies' ],
110  ];
111  }
112 
113  public function ‪getExtensions(): array
114  {
115  return [
116  Console\CommandRegistry::class => [ static::class, 'configureCommands' ],
117  Imaging\IconRegistry::class => [ static::class, 'configureIconRegistry' ],
118  // @deprecated since v12, will be removed with v13 together with class PageTsConfigLoader.
119  Configuration\Loader\PageTsConfigLoader::class => [ static::class, 'configurePageTsConfigLoader' ],
120  EventDispatcherInterface::class => [ static::class, 'provideFallbackEventDispatcher' ],
121  EventDispatcher\ListenerProvider::class => [ static::class, 'extendEventListenerProvider' ],
122  ] + parent::getExtensions();
123  }
124 
125  public static function ‪getSymfonyEventDispatcher(ContainerInterface $container): SymfonyEventDispatcherInterface
126  {
127  return ‪self::new($container, SymfonyEventDispatcher::class, [
128  $container->get(EventDispatcherInterface::class),
129  ]);
130  }
131 
132  public static function ‪getCacheManager(ContainerInterface $container): Cache\‪CacheManager
133  {
134  if (!$container->get('boot.state')->complete) {
135  throw new \LogicException(Cache\CacheManager::class . ' can not be injected/instantiated during ext_localconf.php or TCA loading. Use lazy loading instead.', 1638976434);
136  }
137 
138  $cacheConfigurations = ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'] ?? [];
139  $disableCaching = $container->get('boot.state')->cacheDisabled;
140  $defaultCaches = [
141  $container->get('cache.core'),
142  $container->get('cache.assets'),
143  $container->get('cache.di'),
144  ];
145 
146  $cacheManager = ‪self::new($container, Cache\CacheManager::class, [$disableCaching]);
147  $cacheManager->setCacheConfigurations($cacheConfigurations);
148  $cacheConfigurations['di']['groups'] = ['system'];
149  foreach ($defaultCaches as $cache) {
150  $cacheManager->registerCache($cache, $cacheConfigurations[$cache->getIdentifier()]['groups'] ?? ['all']);
151  }
152 
153  return $cacheManager;
154  }
155 
156  public static function ‪getConnectionPool(ContainerInterface $container): Database\‪ConnectionPool
157  {
158  if (!$container->get('boot.state')->complete) {
159  throw new \LogicException(Database\ConnectionPool::class . ' can not be injected/instantiated during ext_localconf.php or TCA loading. Use lazy loading instead.', 1638976490);
160  }
161 
162  return ‪self::new($container, Database\ConnectionPool::class);
163  }
164 
165  public static function ‪getCharsetConverter(ContainerInterface $container): Charset\CharsetConverter
166  {
167  return ‪self::new($container, Charset\CharsetConverter::class);
168  }
169 
170  public static function ‪getSiteConfiguration(ContainerInterface $container): Configuration\SiteConfiguration
171  {
172  return ‪self::new($container, Configuration\SiteConfiguration::class, [
173  ‪Environment::getConfigPath() . '/sites',
174  $container->get(EventDispatcherInterface::class),
175  $container->get('cache.core'),
176  ]);
177  }
178 
179  public static function ‪getListCommand(ContainerInterface $container): Command\ListCommand
180  {
181  return new ‪Command\ListCommand(
182  $container,
183  $container->get(Core\BootService::class)
184  );
185  }
186 
187  public static function ‪getHelpCommand(ContainerInterface $container): HelpCommand
188  {
189  return new HelpCommand();
190  }
191 
192  public static function ‪getCacheFlushCommand(ContainerInterface $container): Command\CacheFlushCommand
193  {
194  return new ‪Command\CacheFlushCommand(
195  $container->get(Core\BootService::class),
196  $container->get('cache.di')
197  );
198  }
199 
200  public static function ‪getCacheWarmupCommand(ContainerInterface $container): Command\CacheWarmupCommand
201  {
203  $container->get(ContainerBuilder::class),
204  $container->get(Package\PackageManager::class),
205  $container->get(Core\BootService::class),
206  $container->get('cache.di')
207  );
208  }
209 
210  public static function ‪getDumpAutoloadCommand(ContainerInterface $container): Command\DumpAutoloadCommand
211  {
212  return new ‪Command\DumpAutoloadCommand();
213  }
214 
215  public static function ‪getConsoleCommandApplication(ContainerInterface $container): Console\CommandApplication
216  {
218  $container->get(Context\Context::class),
219  $container->get(Console\CommandRegistry::class),
220  $container->get(SymfonyEventDispatcher::class),
221  $container->get(Configuration\ConfigurationManager::class),
222  $container->get(Core\BootService::class),
223  $container->get(Localization\LanguageServiceFactory::class)
224  );
225  }
226 
227  public static function ‪getConsoleCommandRegistry(ContainerInterface $container): Console\CommandRegistry
228  {
229  return new ‪Console\CommandRegistry($container);
230  }
231 
232  public static function ‪getEventDispatcher(ContainerInterface $container): EventDispatcher\EventDispatcher
233  {
235  $container->get(EventDispatcher\ListenerProvider::class)
236  );
237  }
238 
239  public static function ‪getEventListenerProvider(ContainerInterface $container): EventDispatcher\ListenerProvider
240  {
241  return new ‪EventDispatcher\ListenerProvider($container);
242  }
243 
244  public static function ‪extendEventListenerProvider(
245  ContainerInterface $container,
246  EventDispatcher\ListenerProvider $listenerProvider
247  ): EventDispatcher\ListenerProvider {
248  $listenerProvider->addListener(
249  Package\Event\PackagesMayHaveChangedEvent::class,
250  Package\PackageManager::class,
251  'packagesMayHaveChanged'
252  );
253 
254  $cacheWarmers = [
255  Configuration\SiteConfiguration::class,
256  Http\MiddlewareStackResolver::class,
257  Imaging\IconRegistry::class,
258  Package\PackageManager::class,
259  ];
260  foreach ($cacheWarmers as $service) {
261  $listenerProvider->addListener(Cache\Event\CacheWarmupEvent::class, $service, 'warmupCaches');
262  }
263 
264  $listenerProvider->addListener(Cache\Event\CacheFlushEvent::class, Cache\CacheManager::class, 'handleCacheFlushEvent');
265 
266  return $listenerProvider;
267  }
268 
269  public static function ‪getContext(ContainerInterface $container): Context\Context
270  {
271  return new ‪Context\Context();
272  }
273 
274  public static function ‪getBootService(ContainerInterface $container): Core\BootService
275  {
276  if ($container->has('_early.boot-service')) {
277  return $container->get('_early.boot-service');
278  }
279  return new ‪Core\BootService(
280  $container->get(ContainerBuilder::class),
281  $container
282  );
283  }
284 
285  public static function ‪getPasswordHashFactory(ContainerInterface $container): Crypto\PasswordHashing\PasswordHashFactory
286  {
288  }
289 
290  public static function ‪getIconFactory(ContainerInterface $container): Imaging\IconFactory
291  {
292  return ‪self::new($container, Imaging\IconFactory::class, [
293  $container->get(EventDispatcherInterface::class),
294  $container->get(Imaging\IconRegistry::class),
295  $container,
296  ]);
297  }
298 
299  public static function ‪configureIconRegistry(ContainerInterface $container, ‪IconRegistry $iconRegistry): ‪IconRegistry
300  {
301  $cache = $container->get('cache.core');
302 
303  $cacheIdentifier = $container->get(Package\Cache\PackageDependentCacheIdentifier::class)->withPrefix('Icons')->toString();
304  $iconsFromPackages = $cache->require($cacheIdentifier);
305  if ($iconsFromPackages === false) {
306  $iconsFromPackages = $container->get('icons')->getArrayCopy();
307  $cache->set($cacheIdentifier, 'return ' . var_export($iconsFromPackages, true) . ';');
308  }
309 
310  foreach ($iconsFromPackages as $icon => $options) {
311  $provider = $options['provider'] ?? null;
312  unset($options['provider']);
313  $options ??= [];
314  if ($provider === null && ($options['source'] ?? false)) {
315  $provider = $iconRegistry->‪detectIconProvider($options['source']);
316  }
317  if ($provider === null) {
318  continue;
319  }
320  $iconRegistry->‪registerIcon($icon, $provider, $options);
321  }
322  return $iconRegistry;
323  }
324 
325  public static function ‪getIcons(ContainerInterface $container): ArrayObject
326  {
327  return new ArrayObject();
328  }
329 
330  public static function ‪getIconRegistry(ContainerInterface $container): Imaging\‪IconRegistry
331  {
332  return ‪self::new($container, Imaging\IconRegistry::class, [$container->get('cache.assets'), $container->get(Package\Cache\PackageDependentCacheIdentifier::class)->withPrefix('BackendIcons')->toString()]);
333  }
334 
338  public static function ‪getGlobalPageTsConfig(ContainerInterface $container): ArrayObject
339  {
340  return new ArrayObject();
341  }
342 
346  public static function ‪configurePageTsConfigLoader(ContainerInterface $container, ‪PageTsConfigLoader $configLoader): ‪PageTsConfigLoader
347  {
348  $cache = $container->get('cache.core');
349 
350  $cacheIdentifier = $container->get(Package\Cache\PackageDependentCacheIdentifier::class)->withPrefix('globalPageTsConfig')->toString();
351  if (!$cache->has($cacheIdentifier)) {
352  $pageTsConfigFiles = $container->get('globalPageTsConfig')->getArrayCopy();
353  $pageTsConfigFiles = implode("\n", $pageTsConfigFiles);
354  $cache->set($cacheIdentifier, 'return ' . var_export($pageTsConfigFiles, true) . ';');
355  } else {
356  $pageTsConfigFiles = $cache->require($cacheIdentifier);
357  }
358 
359  $configLoader->‪setGlobalTsConfig($pageTsConfigFiles);
360  return $configLoader;
361  }
362 
363  public static function ‪getLanguageServiceFactory(ContainerInterface $container): Localization\LanguageServiceFactory
364  {
365  return ‪self::new($container, Localization\LanguageServiceFactory::class, [
366  $container->get(Localization\Locales::class),
367  $container->get(Localization\LocalizationFactory::class),
368  $container->get(Cache\CacheManager::class)->getCache('runtime'),
369  ]);
370  }
371 
372  public static function ‪getLanguageStore(ContainerInterface $container): Localization\LanguageStore
373  {
374  return ‪self::new($container, Localization\LanguageStore::class, [$container->get(PackageManager::class)]);
375  }
376 
377  public static function ‪getLocales(ContainerInterface $container): Localization\Locales
378  {
379  return ‪self::new($container, Localization\Locales::class);
380  }
381 
382  public static function ‪getLocalizationFactory(ContainerInterface $container): Localization\LocalizationFactory
383  {
384  return ‪self::new($container, Localization\LocalizationFactory::class, [
385  $container->get(Localization\LanguageStore::class),
386  $container->get(Cache\CacheManager::class),
387  ]);
388  }
389 
390  public static function ‪getMailTransportFactory(ContainerInterface $container): Mail\TransportFactory
391  {
392  return ‪self::new($container, Mail\TransportFactory::class, [
393  $container->get(SymfonyEventDispatcher::class),
394  $container->get(Log\LogManager::class),
395  ]);
396  }
397 
398  public static function ‪getFlashMessageService(ContainerInterface $container): Messaging\FlashMessageService
399  {
400  return ‪self::new($container, Messaging\FlashMessageService::class);
401  }
402 
403  public static function ‪getResponsePropagationMiddleware(ContainerInterface $container): Middleware\ResponsePropagation
404  {
405  return ‪self::new($container, Middleware\ResponsePropagation::class);
406  }
407 
408  public static function ‪getVerifyHostHeaderMiddleware(ContainerInterface $container): Middleware\VerifyHostHeader
409  {
410  return ‪self::new($container, Middleware\VerifyHostHeader::class, [
411  ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] ?? '',
412  ]);
413  }
414 
415  public static function ‪getFailsafePackageManager(ContainerInterface $container): Package\FailsafePackageManager
416  {
417  $packageManager = $container->get(Package\PackageManager::class);
418  if ($packageManager instanceof Package\FailsafePackageManager) {
419  return $packageManager;
420  }
421  throw new \RuntimeException('FailsafePackageManager can only be instantiated in failsafe (maintenance tool) mode.', 1586861816);
422  }
423 
424  public static function ‪getPackageDependentCacheIdentifier(ContainerInterface $container): Package\Cache\PackageDependentCacheIdentifier
425  {
426  return new ‪Package\Cache\PackageDependentCacheIdentifier($container->get(Package\PackageManager::class));
427  }
428 
429  public static function ‪getRegistry(ContainerInterface $container): ‪Registry
430  {
431  return ‪self::new($container, Registry::class);
432  }
433 
434  public static function ‪getFileIndexRepository(ContainerInterface $container): Resource\Index\FileIndexRepository
435  {
436  return ‪self::new($container, Resource\Index\FileIndexRepository::class, [
437  $container->get(EventDispatcherInterface::class),
438  ]);
439  }
440 
441  public static function ‪getMetaDataRepository(ContainerInterface $container): Resource\Index\MetaDataRepository
442  {
443  return ‪self::new($container, Resource\Index\MetaDataRepository::class, [
444  $container->get(EventDispatcherInterface::class),
445  ]);
446  }
447 
448  public static function ‪getDriverRegistry(ContainerInterface $container): Resource\Driver\DriverRegistry
449  {
450  return ‪self::new($container, Resource\Driver\DriverRegistry::class);
451  }
452 
453  public static function ‪getProcessedFileRepository(ContainerInterface $container): Resource\ProcessedFileRepository
454  {
455  return ‪self::new($container, Resource\ProcessedFileRepository::class);
456  }
457 
458  public static function ‪getResourceFactory(ContainerInterface $container): Resource\ResourceFactory
459  {
460  return ‪self::new($container, Resource\ResourceFactory::class, [
461  $container->get(Resource\StorageRepository::class),
462  ]);
463  }
464 
465  public static function ‪getStorageRepository(ContainerInterface $container): Resource\StorageRepository
466  {
467  return ‪self::new($container, Resource\StorageRepository::class, [
468  $container->get(EventDispatcherInterface::class),
469  $container->get(Resource\Driver\DriverRegistry::class),
470  ]);
471  }
472 
473  public static function ‪getDependencyOrderingService(ContainerInterface $container): Service\DependencyOrderingService
474  {
475  return new Service\DependencyOrderingService();
476  }
477 
478  public static function ‪getFlexFormService(ContainerInterface $container): Service\FlexFormService
479  {
480  return ‪self::new($container, Service\FlexFormService::class);
481  }
482 
483  public static function ‪getOpcodeCacheService(ContainerInterface $container): Service\OpcodeCacheService
484  {
485  return ‪self::new($container, Service\OpcodeCacheService::class);
486  }
487 
488  public static function ‪getTimeTracker(ContainerInterface $container): TimeTracker\TimeTracker
489  {
490  return ‪self::new($container, TimeTracker\TimeTracker::class);
491  }
492 
493  public static function ‪getTypoScriptStringFactory(ContainerInterface $container): TypoScript\TypoScriptStringFactory
494  {
495  return new ‪TypoScript\TypoScriptStringFactory($container, new ‪LossyTokenizer());
496  }
497 
498  public static function ‪getTypoScriptService(ContainerInterface $container): TypoScript\TypoScriptService
499  {
500  return ‪self::new($container, TypoScript\TypoScriptService::class);
501  }
502 
503  public static function ‪getAstTraverser(ContainerInterface $container): TypoScript\AST\Traverser\AstTraverser
504  {
505  return ‪self::new($container, TypoScript\AST\Traverser\AstTraverser::class);
506  }
507 
508  public static function ‪getCommentAwareAstBuilder(ContainerInterface $container): TypoScript\AST\CommentAwareAstBuilder
509  {
510  return ‪self::new($container, TypoScript\AST\CommentAwareAstBuilder::class, [
511  $container->get(EventDispatcherInterface::class),
512  ]);
513  }
514 
515  public static function ‪getLosslessTokenizer(ContainerInterface $container): TypoScript\Tokenizer\LosslessTokenizer
516  {
517  return ‪self::new($container, TypoScript\Tokenizer\LosslessTokenizer::class);
518  }
519 
520  public static function ‪getBackendEntryPointResolver(ContainerInterface $container): Routing\BackendEntryPointResolver
521  {
522  return ‪self::new($container, Routing\BackendEntryPointResolver::class);
523  }
524 
525  public static function ‪getRequestContextFactory(ContainerInterface $container): Routing\RequestContextFactory
526  {
527  return ‪self::new($container, Routing\RequestContextFactory::class, [
528  $container->get(Routing\BackendEntryPointResolver::class),
529  ]);
530  }
531 
532  public static function ‪getFormProtectionFactory(ContainerInterface $container): FormProtection\FormProtectionFactory
533  {
534  return ‪self::new(
535  $container,
536  FormProtection\FormProtectionFactory::class,
537  [
538  $container->get(Messaging\FlashMessageService::class),
539  $container->get(Localization\LanguageServiceFactory::class),
540  $container->get(Registry::class),
541  $container->get(CacheManager::class)->getCache('runtime'),
542  ]
543  );
544  }
545 
546  public static function ‪getGuzzleClientFactory(ContainerInterface $container): Http\Client\GuzzleClientFactory
547  {
549  }
550 
551  public static function ‪getRequestFactory(ContainerInterface $container): Http\RequestFactory
552  {
553  return new ‪Http\RequestFactory(
554  $container->get(Http\Client\GuzzleClientFactory::class)
555  );
556  }
557 
558  public static function ‪getMiddlewareStackResolver(ContainerInterface $container): Http\MiddlewareStackResolver
559  {
561  $container,
562  $container->get(Service\DependencyOrderingService::class),
563  $container->get('cache.core'),
564  $container->get(Package\Cache\PackageDependentCacheIdentifier::class)->toString(),
565  );
566  }
567 
568  public static function ‪getMiddlewares(ContainerInterface $container): ArrayObject
569  {
570  return new ArrayObject();
571  }
572 
573  public static function ‪getContentSecurityPolicies(ContainerInterface $container): ‪Map
574  {
575  return new ‪Map();
576  }
577 
578  public static function ‪provideFallbackEventDispatcher(
579  ContainerInterface $container,
580  EventDispatcherInterface $eventDispatcher = null
581  ): EventDispatcherInterface {
582  // Provide a dummy / empty event dispatcher for the install tool when $eventDispatcher is null (that means when we run without symfony DI)
583  return $eventDispatcher ?? new ‪EventDispatcher\EventDispatcher(
584  new EventDispatcher\ListenerProvider($container)
585  );
586  }
587 
588  public static function ‪configureCommands(ContainerInterface $container, Console\CommandRegistry $commandRegistry): Console\CommandRegistry
589  {
590  $commandRegistry->addLazyCommand('list', Command\ListCommand::class, 'Lists commands');
591 
592  $commandRegistry->addLazyCommand('help', HelpCommand::class, 'Displays help for a command');
593 
594  $commandRegistry->addLazyCommand('cache:warmup', Command\CacheWarmupCommand::class, 'Cache warmup for all, system or, if implemented, frontend caches.');
595 
596  $commandRegistry->addLazyCommand('cache:flush', Command\CacheFlushCommand::class, 'Cache clearing for all, system or frontend caches.');
597 
598  $commandRegistry->addLazyCommand('dumpautoload', Command\DumpAutoloadCommand::class, 'Updates class loading information in non-composer mode.', ‪Environment::isComposerMode());
599  $commandRegistry->addLazyCommand('extensionmanager:extension:dumpclassloadinginformation', Command\DumpAutoloadCommand::class, null, ‪Environment::isComposerMode(), false, 'dumpautoload');
600  $commandRegistry->addLazyCommand('extension:dumpclassloadinginformation', Command\DumpAutoloadCommand::class, null, ‪Environment::isComposerMode(), false, 'dumpautoload');
601 
602  return $commandRegistry;
603  }
604 }
‪TYPO3\CMS\Core\Command\ListCommand
Definition: ListCommand.php:34
‪TYPO3\CMS\Core\ServiceProvider\getBootService
‪static getBootService(ContainerInterface $container)
Definition: ServiceProvider.php:274
‪TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory
Definition: PasswordHashFactory.php:27
‪TYPO3\CMS\Core\ServiceProvider\getBackendEntryPointResolver
‪static getBackendEntryPointResolver(ContainerInterface $container)
Definition: ServiceProvider.php:520
‪TYPO3\CMS\Core\Package\AbstractServiceProvider
Definition: AbstractServiceProvider.php:36
‪TYPO3\CMS\Core\Command\DumpAutoloadCommand
Definition: DumpAutoloadCommand.php:31
‪TYPO3\CMS\Core\Configuration\Loader\PageTsConfigLoader\setGlobalTsConfig
‪setGlobalTsConfig(string $globalTsConfig)
Definition: PageTsConfigLoader.php:55
‪TYPO3\CMS\Core\ServiceProvider\getRequestContextFactory
‪static getRequestContextFactory(ContainerInterface $container)
Definition: ServiceProvider.php:525
‪TYPO3\CMS\Core\ServiceProvider\getHelpCommand
‪static getHelpCommand(ContainerInterface $container)
Definition: ServiceProvider.php:187
‪TYPO3\CMS\Core\Command\CacheWarmupCommand
Definition: CacheWarmupCommand.php:37
‪TYPO3\CMS\Core\ServiceProvider\configureCommands
‪static configureCommands(ContainerInterface $container, Console\CommandRegistry $commandRegistry)
Definition: ServiceProvider.php:588
‪TYPO3\CMS\Core\ServiceProvider\getGlobalPageTsConfig
‪static getGlobalPageTsConfig(ContainerInterface $container)
Definition: ServiceProvider.php:338
‪TYPO3\CMS\Core\ServiceProvider\getCacheFlushCommand
‪static getCacheFlushCommand(ContainerInterface $container)
Definition: ServiceProvider.php:192
‪TYPO3\CMS\Core\Command\CacheFlushCommand
Definition: CacheFlushCommand.php:35
‪TYPO3\CMS\Core\ServiceProvider\getFlexFormService
‪static getFlexFormService(ContainerInterface $container)
Definition: ServiceProvider.php:478
‪TYPO3\CMS\Core\ServiceProvider\getOpcodeCacheService
‪static getOpcodeCacheService(ContainerInterface $container)
Definition: ServiceProvider.php:483
‪TYPO3\CMS\Core\ServiceProvider\getMiddlewareStackResolver
‪static getMiddlewareStackResolver(ContainerInterface $container)
Definition: ServiceProvider.php:558
‪TYPO3\CMS\Core\ServiceProvider\getFailsafePackageManager
‪static getFailsafePackageManager(ContainerInterface $container)
Definition: ServiceProvider.php:415
‪TYPO3\CMS\Core\ServiceProvider\getPackageName
‪static getPackageName()
Definition: ServiceProvider.php:46
‪TYPO3\CMS\Core\Core\Environment\isComposerMode
‪static isComposerMode()
Definition: Environment.php:137
‪TYPO3\CMS\Core\Registry
Definition: Registry.php:33
‪TYPO3\CMS\Core\ServiceProvider\getTypoScriptStringFactory
‪static getTypoScriptStringFactory(ContainerInterface $container)
Definition: ServiceProvider.php:493
‪TYPO3\CMS\Core\Package\Cache\PackageDependentCacheIdentifier
Definition: PackageDependentCacheIdentifier.php:30
‪TYPO3\CMS\Core\Configuration\Loader\PageTsConfigLoader
Definition: PageTsConfigLoader.php:42
‪TYPO3\CMS\Core\Http\MiddlewareStackResolver
Definition: MiddlewareStackResolver.php:32
‪TYPO3\CMS\Core\ServiceProvider\getConsoleCommandRegistry
‪static getConsoleCommandRegistry(ContainerInterface $container)
Definition: ServiceProvider.php:227
‪TYPO3\CMS\Core\ServiceProvider\getAstTraverser
‪static getAstTraverser(ContainerInterface $container)
Definition: ServiceProvider.php:503
‪TYPO3\CMS\Core\Package\AbstractServiceProvider\new
‪static mixed new(ContainerInterface $container, string $className, array $constructorArguments=[])
Definition: AbstractServiceProvider.php:207
‪TYPO3\CMS\Core\ServiceProvider\getListCommand
‪static getListCommand(ContainerInterface $container)
Definition: ServiceProvider.php:179
‪TYPO3\CMS\Core\Http\Client\GuzzleClientFactory
Definition: GuzzleClientFactory.php:28
‪TYPO3\CMS\Core\Core\BootService
Definition: BootService.php:32
‪TYPO3\CMS\Core\ServiceProvider\getDependencyOrderingService
‪static getDependencyOrderingService(ContainerInterface $container)
Definition: ServiceProvider.php:473
‪TYPO3\CMS\Core\Context\Context
Definition: Context.php:55
‪TYPO3\CMS\Core\ServiceProvider\configureIconRegistry
‪static configureIconRegistry(ContainerInterface $container, IconRegistry $iconRegistry)
Definition: ServiceProvider.php:299
‪TYPO3\CMS\Core\ServiceProvider\getTimeTracker
‪static getTimeTracker(ContainerInterface $container)
Definition: ServiceProvider.php:488
‪TYPO3\CMS\Core\Console\CommandApplication
Definition: CommandApplication.php:42
‪TYPO3\CMS\Core\Core\Environment\getConfigPath
‪static getConfigPath()
Definition: Environment.php:212
‪TYPO3\CMS\Core\ServiceProvider\getDriverRegistry
‪static getDriverRegistry(ContainerInterface $container)
Definition: ServiceProvider.php:448
‪TYPO3\CMS\Core\Console\CommandRegistry
Definition: CommandRegistry.php:31
‪TYPO3\CMS\Core\ServiceProvider\getSiteConfiguration
‪static getSiteConfiguration(ContainerInterface $container)
Definition: ServiceProvider.php:170
‪TYPO3\CMS\Core\ServiceProvider\getProcessedFileRepository
‪static getProcessedFileRepository(ContainerInterface $container)
Definition: ServiceProvider.php:453
‪TYPO3\CMS\Core\ServiceProvider\getDumpAutoloadCommand
‪static getDumpAutoloadCommand(ContainerInterface $container)
Definition: ServiceProvider.php:210
‪TYPO3\CMS\Core\ServiceProvider\getSymfonyEventDispatcher
‪static getSymfonyEventDispatcher(ContainerInterface $container)
Definition: ServiceProvider.php:125
‪TYPO3\CMS\Core\ServiceProvider\getPasswordHashFactory
‪static getPasswordHashFactory(ContainerInterface $container)
Definition: ServiceProvider.php:285
‪TYPO3\CMS\Core\ServiceProvider\getContentSecurityPolicies
‪static getContentSecurityPolicies(ContainerInterface $container)
Definition: ServiceProvider.php:573
‪TYPO3\CMS\Core\ServiceProvider\getEventDispatcher
‪static getEventDispatcher(ContainerInterface $container)
Definition: ServiceProvider.php:232
‪TYPO3\CMS\Core\ServiceProvider\getResponsePropagationMiddleware
‪static getResponsePropagationMiddleware(ContainerInterface $container)
Definition: ServiceProvider.php:403
‪TYPO3\CMS\Core\ServiceProvider\getIconFactory
‪static getIconFactory(ContainerInterface $container)
Definition: ServiceProvider.php:290
‪TYPO3\CMS\Core\ServiceProvider\getIcons
‪static getIcons(ContainerInterface $container)
Definition: ServiceProvider.php:325
‪TYPO3\CMS\Core\EventDispatcher\EventDispatcher
Definition: EventDispatcher.php:30
‪TYPO3\CMS\Core\ServiceProvider\getIconRegistry
‪static getIconRegistry(ContainerInterface $container)
Definition: ServiceProvider.php:330
‪TYPO3\CMS\Core\ServiceProvider\getLocales
‪static getLocales(ContainerInterface $container)
Definition: ServiceProvider.php:377
‪TYPO3\CMS\Core\ServiceProvider\getStorageRepository
‪static getStorageRepository(ContainerInterface $container)
Definition: ServiceProvider.php:465
‪TYPO3\CMS\Core\ServiceProvider
Definition: ServiceProvider.php:40
‪TYPO3\CMS\Core\ServiceProvider\getRegistry
‪static getRegistry(ContainerInterface $container)
Definition: ServiceProvider.php:429
‪TYPO3\CMS\Core\ServiceProvider\getCacheManager
‪static getCacheManager(ContainerInterface $container)
Definition: ServiceProvider.php:132
‪TYPO3\CMS\Core\Imaging\IconRegistry\registerIcon
‪registerIcon($identifier, $iconProviderClassName, array $options=[])
Definition: IconRegistry.php:329
‪TYPO3\CMS\Core\ServiceProvider\getMailTransportFactory
‪static getMailTransportFactory(ContainerInterface $container)
Definition: ServiceProvider.php:390
‪TYPO3\CMS\Core\Imaging\IconRegistry
Definition: IconRegistry.php:32
‪TYPO3\CMS\Core\Cache\CacheManager
Definition: CacheManager.php:36
‪TYPO3\CMS\Core\ServiceProvider\getConsoleCommandApplication
‪static getConsoleCommandApplication(ContainerInterface $container)
Definition: ServiceProvider.php:215
‪TYPO3\CMS\Core
‪TYPO3\CMS\Core\ServiceProvider\getFlashMessageService
‪static getFlashMessageService(ContainerInterface $container)
Definition: ServiceProvider.php:398
‪TYPO3\CMS\Core\ServiceProvider\getFactories
‪getFactories()
Definition: ServiceProvider.php:51
‪TYPO3\CMS\Core\ServiceProvider\getConnectionPool
‪static getConnectionPool(ContainerInterface $container)
Definition: ServiceProvider.php:156
‪TYPO3\CMS\Core\ServiceProvider\getPackagePath
‪static getPackagePath()
Definition: ServiceProvider.php:41
‪TYPO3\CMS\Core\Http\RequestFactory
Definition: RequestFactory.php:30
‪TYPO3\CMS\Core\ServiceProvider\getCharsetConverter
‪static getCharsetConverter(ContainerInterface $container)
Definition: ServiceProvider.php:165
‪TYPO3\CMS\Core\Adapter\EventDispatcherAdapter
Definition: EventDispatcherAdapter.php:24
‪TYPO3\CMS\Core\ServiceProvider\getCacheWarmupCommand
‪static getCacheWarmupCommand(ContainerInterface $container)
Definition: ServiceProvider.php:200
‪TYPO3\CMS\Core\ServiceProvider\getMiddlewares
‪static getMiddlewares(ContainerInterface $container)
Definition: ServiceProvider.php:568
‪TYPO3\CMS\Core\ServiceProvider\getFormProtectionFactory
‪static getFormProtectionFactory(ContainerInterface $container)
Definition: ServiceProvider.php:532
‪TYPO3\CMS\Core\ServiceProvider\getPackageDependentCacheIdentifier
‪static getPackageDependentCacheIdentifier(ContainerInterface $container)
Definition: ServiceProvider.php:424
‪TYPO3\CMS\Core\ServiceProvider\provideFallbackEventDispatcher
‪static provideFallbackEventDispatcher(ContainerInterface $container, EventDispatcherInterface $eventDispatcher=null)
Definition: ServiceProvider.php:578
‪TYPO3\CMS\Core\ServiceProvider\getCommentAwareAstBuilder
‪static getCommentAwareAstBuilder(ContainerInterface $container)
Definition: ServiceProvider.php:508
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\ServiceProvider\getMetaDataRepository
‪static getMetaDataRepository(ContainerInterface $container)
Definition: ServiceProvider.php:441
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:41
‪TYPO3\CMS\Core\ServiceProvider\getLanguageStore
‪static getLanguageStore(ContainerInterface $container)
Definition: ServiceProvider.php:372
‪TYPO3\CMS\Core\ServiceProvider\getTypoScriptService
‪static getTypoScriptService(ContainerInterface $container)
Definition: ServiceProvider.php:498
‪TYPO3\CMS\Core\ServiceProvider\getResourceFactory
‪static getResourceFactory(ContainerInterface $container)
Definition: ServiceProvider.php:458
‪TYPO3\CMS\Core\ServiceProvider\getExtensions
‪getExtensions()
Definition: ServiceProvider.php:113
‪TYPO3\CMS\Core\ServiceProvider\configurePageTsConfigLoader
‪static configurePageTsConfigLoader(ContainerInterface $container, PageTsConfigLoader $configLoader)
Definition: ServiceProvider.php:346
‪TYPO3\CMS\Core\ServiceProvider\getRequestFactory
‪static getRequestFactory(ContainerInterface $container)
Definition: ServiceProvider.php:551
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:51
‪TYPO3\CMS\Core\ServiceProvider\getEventListenerProvider
‪static getEventListenerProvider(ContainerInterface $container)
Definition: ServiceProvider.php:239
‪TYPO3\CMS\Core\Imaging\IconRegistry\detectIconProvider
‪string detectIconProvider($iconReference)
Definition: IconRegistry.php:560
‪TYPO3\CMS\Core\ServiceProvider\getLosslessTokenizer
‪static getLosslessTokenizer(ContainerInterface $container)
Definition: ServiceProvider.php:515
‪TYPO3\CMS\Core\Type\Map
Definition: Map.php:47
‪TYPO3\CMS\Core\ServiceProvider\extendEventListenerProvider
‪static extendEventListenerProvider(ContainerInterface $container, EventDispatcher\ListenerProvider $listenerProvider)
Definition: ServiceProvider.php:244
‪TYPO3\CMS\Core\TypoScript\TypoScriptStringFactory
Definition: TypoScriptStringFactory.php:37
‪TYPO3\CMS\Core\ServiceProvider\getLocalizationFactory
‪static getLocalizationFactory(ContainerInterface $container)
Definition: ServiceProvider.php:382
‪TYPO3\CMS\Core\EventDispatcher\ListenerProvider
Definition: ListenerProvider.php:30
‪TYPO3\CMS\Core\ServiceProvider\getVerifyHostHeaderMiddleware
‪static getVerifyHostHeaderMiddleware(ContainerInterface $container)
Definition: ServiceProvider.php:408
‪TYPO3\CMS\Core\TypoScript\Tokenizer\LossyTokenizer
Definition: LossyTokenizer.php:57
‪TYPO3\CMS\Core\ServiceProvider\getLanguageServiceFactory
‪static getLanguageServiceFactory(ContainerInterface $container)
Definition: ServiceProvider.php:363
‪TYPO3\CMS\Core\ServiceProvider\getContext
‪static getContext(ContainerInterface $container)
Definition: ServiceProvider.php:269
‪TYPO3\CMS\Core\ServiceProvider\getGuzzleClientFactory
‪static getGuzzleClientFactory(ContainerInterface $container)
Definition: ServiceProvider.php:546
‪TYPO3\CMS\Core\ServiceProvider\getFileIndexRepository
‪static getFileIndexRepository(ContainerInterface $container)
Definition: ServiceProvider.php:434