A new packer for .tar.gz files (MIME type application/x-gzip) has been
implemented, including unit tests.
This packer is intended for use during backup/restore only and is not
otherwise exposed in the user interface at present. However, it is
supposed to follow the (ancient) POSIX .tar standard; files created
with this packer will open in GNU tar.
There are restrictions in support corresponding to the POSIX standard:
- Non-ASCII filenames are not supported.
- Very long file/path names are not supported.
- Individual files within the .tar may not be more than 8GB.
Some of these limitations might need to be addressed in future changes
if the packer were to be used in areas other than backup/restore.
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.
GD PHP extension is now required. Add-ons need to remove $CFG->gdversion tests. The worst case regression is that add-on will think GD is not available.
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
Initially it was not clear enough that these two methods are supposed to
be used for looking for references to a stored_file only. So the docs
comments are improved and unittests added to illustrate the usage.
The patch also removes the unittest for get_references_by_storedfile()
as its usage is already covered in other test methods.
The first unit test forces the File API to be more picky as any sane
core API should be. The second one illustrates the buggy behaviour of
the current implementation of delete_reference(). They both fail at the
moment, of course...
This patch unifies the way how records in {files_reference} get created.
Previously, each reference file (i.e. a file with referencefileid set)
created its own record in {files_reference}. This patch makes sure that
existing record is reused if possible.
Bye bye 1:1 relationships, you suck!
1. Added tracker issue number in comment
2. Fixed stored_file::delete_reference()
3. repository::send_file() will throw exception if not implemented by subclass
4. Fixed renaming unit test, added one unit test for deleting original file
5. Fixed copyright statement for googledoc and picasa repository plugin
6. Implemented stored_file::set_filesize()