99 Commits

Author SHA1 Message Date
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
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
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
Frederic Massart
7a79030f48 MDL-23296 repository_local: Implementing search through server files 2015-03-05 13:41:47 +01:00
David Monllao
10ccdfb8cd MDL-43390 files: Only lock when locking is not prevented 2014-07-24 10:22:55 +08:00
Tim Hunt
5bcfd504df MDL-45618 Fix @since PHPdoc tags. 2014-05-19 17:03:04 +01: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 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
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
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
eb459f7192 MDL-40642 set more restrictive umask and use proper permission for new dirs and files 2013-07-19 09:18:44 +02:00
Marina Glancy
da4b1ee480 MDL-39177 New function file_storage::get_unused_dirname() 2013-05-17 13:43:45 +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
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
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
d7d69396b0 MDL-37641 files: Improve file name suggestion and performance 2013-02-20 08:50:40 +08:00
Dan Poltawski
0e35ba6ffc MDL-36357 cleanup - remove double semicolons 2012-11-15 09:51:26 +08: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
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
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
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
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
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
David Mudrak
d83ce95322 MDL-33330 improved {files_reference} records creation
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!
2012-06-05 13:39:09 +02:00