132 Commits

Author SHA1 Message Date
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
Frederic Massart
1017426c26 MDL-32639 phpunit: Hack not to fail on debugging 2013-01-09 11:48:44 +08:00
Sam Hemelryk
f44e7d0a77 Merge branch 'MDL-36357' of git://github.com/danpoltawski/moodle
Conflicts:
	user/view.php
2013-01-09 09:34:22 +13:00
Dan Poltawski
bfb5580f92 Merge branch 'MDL-32639-master' of git://github.com/FMCorz/moodle 2013-01-08 14:46:14 +08:00
Frederic Massart
638d72cd0b MDL-32639 files: Improved File Manager download and zip support 2012-12-12 14:38:11 +08:00
Vadim Dvorovenko
697ade2850 MDL-32639 files: Removing '0' start folder in archives created with filemanager 2012-12-10 12:30:29 +08:00
Petr Škoda
65598feb36 MDL-36447 skip file preview test if GD not available 2012-12-09 19:22:01 +01:00
Dan Poltawski
0e35ba6ffc MDL-36357 cleanup - remove double semicolons 2012-11-15 09:51:26 +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
177ffd37ff MDL-35795 add fallback for DOS/Windows non-utf8 zip archive unzipping 2012-10-06 10:02:11 +02:00
Sam Hemelryk
52ebfade63 Merge branch 'MDL-34607-master' of git://github.com/FMCorz/moodle
Conflicts:
	lib/db/upgrade.php
	version.php
2012-09-25 09:51:28 +12:00
Frederic Massart
db232bb0f4 MDL-34607 File API: Natural sort on area tree files 2012-09-21 10:08:46 +08:00
Petr Škoda
060bb94d81 MDL-35479 fix zip packer tests to use debugging asserts 2012-09-17 12:00:02 +02:00
Rex Lorenzo
ff37d63c1b MDL-35376 - Shortcut/alias not working for Private file repo 2012-09-11 14:23:12 -07:00
Marina Glancy
42aa6e15bb MDL-34290, MDL-33416 prepare to deprecate fields files.referencelastsync and referencelifetime 2012-08-29 11:56:18 +08:00
Marina Glancy
437f5dc4cf MDL-34290 Auto synchronise newly created references when possible 2012-08-29 11:56:17 +08:00
Marina Glancy
bc6f241ca2 MDL-34290 repository API: add repository function to import referenced file
it must be independed from sync_external_file because sync often does not actually download contents, it is used just to retrieve
the size of the file. Besides the timeouts for get_file and sync requests are very different.

Also add option to send_stored_file() to ignore reference and send cached contents
2012-08-29 11:56:15 +08:00
Marina Glancy
14b7e50001 MDL-34290 update all references after the source is changed
- When several records in {files} have the same record in {files_reference} and the synchronisation is performed, we need to update
all records in {files} so all files know if source is changed and that sync was performed;
- also when local moodle file content is changed we immediately update all files referencing to it (therefore sync of references
to the local files is unnecessary);
2012-08-29 11:56:00 +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 Škoda
00f744d2b1 MDL-33753 fix sloppy refactoring regression in zip tweaking 2012-07-11 11:10:19 +02:00
Petr Skoda
6fb8ae95f5 MDL-33753 support utf-8 filename unzipping 2012-07-06 08:03:38 +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
David Mudrák
483afa446d MDL-33453 Make it clear what search_references() and search_references_count() are good for
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.
2012-07-05 17:15:37 +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
Sam Hemelryk
088c374a6d Merge branch 'MDL-33430-reference-restore' of git://github.com/mudrd8mz/moodle
Conflicts:
	lib/db/install.xml
	lib/db/upgrade.php
	version.php
2012-06-22 11:56:49 +12:00
David Mudrák
6feae1d256 MDL-33430 Make file_storage::unpack_reference() more picky on what it gets 2012-06-21 01:32:24 +02:00
Rajesh Taneja
4e782b32f3 MDL-33425 user: Replaced filepicker with filemanager on edit profile page 2012-06-18 10:19:48 +08:00
Marina Glancy
cfc4db405c MDL-33550 Set default status for file =0 and correct setting user in phpunit test 2012-06-14 14:52:31 +08:00
Marina Glancy
0b2bfbd1c6 MDL-33550 Correctly process situation when file reference source is missing
- do not die with fatal error if source file in moodle internal repository is missing;
- moved code duplication for moodle repositories into class repository (functions send_file, get_reference_details, get_file_by_reference, get_file_reference);
- update file status after repository::sync_external_file so we know that it is missing (or not missing anymore). Do not run this function more than once for file within one request;
- display readable name for Private Files and Server files with the new format;
- display broken icon in filemanager if we know that source is missing, display information (for admin) where it was located before: see repository::get_reference_details() and extending classes;
- removed unnecessary queries in stored_file::sync_external_file();
- syncronize files before displaying it's size in mod_resource, do not query  directly
2012-06-13 12:11:06 +08:00
David Mudrak
3b2465fee6 MDL-33587 Delete the reference properly in stored_file::delete() 2012-06-07 18:02:12 +02:00
David Mudrak
1c0da8498f MDL-33587 Improve stored_file::delete_reference() method 2012-06-07 17:37:25 +02:00
David Mudrak
2fa8aea279 MDL-33587 Throw coding exception when trying to unlink a non-reference file 2012-06-07 17:36:29 +02:00
David Mudrak
2d2c194bbe MDL-33587 Add unit tests for stored_file::delete_reference()
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...
2012-06-07 17:36:23 +02:00
Dan Poltawski
79c2b50980 Merge branch 'MDL-33330-files-reference' of git://github.com/mudrd8mz/moodle
Conflicts:
	version.php
    lib/db/upgrade.php
2012-06-06 16:18:30 +08:00
David Mudrak
0ad654dc8b MDL-33330 Use the referencehash when searching for references
Together with this, refactoring and cleanup of search_references() and
similar methods was done. SQL was improved to use the INNER JOIN instead
of the LEFT JOIN as we are really interested in records that have a
reference. Also, joining the {repository_instances} table assures that
only references with valid repository_instance are returned (the check
against is_external_file() can't be applied to the methods that return
the count of references so I dropped it completely).
2012-06-05 14:07:25 +02:00
David Mudrak
dccba8bcc9 MDL-33330 Populate referencehash field values 2012-06-05 14:07:24 +02:00