167 Commits

Author SHA1 Message Date
Damyon Wiese
370058d8fb Merge branch 'MDL-41838-master' of git://github.com/sammarshallou/moodle
Conflicts:
	lib/upgrade.txt
2013-10-10 10:49:11 +08:00
Sam Hemelryk
f18f96f767 Merge branch 'wip-MDL-42016-master' of git://github.com/marinaglancy/moodle
Conflicts:
	lib/db/install.xml
	lib/db/upgrade.php
	version.php
2013-10-09 15:58:45 +13:00
sam marshall
39e5102f8b MDL-41838 Backup/restore: Support .tar.gz format for .mbz (2 of 2)
The new experimental setting enabletgzbackups allows backups to be
created so that the internal format for .mbz files is .tar.gz.

Restore transparently supports .mbz files with either internal
formats (.zip or .tar.gz).

The .tar.gz format has the following benefits for backup:
- Supports larger files (no limit on total size, 8GB on single file
  vs. 4GB limit on total size)
- Compresses text better, resulting in smaller .mbz files.
- Reports progress regularly during compression of single files,
  reducing the chance of timeouts during backups that include a
  very large file.

Time performance may also be improved although I haven't done a
direct comparison.
2013-10-08 13:04:49 +01:00
sam marshall
c858655dde MDL-41838 Files: Implement .tar.gz packer (1 of 2)
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.
2013-10-08 13:04:48 +01:00
Sam Hemelryk
5dc361e16e MDL-31830 core_course: new course category management interface
* Implemented a new course and category management page.
* Deprecated the old management interface.
* Unit tests to cover the new API and core functions.
* Behat tests to cover the new interface.
2013-10-07 10:21:41 +13:00
Marina Glancy
873555604f MDL-42016 repository: Simplify API to sync external files
Too many functions, too different parameters, unnecessary DB queries.
All repositories developed for Moodle 2.3-2.5 will continue to work.

Also get rid of DB field files_reference.lifetime, it is not used by
anybody except repository itself.
2013-10-06 18:05:09 +11:00
Marina Glancy
2a68ee0eb1 MDL-42016 files: Properly synchronise internal references 2013-10-06 18:05:05 +11:00
Eloy Lafuente (stronk7)
b744b90df5 Merge branch 'w40_MDL-41707_m26_exttests' of https://github.com/skodak/moodle 2013-10-01 02:14:23 +02:00
Petr Škoda
a9d2f1b414 MDL-41707 allow custom location of external test files used from unit tests 2013-09-27 10:47:56 +02:00
Marina Glancy
e2a61ee3db MDL-33416 files: Remove unused reference fields in files table
Fields files.referencelastsync and files.referencelifetime just waste the space and actually duplicate the fields
files_reference.lifetime and files_reference.lastsync
2013-09-27 16:50:08 +10:00
Eloy Lafuente (stronk7)
14976b3568 Merge branch 'MDL-41839-master' of git://github.com/sammarshallou/moodle 2013-09-25 02:33:30 +02:00
Dan Marsden
361a47d409 MDL-41580 SCORM: allow imsmanifest.xml to be used in file system repos 2013-09-24 12:08:38 +12: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
137885b7e9 MDL-38194 Files: Allow download of large backup files
The PHP readfile function does not work for files more than 2GB.
This commit provides a wrapper that can be used so that files less
than 2GB are sent with readfile, and files larger than 2GB are
sent manually.

The change applies to all uses of pluginfile.php, although in
reality, backup files are probably the only ones likely to be more
than two gigabytes.
2013-09-13 14:59:57 +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
5f15f7c9aa MDL-41022 cleanup core_files_zip_packer_testcase 2013-08-24 16:18:18 +02:00
Petr Škoda
4c34571b76 MDL-41022 cleanup core_files_file_storage_testcase 2013-08-24 16:18:18 +02:00
Petr Škoda
96f81ea385 MDL-39474 introduce $CFG->debugdeveloper and cleanup $CFG init 2013-08-12 13:01:47 +02:00
Sam Hemelryk
823c0c80e9 Merge branch 'MDL-40086-master' of git://github.com/FMCorz/moodle
Conflicts:
	lib/filestorage/file_storage.php
