Commit graph

18 commits

Author SHA1 Message Date
David Mudrák
260c2bdb00 MDL-70864 files: Fix zip_packer extracting files with trailing dots
File and folder names cannot end with dots on Windows. So replace the
trailing dots with underscore consistently with how some other zip tools
(such as 7-zip) handle this case.
2021-05-03 18:13:14 +02:00
David Mudrák
b227b6ea45 MDL-70631 files: Fix performance of zip_packer::extract_to_pathname()
The original implementation was based on ZipArchive::getStream() which
turns out to be very slow and if the archive contains many files, the
unzipping performance is very slow.

The patch changes the implementation to use ZipArchive::extractTo()
unless the extracted entry path contains a folder name ending with dot
(such as some/path./to/file.txt). There is a known upstream bug in the
PHP ZIP extension #77214 (also #74619 and #69477) so that we fall back
to keep using the stream in those cases.
2021-02-03 16:06:39 +01:00
Andrew Nicols
2c2f4f17c3 MDL-24343 core: Deprecate unzip_file 2016-08-03 09:05:55 +08:00
sam marshall
771e3f7cab MDL-41839 Files: Zip packer progress minor bugs
The progress variable wasn't always passed to recursive calls. This
caused a lack of progress() calls between files in subfolders. I
added a unit test for this situation.
2013-09-17 14:19:07 +01:00
sam marshall
71ab7e512b MDL-41151 Files: Zip packer should have way to indicate progress 2013-09-05 16:41:57 +01:00
Petr Škoda
01b4040a27 MDL-37429 zipping improvements
Changes:
* zip_packer can create empty zip archives
* new option to ignore problematic files when creating archive
* detection of non-existent files
* debugging messages for opening of faulty zip archives
* coding style improvements
* no PHP 5.2 hacks
* more unit tests
2013-01-12 14:58:26 +01:00
Frederic Massart
638d72cd0b MDL-32639 files: Improved File Manager download and zip support 2012-12-12 14:38:11 +08:00
Frederic Massart
e462f46b77 MDL-35117 librairies: File Packer can only extract a specific list a files 2012-10-18 13:38:48 +08:00
Petr Škoda
f6b49abf9b MDL-17830 fix zip_packer return status add debugging for invalid files and dirs 2012-07-29 16:09:18 +02:00
Petr Skoda
79c966cf21 MDL-33710, MDL-33710 add utf-8 flag to all zip files created in moodle and unzip from storage fix 2012-07-06 08:02:42 +02:00
Petr Skoda
aefe9734fa MDL-33733 fix broken zip_packer->extract_to_storage() when extracting from stored_file 2012-06-25 01:32:50 +02:00
Dongsheng Cai
d2b7803e5a MDL-30973 Files API, check and update DocBlock 2012-02-15 12:48:57 +08:00
Tom Lanyon
7aa06e6ded MDL-28701 Change all uses of $CFG->dataroot/temp to $CFG->tempdir 2011-09-10 10:35:39 +02:00
Petr Skoda
ac6f1a82f9 MDL-24321 switching to stdClass 2010-09-21 07:57:42 +00:00
Petr Skoda
d3427cfe9f removing unused variables 2010-09-18 10:33:26 +00:00
Petr Skoda
59333bc943 MDL-23991 not a nice hack for sending file as string content to zip packer 2010-08-29 16:44:32 +00:00
Petr Skoda
c426ef3aa5 MDL-23984 improvements of check_dir_exists() - replacing by make_upload_directory() in cases where we want to be sure that the dir is writable; removning now default create and recursive params to make code easier to read 2010-08-29 14:51:09 +00:00
Petr Skoda
64f93798d4 MDL-22950 adding new component column to the files table, unfortunately this change requires changes in all 2.0dev code, please review all custom code that was already upgraded to 2.0; fixing multiple problems and regressions in mod/assignment 2010-07-03 13:37:13 +00:00
Renamed from lib/packer/zip_packer.php (Browse further)