Use the newest Joomla 3.9.23
Install for example Yootheme Pro Package. (important: This package includes more Zips within the zip File and this seems to be the problem. If the zip doesn't contains other zips, the installation times are as usual.)
Installation complete after several seconds.
Tested with Joomla 3.9.22 -> 15 seconds for installation.
Installation takes minutes or fail:
Maximum execution time of 60 seconds exceeded in /libraries/vendor/joomla/archive/src/Zip.php on line 301
With higher exexcution Time settings the installation takes 2:05 minutes.
Joomla 3.9.23
Tested it with Yootheme Pro 2.3.19 (7,3 MB) -> takes long. Zip in zips.
Tested with oder extensions without zips in zip ist fast and as excepted.
Joomla 3.9.23 -> 2:05 Minutes
Joomla 3.9.22 -> 0:15 Minutes
-> for the same extension.
Tested it also with Akeeba Backup Core. The main zip contains, 6 other zips. But there are no problems here. The installation speed is more or less the same.
This resolves the issue for me, use directly ZipArchive::getFromIndex
instead of first getting and reading the file with ZipArchive::getStream
. This should happen with all larger zip files because the read operation takes longer.
/**
* Extract a ZIP compressed file to a given path using native php api calls for speed
*
* @param string $archive Path to ZIP archive to extract
* @param string $destination Path to extract archive into
*
* @return boolean True on success
*
* @since 1.0
* @throws \RuntimeException
*/
protected function extractNative($archive, $destination)
{
$zip = new \ZipArchive;
if ($zip->open($archive) !== true)
{
throw new \RuntimeException('Unable to open archive');
}
// Make sure the destination folder exists
if (!Folder::create($destination))
{
throw new \RuntimeException('Unable to create destination folder ' . \dirname($path));
}
// Read files in the archive
for ($index = 0; $index < $zip->numFiles; $index++)
{
$file = $zip->getNameIndex($index);
if (substr($file, -1) === '/')
{
continue;
}
$buffer = $zip->getFromIndex($index);
if ($buffer === false)
{
throw new \RuntimeException('Unable to read ZIP entry');
}
if (File::write($destination . '/' . $file, $buffer) === false)
{
throw new \RuntimeException('Unable to write ZIP entry to file ' . $destination . '/' . $file);
}
}
$zip->close();
return true;
}
@steffans can you make a PR against https://github.com/joomla-framework/archive ?
PR is ready: joomla-framework/archive#24
@HLeithner We leave this issue open until the framework PR has been merged and we will have a PR for updating the framework package in staging, right?
yes please
I have the same issue - also emerged on an attempted YTPro upgrade.
Tested the same upgrade on a 3.9.22 (fine) and 3.9.23 (timed out with a 500 second limit). Zoolanders Essentials timesout too - but other extensions have loaded ok. The issue is the same whether using the update script, installing from a directory, or uploading the package file.
I tried applying the patch from the PR to libraries/joomla/archive/zip.php - but unless I need to delete a cache or something, it didn't make any difference.
@vingle This is the correct directory: joomla_root/libraries/vendor/joomla/archive/src/Zip.php
Ah - thanks for the correction – yes that works for me now :)
Just to confirm...
thx I keep this issue open until 3.9.24 is released
I applied the patch to the zip.php, and tried updating from yootheme j3_2.3.21 to yootheme j3_2.3.23 and 24 both fail with an unable to find manifest file. I re-uploaded the unchanged zip.php file and the update for yootheme pro installed fine.
Joomla 3.9.23
PHP 7.4.11
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-12-16 23:51:39 |
Closed_By | ⇒ | HLeithner |
@Stevec4 please test https://github.com/joomla/joomla-cms/releases/tag/3.9.24-rc I'm closing this because this should be solved
Message
Installation of the package was successful.
With the RC installed it worked perfectly Harald
Thanks for the feedback
Tested 3.9.24RC will all the largest packages like com_easyblog 5.4.6 which is 13.5Mb... and com_jomsocial 4.7.7 which is 12.9Mb packages and its all ok for me.
thanks for the report @PhilETaylor
The joomla-framework/archive package has been updated to use the PHP ZipArchive, because the zip functions we used before are deprecated in favor of the Object API.
This is an issue that we inherited from PHP, so we can't do much about it. Nevertheless we'll investigate the possibility of a workaround. Can't promise anything, though.