‪TYPO3CMS  9.5
ProviderConfigurationLoader.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
3 
5 
7 use TYPO3\CMS\Core\Package\PackageManager;
10 
16 {
17  protected ‪$cacheIdentifier = 'expressionLanguageProviders';
18 
23  public function ‪getExpressionLanguageProviders(): array
24  {
25  $packageManager = GeneralUtility::makeInstance(
26  PackageManager::class,
27  GeneralUtility::makeInstance(DependencyOrderingService::class)
28  );
29  $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_core');
30 
31  if ($cache->has($this->cacheIdentifier)) {
33  return $cache->require($this->cacheIdentifier);
34  }
35 
36  $packages = $packageManager->getActivePackages();
37  $providers = [];
38  foreach ($packages as $package) {
39  $packageConfiguration = $package->getPackagePath() . 'Configuration/ExpressionLanguage.php';
40  if (file_exists($packageConfiguration)) {
41  $providersInPackage = require $packageConfiguration;
42  if (is_array($providersInPackage)) {
43  $providers[] = $providersInPackage;
44  }
45  }
46  }
47  $providers = count($providers) > 0 ? array_merge_recursive(...$providers) : $providers;
48  $cache->set($this->cacheIdentifier, 'return ' . var_export($providers, true) . ';');
49  return $providers ?? [];
50  }
51 }
‪TYPO3\CMS\Core\ExpressionLanguage\ProviderConfigurationLoader\getExpressionLanguageProviders
‪array getExpressionLanguageProviders()
Definition: ProviderConfigurationLoader.php:23
‪TYPO3\CMS\Core\Cache\CacheManager
Definition: CacheManager.php:34
‪TYPO3\CMS\Core\Service\DependencyOrderingService
Definition: DependencyOrderingService.php:31
‪TYPO3\CMS\Core\ExpressionLanguage\ProviderConfigurationLoader
Definition: ProviderConfigurationLoader.php:16
‪TYPO3\CMS\Core\ExpressionLanguage
Definition: AbstractProvider.php:3
‪TYPO3\CMS\Core\ExpressionLanguage\ProviderConfigurationLoader\$cacheIdentifier
‪$cacheIdentifier
Definition: ProviderConfigurationLoader.php:17
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45