Merge branch 'wip-MDL-57234-master' of https://github.com/Beedell/moodle
[moodle.git] / repository / upgrade.txt
blob27814a84e544373b7601b8e1f27e6f68b51b3aa6
1 This files describes API changes in /repository/ repository system,
2 information provided here is intended especially for developers. Full
3 details of the repository API are available on Moodle docs:
4 http://docs.moodle.org/dev/Repository_API
6 === 3.2 ===
8 * The method repository::uses_post_requests() has been deprecated and must not be used anymore.
9 * The alfresco repository has been moved to the plugins database. It was
10   using an older version of the Alfresco SDK which is not compatible with recent versions of Alfresco.
12 === 3.1 ===
14 * The following functions, previously used (exclusively) by upgrade steps are not available
15   anymore because of the upgrade cleanup performed for this version. See MDL-51580 for more info:
16     - repository_picasa_admin_upgrade_notification()
17     - repository_googledocs_admin_upgrade_notification()
18     - repository_boxnet_admin_upgrade_notification()
19     - repository_alfresco_admin_security_key_notice()
20 * The prepare_file() function will now return a file in a per-request directory which will
21   be automatically cleaned at the end of the request.
22   No modifications should be required as a result of this change.
24 === 2.8 ===
26 * Repositories working with Moodle files must replace serialize() with json_encode() in the
27   attribute 'source' returned by get_listing(). If repository overrides file_is_accessible(),
28   get_file_reference() or get_file_source_info() they need to be changed too. See MDL-45616.
30 === 2.6 ===
32 * get_option() now always return null when the first parameter ($config) is not empty, and
33   no value was found for this $config. Previously this could sometimes return an empty array().
35 * The function repository_attach_id() was removed, it was never used and was not useful.
37 * New functions send_relative_file() and supports_relative_file() to allow sending relative linked
38   files - see filesystem repository for example.
40 * DB fields files.referencelifetime, files.referencelastsync and files_reference.lifetime
41   are deleted. The last synchronization time is stored only in files_reference.lastsync
42   and lifetime is not stored in DB any more, each repository must decide for itself
43   when to synchronize the file in function repository::sync_reference().
45 * The following methods in class repository are deprecated: sync_external_file(),
46   get_file_by_reference(), get_reference_file_lifetime(), sync_individual_file() and
47   reset_caches(). Instead there is one method repository::sync_reference() - this simplifies
48   the repositories API and reduces the number of DB queries.
50 * Deprecated const GETFILE_TIMEOUT, SYNCFILE_TIMEOUT and SYNCIMAGE_TIMEOUT and replaced them with
51   config variables repositorygetfiletimeout, repositorysyncfiletimeout and repositorysyncimagetimeout.
53 === 2.5 ===
55 * repository::append_suffix() has been deprecated, use repository::get_unused_filename() if you need
56   to get a file name which has not yet been used in the draft area.
58 * contains_private_data() is a new method to determine if a user 'logged in as' another user
59   can access the content of the repository. The default is to return True (no access).
61 * get_typename() returns the type of repository: dropbox, googledocs, etc...
63 * can_be_edited_by_user() encapsulates all the tests to make sure that the current user
64   has the rights to edit the instance of this repository.
66 * repository::get_instances() (used by filepicker and texteditor to populate the
67   list of available repositories) now calls repository constructor specifying the
68   context where repository will be used.
69   When checking permissions inside repository class use:
70   $this->instance->contextid - to find the context where repository was created;
71   $this->context - to find the current context where repository is used.
72   This also means that the same repository instance may now have different names when
73   called from different contexts.
74   Avoid calling repository::get_instance(), use repository::get_repository_by_id() instead.
76 === 2.4 ===
78 * copy_to_area() can receive a new parameter called $areamaxbytes which controls the maximum
79   size of the area the files will be stored in.
81 * the repositories using the upload() method should implement a check for $areamaxbytes,
82   see repository/upload/lib.php upload() and process_upload() for an example on how handling it.
84 === 2.3 ===
86 * instance_config_form() must now be declared static for php5.4 compatibility.
88 * get_listing() and search() file metadata details are now now more prominently
89   displayed in the interface. Dates and timestamos are now able to be sorted on in
90   the filepicker interface so plugin authors are asked to ensure:
91     - Dates are defined as UNIX timestamps
92     - Filesize is an integer in bytes
94 * It is recomended to define function get_file_source_info() to provide more rich
95   infromation about the source of a file.
97 * The API was extended to allow repositories can now support external references, please
98   see http://docs.moodle.org/dev/Repository_API for further details.