2 declare(strict_types = 1);
7 use TYPO3\CMS\Core\Package\PackageManager;
25 $packageManager = GeneralUtility::makeInstance(
26 PackageManager::class,
27 GeneralUtility::makeInstance(DependencyOrderingService::class)
29 $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache(
'cache_core');
31 if ($cache->has($this->cacheIdentifier)) {
33 return $cache->require($this->cacheIdentifier);
36 $packages = $packageManager->getActivePackages();
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;
47 $providers = count($providers) > 0 ? array_merge_recursive(...$providers) : $providers;
48 $cache->set($this->cacheIdentifier,
'return ' . var_export($providers,
true) .
';');
49 return $providers ?? [];