diff --git a/administrator/components/com_joomlaupdate/extract.php b/administrator/components/com_joomlaupdate/extract.php index c59dc7b01625f..9328a57beea0c 100644 --- a/administrator/components/com_joomlaupdate/extract.php +++ b/administrator/components/com_joomlaupdate/extract.php @@ -1942,8 +1942,44 @@ function getConfiguration(): ?array $configuration = getConfiguration(); $enabled = !empty($configuration); +/** + * Sets the PHP timeout to 3600 seconds + * + * @return void + * @since __DEPLOY_VERSION__ + */ +function setLongTimeout() +{ + if (!function_exists('ini_set')) + { + return; + } + + ini_set('max_execution_time', 3600); +} + +/** + * Sets the memory limit to 1GiB + * + * @return void + * @since __DEPLOY_VERSION__ + */ +function setHugeMemoryLimit() +{ + if (!function_exists('ini_set')) + { + return; + } + + ini_set('memory_limit', 1073741824); +} + if ($enabled) { + // Try to set a very large memory and timeout limit + setLongTimeout(); + setHugeMemoryLimit(); + $sourcePath = $configuration['setup.sourcepath'] ?? ''; $sourceFile = $configuration['setup.sourcefile'] ?? ''; $destDir = ($configuration['setup.destdir'] ?? null) ?: __DIR__; diff --git a/administrator/components/com_joomlaupdate/tmpl/update/default.php b/administrator/components/com_joomlaupdate/tmpl/update/default.php index 9c2ac08fa6b6e..ff76166341672 100644 --- a/administrator/components/com_joomlaupdate/tmpl/update/default.php +++ b/administrator/components/com_joomlaupdate/tmpl/update/default.php @@ -12,6 +12,7 @@ use Joomla\CMS\Factory; use Joomla\CMS\Help\Help; use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ @@ -56,36 +57,7 @@ $helpUrl = Help::createUrl('JHELP_COMPONENTS_JOOMLA_UPDATE', false); ?> -
- -