/** * Constructs emConf and writes it to corresponding file * In case the file has been extracted already, the properties of the meta data take precedence but are merged with the present ext_emconf.php * * @param array $extensionData * @param string $rootPath * @param Extension $extension * @return void */ protected function writeEmConfToFile(array $extensionData, $rootPath, Extension $extension = null) { $emConfFileData = array(); if (file_exists($rootPath . 'ext_emconf.php')) { $emConfFileData = $this->emConfUtility->includeEmConf(array('key' => $extensionData['extKey'], 'siteRelPath' => PathUtility::stripPathSitePrefix($rootPath))); } $extensionData['EM_CONF'] = array_replace_recursive($emConfFileData, $extensionData['EM_CONF']); $emConfContent = $this->emConfUtility->constructEmConf($extensionData, $extension); GeneralUtility::writeFile($rootPath . 'ext_emconf.php', $emConfContent); }
/** * Adds the information from the emconf array to the extension information * * @param array $extensions * @return array */ public function enrichExtensionsWithEmConfInformation(array $extensions) { foreach ($extensions as $extensionKey => $properties) { $emconf = $this->emConfUtility->includeEmConf($properties); if ($emconf) { $extensions[$extensionKey] = array_merge($emconf, $properties); } else { unset($extensions[$extensionKey]); } } return $extensions; }
/** * Adds the information from the emconf array to the extension information * * @param array $extensions * @return array */ public function enrichExtensionsWithEmConfAndTerInformation(array $extensions) { foreach ($extensions as $extensionKey => $properties) { $emconf = $this->emConfUtility->includeEmConf($properties); if ($emconf) { $extensions[$extensionKey] = array_merge($emconf, $properties); $terObject = $this->extensionRepository->findOneByExtensionKeyAndVersion($extensionKey, $extensions[$extensionKey]['version']); if ($terObject instanceof \TYPO3\CMS\Extensionmanager\Domain\Model\Extension) { $extensions[$extensionKey]['terObject'] = $terObject; $extensions[$extensionKey]['updateAvailable'] = $this->installUtility->isUpdateAvailable($terObject); } } else { unset($extensions[$extensionKey]); } } return $extensions; }
/** * Adds the information from the emconf array to the extension information * * @param array $extensions * @return array */ public function enrichExtensionsWithEmConfAndTerInformation(array $extensions) { foreach ($extensions as $extensionKey => $properties) { $emconf = $this->emConfUtility->includeEmConf($properties); if ($emconf) { $extensions[$extensionKey] = array_merge($emconf, $properties); $terObject = $this->getExtensionTerData($extensionKey, $extensions[$extensionKey]['version']); if ($terObject !== NULL) { $extensions[$extensionKey]['terObject'] = $terObject; $extensions[$extensionKey]['updateAvailable'] = FALSE; $extensions[$extensionKey]['updateToVersion'] = NULL; $extensionToUpdate = $this->installUtility->getUpdateableVersion($terObject); if ($extensionToUpdate !== FALSE) { $extensions[$extensionKey]['updateAvailable'] = TRUE; $extensions[$extensionKey]['updateToVersion'] = $extensionToUpdate; } } } else { unset($extensions[$extensionKey]); } } return $extensions; }
/** * Checks whether the available version is compatible * * @param Dependency $dependency * @return bool */ protected function isAvailableVersionCompatible(Dependency $dependency) { $this->setAvailableExtensions(); $extensionData = $this->emConfUtility->includeEmConf($this->availableExtensions[$dependency->getIdentifier()]); return $this->isVersionCompatible($extensionData['version'], $dependency); }
/** * Get array of installed extensions. * * @param string $type Local, System, Global or empty (for all) * * @throws InvalidArgumentException * @return array */ public function listExtensions($type = '') { $type = ucfirst(strtolower($type)); if (!empty($type) && $type !== 'Local' && $type !== 'Global' && $type !== 'System') { throw new InvalidArgumentException('Only "Local", "System", "Global" and "" (all) are supported as type'); } $this->initializeExtensionManagerObjects(); // TODO: Make listUtlity local var $extensions = $this->listUtility->getAvailableExtensions(); $list = array(); foreach ($extensions as $key => $extension) { if (!empty($type) && $type !== $extension['type'] || !$this->installUtility->isLoaded($extension['key'])) { continue; } // TODO: Make emConfUtility local var $configuration = $this->emConfUtility->includeEmConf($extension); if (!empty($configuration)) { $list[$key] = $configuration; } } ksort($list); return $list; }