mirror of
https://github.com/prasathmani/tinyfilemanager.git
synced 2026-04-26 10:55:56 +03:00
[GH-ISSUE #998] Add ZipArchive::setCompressionName for systems that support it #644
Labels
No labels
Feature
Feature
Is It Really an Issue?
Need More Info
Request
Security
bug
duplicate
enhancement
enhancement
help wanted
invalid
pull-request
question
suggestion
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tinyfilemanager#644
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ner00 on GitHub (Mar 22, 2023).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/998
I've looked at this and implemented it for myself, but I think this should be carefully implemented with an option in the settings for people to use it properly. The most useful part of not using compression at all is to just pack a whole folder tree into one zip file and then download it.
When comparing the multiple compression options for
setCompressionName(available only for PHP7+), I was very surprised at how fast no compression could be. For example, a folder tree that has 33 files and 2 subfolders, totaling 837MB, would take around 25 seconds to compress with the default compression method (deflate) and quite a bit of CPU power too. In comparison, using no compression at all (CM_STORE), it took 3 seconds and barely any CPU power. Since the data itself was FLAC audio, the end result in terms of data volume was virtually identical.This is my own crude implementation at the moment, inside
FM_Zipper->create()for files andFM_Zipper->addDir()for recursive folders:I could also have added
isCompressionMethodSupportedas a control but that's even worse seeing as it only exists in PHP8+, so I'm not checking if the compressions are actually supported and only if the method of setting a compression is supported.