2013-08-07 10:39:40 +12:00
Petr Škoda
2f1e464a88 MDL-40438 migrate all collatorlib:: and textlib:: uses 2013-08-06 21:04:35 +02:00
Frederic Massart
bc42e97989 MDL-40086 file: Correct ordering of subdirectories
Thanks to Mohamed Alsharaf for the proposed solution.
2013-08-06 13:53:54 +08:00
Petr Škoda
8252b7c291 MDL-40901 standardise core test case class and file names
This finally allows us to type only the class name when executing individual core test cases.
2013-08-04 22:10:31 +02:00
Petr Škoda
e8875a86be MDL-40900 do not use 32bit unsigned integers
32bit PHP and any Windows PHP breaks otherwise.
2013-07-28 13:10:57 +02:00
Petr Škoda
eb459f7192 MDL-40642 set more restrictive umask and use proper permission for new dirs and files 2013-07-19 09:18:44 +02:00
Paul Nicholls
f384ce26c0 MDL-39339 - zip_archive should ignore system files
zip_archive should ignore OSX system files (__MACOSX, .DS_Store) and
Windows thumbnail cache files (Thumbs.db), to avoid issues and confusion.
2013-05-30 09:23:35 +12:00
Paul Nicholls
81d9f3d536 MDL-39339 - Add test zips for OSX system files and Thumbs.db 2013-05-30 09:22:56 +12:00
Marina Glancy
6dd92c0234 MDL-39177 Updating userid when file is overwritten 2013-05-20 14:09:11 +10:00
Marina Glancy
935429af8b MDL-39177 More comments about confusing files.source field 2013-05-17 13:43:45 +10:00
Marina Glancy
da4b1ee480 MDL-39177 New function file_storage::get_unused_dirname() 2013-05-17 13:43:45 +10:00
Marina Glancy
e9e32b1d88 MDL-39177 File reference is not updated when overwriting the file 2013-05-17 13:43:44 +10:00
Damyon Wiese
946f2b0826 MDL-36959 file_storage: Preserve each file in a hash collision 2013-04-22 12:07:43 +08:00
Petr Škoda
fd4592bbbc MDL-36959 test reworked adding of files to sha1 content pool 2013-04-20 21:59:08 +02:00
Petr Škoda
d91e2c15db MDL-36959 rework adding of content files to the file pool
This patch includes refreshing of borked files in file pool and basic prevention of race conditions. It also helps with diagnosing of file pool permission problems, detects coding errors and some other type of problems including sha1 collision jackpot.
2013-04-20 21:41:41 +02:00
David Mudrák
bfaed43214 MDL-39087 Fix missing cronlib inclusion in file_storage::cron()
This is not actually related to MDL-38259 but it was discovered while
running unit tests for file_storage. When running the tests for this
class separately, the cronlib.php was not included (it is included
when this method is normally called during cron execution).
2013-04-12 01:42:58 +02:00
David Mudrák
546b886416 MDL-39087 Delete all component files in uninstall_plugin() 2013-04-12 01:42:58 +02:00
Petr Škoda
689096bc26 MDL-38654 do not test $CFG->gdversion
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.
2013-03-22 16:57:55 +01:00
Tim Hunt
658b9372ee MDL-38212 cron: display time and memory usage before each task.
This helps diagnose problems.

Also, call gc_collect_cycles between tasks, which may reduce the
frequency of out-of-memory errors.
2013-03-08 10:24:41 +00:00
David Mudrák
8f5cbbd6c8 MDL-38261 Add a new file preview mode for bigger thumbnails 2013-02-28 18:53:37 +01:00
Dan Poltawski
d28d214167 Merge branch 'w08_MDL-38154_m25_delperf' of git://github.com/skodak/moodle 2013-02-26 11:08:52 +08:00
Petr Škoda
18fa4f4745 MDL-38154 do not hardcode sha1 hash of empty string 2013-02-25 10:10:57 +01:00
Damyon Wiese
61725199a9 Merge branch 'MDL-37641-master' of git://github.com/FMCorz/moodle 2013-02-25 15:23:19 +08:00
Petr Škoda
e029dff4cd MDL-38154 improve dir delete performance 2013-02-23 15:10:48 +01:00
Marina Glancy
898d4975cb MDL-38091 fixed bug with SQL query on Oracle 2013-02-23 12:06:21 +11:00
Frederic Massart
3385a89c38 MDL-37641 files: Tests for draftfile_exists and get_unused_filename 2013-02-20 08:50:43 +08:00
Frederic Massart
d7d69396b0 MDL-37641 files: Improve file name suggestion and performance 2013-02-20 08:50:40 +08:00
Sam Hemelryk
e003d7dc5f Merge branch 'w04_MDL-37640_m25_zipclose' of git://github.com/skodak/moodle 2013-01-28 13:36:28 +13:00
Petr Škoda
231b022777 MDL-37407 add support for zh_cn unicode unzip 2013-01-25 15:55:52 +01:00
Petr Škoda
96846ef18b MDL-37640 close all zip archives after use in unit tests 2013-01-25 12:46:58 +01:00
Petr Škoda
009f190c69 MDL-37429 hack around zip limitations in PHP versions < 5.3.10 2013-01-17 16:48:29 +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