/**
  * Reload Cache files and Typo3LoadedExtensions
  *
  * @return void
  */
 public function reloadCaches()
 {
     // Reload class aliases defined in Migrations/Code/ClassAliasMap.php
     \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->getEarlyInstance('TYPO3\\CMS\\Core\\Core\\ClassLoader')->setPackages($this->packageManager->getActivePackages());
     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadExtLocalconf(FALSE);
     \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadExtensionTables(FALSE);
 }
 /**
  * Warm up essential caches such as class and core caches
  *
  * @param bool $triggerRequire
  * @return bool
  */
 public function warmupEssentialCaches($triggerRequire = FALSE)
 {
     try {
         $this->cacheManager->getCache('cache_classes');
     } catch (NoSuchCacheException $e) {
         $this->logger->warning('Warmup skipped due to lack of classes cache');
         return FALSE;
     }
     // TODO: This currently only builds the classes cache! Find a way to build other system caches as well (like reflection caches, datamap caches …)
     // package namespace and aliases caches are implicitly built in extended bootstrap before we reach this point
     $phpParser = new PhpParser();
     foreach ($this->packageManager->getActivePackages() as $package) {
         $classFiles = GeneralUtility::getAllFilesAndFoldersInPath(array(), $package->getClassesPath(), 'php');
         foreach ($classFiles as $classFile) {
             try {
                 $parsedResult = $phpParser->parseClassFile($classFile);
                 $this->writeCacheEntryForClass($parsedResult->getFullyQualifiedClassName(), $classFile);
             } catch (ParsingException $e) {
                 $this->logger->warning('Class file "' . PathUtility::stripPathSitePrefix($classFile) . '" does not contain a class definition. Skipping …');
             }
         }
     }
     $this->packageManager->injectCoreCache($this->cacheManager->getCache('cache_core'));
     $this->packageManager->populatePackageCache();
     return TRUE;
 }
Exemple #3
0
	/**
	 * Enrich the output of getAvailableExtensions() with an array key installed = 1 if an extension is loaded.
	 *
	 * @param array $availableExtensions
	 * @return array
	 */
	public function getAvailableAndInstalledExtensions(array $availableExtensions) {
		foreach ($this->packageManager->getActivePackages() as $extKey => $_) {
			if (isset($availableExtensions[$extKey])) {
				$availableExtensions[$extKey]['installed'] = TRUE;
			}
		}
		return $availableExtensions;
	}
 /**
  * Gets an array of loaded extension keys
  *
  * @return array Loaded extensions
  */
 public static function getLoadedExtensionListArray()
 {
     return array_keys(static::$packageManager->getActivePackages());
 }