324 Commits

Author SHA1 Message Date
Andrew Nicols
16a34ae189 MDL-46375 core_files: Split parts of file_storage into new file system
This change moves all operations which deal with the fetching/updating, or
setting of files from the file_storage class into a new file_system class.

A new file_system can be specified in the config.php and used to replace
all relevant methods in order to move the file system component to an
alternative solution.
2017-02-14 08:42:28 +08:00
sam marshall
66234de24c MDL-57515 Resource: 'not very efficient' with a large number of files
Fixes bug where the resource module loads metadata for all files while
building course modinfo, even though it only needs the first file.
(This causes problems if you have ~10k files.)
2017-01-10 17:43:46 +00:00
Eloy Lafuente (stronk7)
a584a403cd Merge branch 'MDL-54916' of https://github.com/mr-russ/moodle 2016-11-07 16:19:06 +01:00
David Monllao
c9af13123d MDL-54751 course_modules: New major upgrade point
Also trailing whitespace cleaned.
2016-11-07 08:59:04 +08:00
Jake Dallimore
3869d77411 MDL-54751 core_course: Edit course libs to support deletion flag
Changed the course libs such that module and section deletion is now
handed off to relevant functions in the util class and exempted
modules scheduled for deletion from the course backups.
2016-11-07 07:41:59 +08:00
Russell Smith
cebce76f61 MDL-56307 course: Refactor file_storage 2016-10-25 10:10:53 +01:00
Juan Leyva
1896b8009a MDL-56307 course: API changes to support retrieve by time 2016-10-25 10:10:52 +01:00
Russell Smith
261bfabc6f MDL-54916 filestorage: Only write empty zip on change.
In some cases we may inspect an empty zip file. If we do open
an empty zip file, check that it changed before we attempt to write
it to disk.  It may be the case that we were reading the file from
a location that we don't have write access to.
2016-10-25 14:10:36 +11:00
Andrew Nicols
b4bb1e65dc Merge branch 'MDL-55445-master-2nd' of git://github.com/FMCorz/moodle 2016-08-17 11:25:24 +08:00
Andrew Nicols
0a0eaa7dfc Merge branch 'MDL-54647-master' of git://github.com/damyon/moodle 2016-08-16 08:01:47 +08:00
Damyon Wiese
300852ee30 MDL-54647 file_storage: Redo the test pdf every time it's viewed 2016-08-15 16:32:21 +08:00
Andrew Nicols
40cc0ba04e Merge branch 'MDL-55513-master' of https://github.com/lucisgit/moodle 2016-08-15 14:07:41 +08:00
Frederic Massart
92b9ef9917
MDL-55445 gdlib: Support for resizing an image 2016-08-15 10:54:28 +08:00
Tony Butler
2ee668ec56 MDL-55513 core_filestorage: Touch and test size instead of file_exists()
file_exists() can return false when file exists (in certain scenarios)
2016-08-10 09:35:23 +01:00
Tony Butler
e98483d748 MDL-55513 core_filestorage: Pass full path of temp dir to remove_dir() 2016-08-10 09:35:23 +01:00
Matt Davidson
826bb3547b MDL-55246 assign: convert files with spaces
If a file is sent to unoconv with a filename that contains spaces,
unoconv will fail to produce the intended results.
2016-08-05 08:14:20 -04:00
Andrew Nicols
2c2f4f17c3 MDL-24343 core: Deprecate unzip_file 2016-08-03 09:05:55 +08:00
Rajesh Taneja
52f3e060e4
MDL-55091 phpunit: Following has been deprecated.
1. getMock()
2. setExpectedException()
3. checkForUnintentionallyCoveredCode renamed to beStrictAboutCoversAnnotation
4. beStrictAboutTestSize renamed to enforceTimeLimit
5. UnitTestCase class is now fully removed.
2016-07-26 10:11:30 +08:00
Simey Lameze
37eafbb6dc MDL-54948 core_files: return false if theres no output from unoconv 2016-06-23 08:37:23 +08:00
Simey Lameze
9254ba09e8 MDL-54948 core_files: make the check consistent on unoconv test page 2016-06-21 09:36:44 +08:00
David Monllao
50c338b84b Merge branch 'MDL-54544-master' of git://github.com/damyon/moodle 2016-05-18 13:55:05 +08:00
Damyon Wiese
4f54bdc733 MDL-54544 files: Better error handling in $fs->create_converted_document() 2016-05-18 13:44:13 +08:00
Damyon Wiese
5620177efd MDL-54544 file: Use shared tmp storage for unoconv document conversions 2016-05-17 10:58:25 +08:00
Adrian Greeve
0eecf87687 MDL-53923 mod_assign: Movement of functions to file_storage. 2016-05-16 14:32:54 +08:00
Matteo Scaramuccia
bc219382b7 MDL-53837 assign: Fix executable check for 'unoconv.py' on Windows. 2016-04-17 22:35:13 +02:00
Damyon Wiese
6853cd5ed4 MDL-52954 assign: Fix the reasonable cibot warnings. 2016-03-30 14:07:28 +08:00
Damyon Wiese
bb690849c9 MDL-52954 assign: Rebuild the assignment single grade page. 2016-03-30 13:47:21 +08:00
Damyon Wiese
1356d85151 MDL-52954 core: Change from pandoc to unoconv - it gives better results
Most importantly it retains formatting better, and supports different charsets far better than pandoc.
2016-03-30 11:48:39 +08:00
Damyon Wiese
2e76c14e11 MDL-52954 core: Add a document converter to file_storage
This lets us convert between common office formats. E.g. docx -> pdf
html -> pdf, html -> ods.

