| 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 |
| 5 | |
| 6 | === 4.0 === |
| 7 | * The repository_boxnet has been completely removed. |
| 8 | * The repository_picasa has been completely removed (Picasa is discontinued since 2016). |
| 9 | * The skydrive repository has been completely removed from core. It has been moved to the plugins database repository, so |
| 10 | it can still be installed as a third-party plugin. |
| 11 | * Methods can_import_skydrive_files() and import_skydrive_files have been deprecated from repository_onedrive. The feature For |
| 12 | importing files from repository_skydrive to repository_onedrive will be completely removed in Moodle 4.4. |
| 13 | |
| 14 | === 3.11 === |
| 15 | * The Google Drive repository now includes a new rest API function 'shared_drives_list', which can be used to fetch |
| 16 | a list of existing shared drives. |
| 17 | * The Google Drive repository now supports browsing and searching for content from shared drives. |
| 18 | * The method build_breadcrumb() in repository/googledocs/lib.php has been deprecated, please use get_navigation() |
| 19 | from the googledocs repository content classes instead. |
| 20 | * The method build_node_path() in repository/googledocs/lib.php has been deprecated, please use |
| 21 | \repository_googledocs\helper::build_node_path() instead. |
| 22 | * The method explode_node_path() in repository/googledocs/lib.php has been deprecated, please use |
| 23 | \repository_googledocs\helper::explode_node_path() instead. |
| 24 | * The function query() in repository/googledocs/lib.php is deprecated, please use get_content_nodes() from the |
| 25 | googledocs repository content classes instead. |
| 26 | |
| 27 | === 3.4 === |
| 28 | Repositories should no longer directly call file_system#add_file_to_pool or file_system#add_string_to_pool |
| 29 | instead they should call the stored_file method, set_synchronised_content_from_file or set_synchronised_content_from_string |
| 30 | |
| 31 | === 3.3 === |
| 32 | The skydrive repository is deprecated - please migrate to the newer onedrive repository. |
| 33 | |
| 34 | === 3.2 === |
| 35 | |
| 36 | * The method repository::uses_post_requests() has been deprecated and must not be used anymore. |
| 37 | * The alfresco repository has been moved to the plugins database. It was |
| 38 | using an older version of the Alfresco SDK which is not compatible with recent versions of Alfresco. |
| 39 | |
| 40 | === 3.1 === |
| 41 | |
| 42 | * The following functions, previously used (exclusively) by upgrade steps are not available |
| 43 | anymore because of the upgrade cleanup performed for this version. See MDL-51580 for more info: |
| 44 | - repository_picasa_admin_upgrade_notification() |
| 45 | - repository_googledocs_admin_upgrade_notification() |
| 46 | - repository_boxnet_admin_upgrade_notification() |
| 47 | - repository_alfresco_admin_security_key_notice() |
| 48 | * The prepare_file() function will now return a file in a per-request directory which will |
| 49 | be automatically cleaned at the end of the request. |
| 50 | No modifications should be required as a result of this change. |
| 51 | |
| 52 | === 2.8 === |
| 53 | |
| 54 | * Repositories working with Moodle files must replace serialize() with json_encode() in the |
| 55 | attribute 'source' returned by get_listing(). If repository overrides file_is_accessible(), |
| 56 | get_file_reference() or get_file_source_info() they need to be changed too. See MDL-45616. |
| 57 | |
| 58 | === 2.6 === |
| 59 | |
| 60 | * get_option() now always return null when the first parameter ($config) is not empty, and |
| 61 | no value was found for this $config. Previously this could sometimes return an empty array(). |
| 62 | |
| 63 | * The function repository_attach_id() was removed, it was never used and was not useful. |
| 64 | |
| 65 | * New functions send_relative_file() and supports_relative_file() to allow sending relative linked |
| 66 | files - see filesystem repository for example. |
| 67 | |
| 68 | * DB fields files.referencelifetime, files.referencelastsync and files_reference.lifetime |
| 69 | are deleted. The last synchronization time is stored only in files_reference.lastsync |
| 70 | and lifetime is not stored in DB any more, each repository must decide for itself |
| 71 | when to synchronize the file in function repository::sync_reference(). |
| 72 | |
| 73 | * The following methods in class repository are deprecated: sync_external_file(), |
| 74 | get_file_by_reference(), get_reference_file_lifetime(), sync_individual_file() and |
| 75 | reset_caches(). Instead there is one method repository::sync_reference() - this simplifies |
| 76 | the repositories API and reduces the number of DB queries. |
| 77 | |
| 78 | * Deprecated const GETFILE_TIMEOUT, SYNCFILE_TIMEOUT and SYNCIMAGE_TIMEOUT and replaced them with |
| 79 | config variables repositorygetfiletimeout, repositorysyncfiletimeout and repositorysyncimagetimeout. |
| 80 | |
| 81 | === 2.5 === |
| 82 | |
| 83 | * repository::append_suffix() has been deprecated, use repository::get_unused_filename() if you need |
| 84 | to get a file name which has not yet been used in the draft area. |
| 85 | |
| 86 | * contains_private_data() is a new method to determine if a user 'logged in as' another user |
| 87 | can access the content of the repository. The default is to return True (no access). |
| 88 | |
| 89 | * get_typename() returns the type of repository: dropbox, googledocs, etc... |
| 90 | |
| 91 | * can_be_edited_by_user() encapsulates all the tests to make sure that the current user |
| 92 | has the rights to edit the instance of this repository. |
| 93 | |
| 94 | * repository::get_instances() (used by filepicker and texteditor to populate the |
| 95 | list of available repositories) now calls repository constructor specifying the |
| 96 | context where repository will be used. |
| 97 | When checking permissions inside repository class use: |
| 98 | $this->instance->contextid - to find the context where repository was created; |
| 99 | $this->context - to find the current context where repository is used. |
| 100 | This also means that the same repository instance may now have different names when |
| 101 | called from different contexts. |
| 102 | Avoid calling repository::get_instance(), use repository::get_repository_by_id() instead. |
| 103 | |
| 104 | === 2.4 === |
| 105 | |
| 106 | * copy_to_area() can receive a new parameter called $areamaxbytes which controls the maximum |
| 107 | size of the area the files will be stored in. |
| 108 | |
| 109 | * the repositories using the upload() method should implement a check for $areamaxbytes, |
| 110 | see repository/upload/lib.php upload() and process_upload() for an example on how handling it. |
| 111 | |
| 112 | === 2.3 === |
| 113 | |
| 114 | * instance_config_form() must now be declared static for php5.4 compatibility. |
| 115 | |
| 116 | * get_listing() and search() file metadata details are now now more prominently |
| 117 | displayed in the interface. Dates and timestamos are now able to be sorted on in |
| 118 | the filepicker interface so plugin authors are asked to ensure: |
| 119 | - Dates are defined as UNIX timestamps |
| 120 | - Filesize is an integer in bytes |
| 121 | |
| 122 | * It is recomended to define function get_file_source_info() to provide more rich |
| 123 | infromation about the source of a file. |
| 124 | |
| 125 | * The API was extended to allow repositories can now support external references, please |
| 126 | see http://docs.moodle.org/dev/Repository_API for further details. |