MDL-34290 curl class: add functions to return error code and to download one file
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);
MDL-34290 class oauth_helper, added API to pass options to curl (such as timeout)
MDL-34290 repository API: allow get_file_by_reference return only filesize

we want to allow repositories to perform quick synchronisation, without downloading the file. In this case they return
only filesize, without the contenthash
MDL-34290 repository API: do not confuse source and reference

make sure that repository function get_file_source_info receives as argument the source of the file,
and get_file receives a reference;
reference is a value of DB field files_reference.reference and result of get_file_reference(source).
Fix dropbox as the only repository that have different values in those fields;
also added information about user in dropbox reference and original
MDL-34290 repository API: add timeout to get_file and throw exception

- get_file should have a request timeout and throw an exception with the details (i.e. timeout reached) if download can
not be completed
- corrected phpdocs
MDL-34290 repository_filesystem add original info function and reduce ref lifetime
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
MDL-34290 repository_boxnet, boxlib use request timeouts

boxlib receives additional argument as request timeout
repository_boxnet::get_file_by_reference respects request timeouts and downloads file into moodle only if it is image
also some improvements to repository_boxnet source display functions;
also do not cache result of request in retrieving of listing, user is unable to see the new files he added to box.
MDL-34290 repository_equella: do not download files when not needed

repository_equella::get_file_by_reference respects request timeouts, downloads only images (for thumbnail generation),
does not use cache_file class (content is cached in moodle filepool if needed);
also repository_equella has counter of unsuccessfull connect attempts and do not perform any more if 3 failed
(within one request)
MDL-34290 Allow to have several requests to the same instance of oauth_helper
MDL-34290 oauthlib_helper support for POST request
MDL-34290 repository_dropbox reference handling

- When Dropbox file is inserted by reference, the shared link is created and stored
- Added a function to fix old references (containing access_key/secret) with the proper ones
- Added support for external links in Dropbox (FILE_EXTERNAL), using the shared link API
- Make sure that repository::get_link() receives reference and not source (other repositories than Dropbox have those fields identical)
- Function get_file_by_reference respects request timeouts, downloads only images (for thumbnail generation),
- Function get_file respects request timeout
- do not use cache_file class (content is cached in moodle filepool if needed)
- added parameter for maximum size of files to cache
- added 'Manage' link for Filepicker
- added user name to
- added user name (if different from current) to 'Original' field
- added/corrected phpdocs
MDL-34290 remove class cache_file as not used

in fact we have moodle filepool that can work perfectly for caching files, no need to create new class and storage
MDL-34665 Dropbox displays thumbnails and return info about file size and date last modified
MDL-34290 Auto synchronise newly created references when possible
MDL-34290, MDL-33416 prepare to deprecate fields files.referencelastsync and referencelifetime
MDL-34290 Added timeout to googledocs request to download a file