Merge branch 'm26_MDL-39832_Fix_Chrome_Issues_ETag_XSendfile_2ndRound' of https:...
[moodle.git] / repository / upgrade.txt
CommitLineData
72b33964
DP
1This files describes API changes in /repository/ repository system,
2information provided here is intended especially for developers. Full
3details of the repository API are available on Moodle docs:
4http://docs.moodle.org/dev/Repository_API
5
d7d69396
FM
6=== 2.5 ===
7
8* repository::append_suffix() has been deprecated, use repository::get_unused_filename() if you need
9 to get a file name which has not yet been used in the draft area.
10
31581ae6
FM
11* contains_private_data() is a new method to determine if a user 'logged in as' another user
12 can access the content of the repository. The default is to return True (no access).
13
14* get_typename() returns the type of repository: dropbox, googledocs, etc...
15
89a9d21a
FM
16* can_be_edited_by_user() encapsulates all the tests to make sure that the current user
17 has the rights to edit the instance of this repository.
18
f6812f57
MG
19* repository::get_instances() (used by filepicker and texteditor to populate the
20 list of available repositories) now calls repository constructor specifying the
21 context where repository will be used.
22 When checking permissions inside repository class use:
23 $this->instance->contextid - to find the context where repository was created;
24 $this->context - to find the current context where repository is used.
25 This also means that the same repository instance may now have different names when
26 called from different contexts.
27 Avoid calling repository::get_instance(), use repository::get_repository_by_id() instead.
28
8a641199
FM
29=== 2.4 ===
30
31* copy_to_area() can receive a new parameter called $areamaxbytes which controls the maximum
32 size of the area the files will be stored in.
33
34* the repositories using the upload() method should implement a check for $areamaxbytes,
35 see repository/upload/lib.php upload() and process_upload() for an example on how handling it.
36
72b33964
DP
37=== 2.3 ===
38
39* instance_config_form() must now be declared static for php5.4 compatibility.
40
41* get_listing() and search() file metadata details are now now more prominently
42 displayed in the interface. Dates and timestamos are now able to be sorted on in
43 the filepicker interface so plugin authors are asked to ensure:
44 - Dates are defined as UNIX timestamps
45 - Filesize is an integer in bytes
46
47* It is recomended to define function get_file_source_info() to provide more rich
48 infromation about the source of a file.
49
50* The API was extended to allow repositories can now support external references, please
51 see http://docs.moodle.org/dev/Repository_API for further details.