Commit graph

178 commits

Author SHA1 Message Date
David Monllao
10ccdfb8cd MDL-43390 files: Only lock when locking is not prevented 2014-07-24 10:22:55 +08:00
Matteo Scaramuccia
8436e8590f MDL-29708 Fixed file_exception() arguments in rename(). 2014-06-07 09:53:11 +02:00
Matteo Scaramuccia
ad3ade7681 MDL-29708 Fixed extra slashes in $string['storedfilenotcreated']. 2014-06-07 09:53:09 +02:00
Tim Hunt
5bcfd504df MDL-45618 Fix @since PHPdoc tags. 2014-05-19 17:03:04 +01:00
Frederic Massart
5b98627ae6 MDL-45081 curl: Prefer usage of CURLFile over @file arguments 2014-04-14 17:39:30 +08:00
Petr Škoda
9c140a681e MDL-44300 force PHP 5.6.x to return raw file names for our own guessing 2014-03-17 12:34:02 +13:00
Sam Hemelryk
2ef8ff9e05 MDL-44315 phpdoc: fixed up typos and made up tags 2014-02-24 09:13:31 +13:00
Eric Merrill
ec74b980c6 MDL-43794 Files API Set the mtime of files to extraction time.
The restore cleanup code expects the mtime to be the time of extraction
not the mtime before archiving. If set to the old mtime, the restore
files may be cleaned up before the restore is complete.

This behaviour also matches the behaviour of the zip unpacker.
2014-01-22 11:06:39 -05:00
Petr Škoda
2803f3c1b5 MDL-43402 remove all zlib detection code
Zlib extension is now required.
2013-12-27 11:06:18 +08:00
Jerome Mouneyrac
316283c72b MDL-42081 fix file_storage phpunit tests following adding new stamp files on fresh install 2013-11-11 16:01:32 +08:00
sam marshall
3749c94627 MDL-42714 Backup: For tgz packer, handle missing zlib extension 2013-11-06 12:34:46 +00:00
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