Commit 7f81dbb4 authored by Thomas Löffler's avatar Thomas Löffler

Adds function to generate extensions.md5 file

parent c5de7e99
Pipeline #2076 passed with stages
in 1 minute and 25 seconds
......@@ -31,8 +31,9 @@ class UpdateCurrentVersionListTask extends \TYPO3\CMS\Extbase\Scheduler\Task
{
$resultCoreData = $this->fetchCurrentCoreData();
$resultDocsData = $this->fetchCurrentDocumentationData();
$resultExtensionFiles = $this->generateExtensionFilesForExtensionManager();
return $resultCoreData && $resultDocsData;
return $resultCoreData && $resultDocsData && $resultExtensionFiles;
}
/**
......@@ -64,4 +65,35 @@ class UpdateCurrentVersionListTask extends \TYPO3\CMS\Extbase\Scheduler\Task
return $result;
}
/**
* This command generates the central extensions.xml.gz file to run
* with every Extension Manager in TYPO3 installations
*
* @return bool
* @throws \Exception
*/
protected function generateExtensionFilesForExtensionManager(): bool
{
// Check extension configuration
if (empty($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['ter'])) {
throw new \Exception('No extension configuration found in $TYPO3_CONF_VARS', 1303220916);
}
// Check extension repository path
$extensionConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['ter']);
if (empty($extensionConfig['repositoryDir'])) {
throw new \Exception('No repository path found in extension configuration', 1303220917);
}
// Write new extensions xml file
$repositoryDir = rtrim($extensionConfig['repositoryDir'], '/') . '/';
$dummyObject = new \stdClass();
$dummyObject->repositoryDir = $repositoryDir;
/** @var \tx_ter_helper $terHelper */
$terHelper = GeneralUtility::makeInstance(\tx_ter_helper::class, $dummyObject);
$terHelper->writeExtensionIndexFile();
return true;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment