MDL-41580 SCORM: allow imsmanifest.xml to be used in file system repos
[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
a76efbca
FM
6=== 2.6 ===
7
8* get_option() now always return null when the first parameter ($config) is not empty, and
9 no value was found for this $config. Previously this could sometimes return an empty array().
033d1634 10* The function repository_attach_id() was removed, it was never used and was not useful.
361a47d4
DM
11* New functions send_relative_file() and supports_relative_file() to allow sending relative linked
12 files - see filesystem repository for example.
13
a76efbca 14
d7d69396
FM
15=== 2.5 ===
16
17* repository::append_suffix() has been deprecated, use repository::get_unused_filename() if you need
18 to get a file name which has not yet been used in the draft area.
19
31581ae6
FM
20* contains_private_data() is a new method to determine if a user 'logged in as' another user
21 can access the content of the repository. The default is to return True (no access).
22
23* get_typename() returns the type of repository: dropbox, googledocs, etc...
24
89a9d21a
FM
25* can_be_edited_by_user() encapsulates all the tests to make sure that the current user
26 has the rights to edit the instance of this repository.
27
f6812f57
MG
28* repository::get_instances() (used by filepicker and texteditor to populate the
29 list of available repositories) now calls repository constructor specifying the
30 context where repository will be used.
31 When checking permissions inside repository class use:
32 $this->instance->contextid - to find the context where repository was created;
33 $this->context - to find the current context where repository is used.
34 This also means that the same repository instance may now have different names when
35 called from different contexts.
36 Avoid calling repository::get_instance(), use repository::get_repository_by_id() instead.
37
8a641199
FM
38=== 2.4 ===
39
40* copy_to_area() can receive a new parameter called $areamaxbytes which controls the maximum
41 size of the area the files will be stored in.
42
43* the repositories using the upload() method should implement a check for $areamaxbytes,
44 see repository/upload/lib.php upload() and process_upload() for an example on how handling it.
45
72b33964
DP
46=== 2.3 ===
47
48* instance_config_form() must now be declared static for php5.4 compatibility.
49
50* get_listing() and search() file metadata details are now now more prominently
51 displayed in the interface. Dates and timestamos are now able to be sorted on in
52 the filepicker interface so plugin authors are asked to ensure:
53 - Dates are defined as UNIX timestamps
54 - Filesize is an integer in bytes
55
56* It is recomended to define function get_file_source_info() to provide more rich
57 infromation about the source of a file.
58
59* The API was extended to allow repositories can now support external references, please
60 see http://docs.moodle.org/dev/Repository_API for further details.