This commit also updates assignment editpdf plugin to use this converter
on all compatible submission files.
2016-03-30 11:48:39 +08:00
Eugene Venter
8ef4fbc64f MDL-52530 unittest: more robust capability assignments for guest
for core_files_file_storage_testcase and core_repositorylib_testcase
2015-12-23 09:24:53 +13:00
Eloy Lafuente (stronk7)
b4153ff09d Merge branch 'wip-MDL-51985-master' of https://github.com/marinaglancy/moodle 2015-12-03 11:16:34 +01:00
Jun Pataleta
a33e5debe9 MDL-37308 files: Additional fixes for transparency
Fixed transparency support when resizing and when not resizing.
2015-11-29 20:28:19 -06:00
Jetha Chan
623c947f2b MDL-37308 files: support transparency when not resizing; new unit test 2015-11-29 20:28:19 -06:00
Adrian Greeve
e245843193 MDL-37308 files: convert_image() now supports transparency. 2015-11-29 20:28:18 -06:00
Marina Glancy
58e5ab1bac MDL-51985 files: sync timemodified when possible 2015-10-30 14:46:09 +08:00
Eloy Lafuente (stronk7)
70ae75674d MDL-51863 packer: ensure empty zip files behavior remains consistent
With PHP bug #70322 fixed, ZipArchive::close() did start returning false
and throwing PHP Warnings with recent PHP versions (5.6.14 and up).
Previously (5.6.13 verified) it was returning true, and false in older
versions (5.4.x verified).

This change does silent the 2 "hacky" calls to close() that we perform
in core leaving the 3rd one (used for files having files) unmodified.

A new unit test has been created to cover the close() behavior, ideally
supporting both old and new PHP versions without harcoding any PHP
version.

Note that we don't use to rely much on results coming from close(), and
that's a good thing given the buggy behavior commented above. This just
keeps empty zips working like they were before.
2015-10-26 21:16:54 +01:00
Andrew Nicols
2b53b13ff7 MDL-49627 core: Update uses of generate_image_thumbnail
This removes the need to write tempfiles in these locations.
2015-04-01 11:05:19 +08:00
Andrew Nicols
b7067f065e MDL-49627 core: Improve thumbnail generation
We now abstract the actual file generation to a new function.
We are then able to call this function from the other image generation
sources. This allows us to generate thumbnails in a more efficient manner.

* Stored files stay as stored files and are not temporarily re-written to
  disk;
* Strings containing an image remain as a variable and are not temporarily
  written to disk; and
* Arbitrary files are not captured to string.
2015-04-01 11:05:19 +08:00
David Monllao
47d333857d Merge branch 'MDL-23296-master' of git://github.com/FMCorz/moodle 2015-04-01 10:41:41 +08:00
Dan Poltawski
6cb65683d1 Merge branch 'MDL-49598-master' of git://github.com/andrewnicols/moodle 2015-03-31 14:21:37 +01:00
Jordi Pujol Ahulló
d5f596589b MDL-49641 repository_dropbox: preventing poor performance.
emptied sort default value at get_external_files to prevent poor performance.
2015-03-25 08:00:27 +01:00
Andrew Nicols
5d70615157 MDL-49598 files: getimagesize -> getimagesizefromstring 2015-03-20 10:16:36 +08:00
Eric Merrill
c803fa6855 MDL-49298 backup: Make tgz file format standard for backups 2015-03-05 10:07:58 -05:00
Frederic Massart
7a79030f48 MDL-23296 repository_local: Implementing search through server files 2015-03-05 13:41:47 +01:00
Mitsuhiro Yoshida
6396b58e15 MDL-49259 lib: Fix for unzipped Japanese filename character corruption 2015-02-25 23:29:02 +09:00
John Okely
e6904efc52 MDL-42166 repositories: Finalise deprecation of repository sync methods 2014-12-16 15:57:50 +08:00
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