Commit Graph

66 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
53f95c99cb MDL-54205 backup: loggers close() and destroy()
Any backup & restore operation may be leaving opened files
if a file logger is being used. This implementes the close()
method, so every logger can close any resource.

Also, the recommended backup_controlled::destroy() method
now calls to new logger::destroy() method in charge of
deleting all the references and closing any resource.

Finally, some internally used controllers, were missing
their destroy call, leading to associated loggers to
remain open. Now all them are explicitly deltroyed.
2016-05-13 01:54:28 +02:00
Dan Poltawski
04a03ff282 Merge branch 'wip-MDL-50851-master' of git://github.com/marinaglancy/moodle 2016-01-12 14:17:14 +00:00
Cameron Ball
088d6086d8 MDL-21912 restore: Add admin setting to restore conflicting admin user 2016-01-11 14:08:58 +08:00
Marina Glancy
c4e868d5f0 MDL-50851 user: use new tag API for interests 2016-01-10 15:25:47 +08:00
Tony Levi
303936aa57 MDL-50453 core: Replace reserved word usage in progress\null (PHP7) 2015-06-15 12:21:27 +09:30
sam marshall
9f7b688c63 MDL-46079 Restore: Can run out of memory in get_records call 2014-06-20 14:15:28 +01:00
Ankit Agarwal
a9282e4120 MDL-45258 tags:context object/0 should not be passed to tag_set() 2014-04-28 15:35:01 +08:00
Mark Nelson
cc033d48b5 MDL-44316 core_tag: changed the API to accept a contextid and component 2014-03-22 13:50:08 -07:00
Dan Marsden
538864dffd MDL-44066 Restore: Restore source field.
Causes problems when restoring a SCORM pacakge that uses an alias.
2014-03-08 21:09:30 +13:00
James Pratt
809fdb83b1 MDL-41754 (1) Progress tracking : moved from backup and restore to core 2014-01-27 17:45:50 +07:00
sam marshall
40e8f0260c MDL-42815 Backup/restore: Error saving files - log messages unhelpful
This commit contains three changes in the three files:
1. A bug in the backup process meant that anything logged after a
   certain point did not appear in the on-screen display of the
   backup log, because the logger was serialised and deserialised
   but display code referred to the old version. Changed so that
   code retrieves new object.
2. Add more information to backup log when there is a missing file.
3. Add more information to restore log when there is a missing file
   (and remove existing code duplication of the current message).

The 'missing file' situation is one that generally shouldn't occur in
normal usage, but when it does happen, it is useful to have full
information about the file.
2013-11-11 17:15:32 +00:00
Damyon Wiese
3a33578926 Merge branch 'wip-mdl-30812' of git://github.com/rajeshtaneja/moodle 2013-10-28 12:11:34 +08:00
Rajesh Taneja
0daadaaeaf MDL-34612 Restore: Gracefully handle empty file contenthash while restoring 2013-10-22 09:47:42 +08:00
sam marshall
b6cdb4d660 MDL-42389 Restore: Broken restore causes notice before exception 2013-10-18 12:00:56 +01:00
sam marshall
0e2637054f MDL-42039 Restore: Add progress tracking while creating users
When restoring a backup that contains a large number of users
to a different server where those users don't already exist,
creating users can take a significant time. This change adds
progress reporting so that it doesn't time out and shows
activity in the user interface while doing the creation.
2013-10-10 10:57:31 +08:00
sam marshall
37ff843d7d MDL-42039 Restore: Add progress reporting between files in resource
When a resource contains a very large number of (presumably small)
files, we should display progress between each file so that it
doesn't time out.
2013-10-10 10:56:30 +08:00
Damyon Wiese
3d27180e94 MDL-40493 User preference: Allow users to set their preferred text editor.
This changes the setting htmleditor in the user table from a 0 or 1 column
to a user preference for the name of their preferred html editor.
2013-10-02 12:49:30 +08:00
sam marshall
4fb31ae6cd MDL-41669 Restore: Progress bar needs to include more tasks
1. Changes progress bar code to allow headings for progress bar (so users have
   some clue what's going on if a page has more than one progress bar).
2. Changes restore code so that a progress bar can display during pre-checks if
   they take longer than 5 seconds.
3. Changes pre-check and restore code so that, in various points where the system
   can take a long time within an individual step, intederminate progress is
   indicated and it won't time out.
2013-09-16 17:18:12 +01:00
Dan Poltawski
50aa2587a4 Merge branch 'MDL-40618_restore_get_questions' of https://github.com/mr-russ/moodle 2013-07-29 14:14:58 +08:00
Russell Smith
3e7e2ab2ee MDL-40618 backup: centralize info field, use info in queries.
encode_backup_temp_info() and decode_backup_temp_info() have been
introduced to keep the info field encoding in one place.
Many locations used get_backup_ids_record() to obtain info, that
makes lots of calls to get_backup_ids_record() which can be slow.
We now complete all those inline by adding the info field to the query.
To reduce memory usage, all queries of that nature have been changed
to use get_recordset_*. gzcompress was introduced if available to minimize
traffic to/from the database and to decrease the memory required for caching.
The compression time is saved by the benefits in other places of having smaller data.
2013-07-23 19:50:53 +10:00
Dan Poltawski
3ee8607d46 Merge branch 'MDL-40584' of https://github.com/mr-russ/moodle 2013-07-23 12:35:41 +08:00
Russell Smith
42574d0900 MDL-40584 backup: Query db once per category in precheck
The cache is function local and testing against a large database
indicates 10k questions is a large category.  Restore already
uses MEMORY_EXTRA and that will have enough space for the couple
of megabtyes a local sql hash will introduce.
2013-07-15 16:44:45 +10:00
Damyon Wiese
d7bf5fd1f7 Merge branch 'MDL-40440-m' of git://github.com/andrewnicols/moodle 2013-07-15 14:42:10 +08:00
Frederic Massart
8e8891b76b MDL-40403 libraries: Deprecate get_parent_contexts() 2013-07-09 13:34:44 +08:00
Andrew Nicols
100360f96c MDL-40440 Backup: Skip files that already exist 2013-07-02 11:13:03 +01:00
Andrew Nicols
b1850c12c1 MDL-37761 Backup: Do not include files in backups when importing courses/activities
When we import courses or duplicate activities, the deduplicating nature of
the file_storage system means that we don't actually have to include the
real files in the backup - just their metadata from the file table.

The restoration process needs to know not to expect files from the backup
phase so a flag is set in moodle_backup metadata.
2013-06-18 07:52:04 +01:00
Rex Lorenzo
b4d33e02c0 MDL-34275 - Use default copyright license when restoring files 2013-05-07 09:09:38 +01:00
Simon Coggins
ec2d8ceb88 MDL-35332 lib: Improve security of hashed passwords 2013-02-09 06:47:57 +13:00
Davo Smith
f5744d1cfa MDL-31484 backup - repeated restores with anonymised users now works correctly 2012-11-29 19:57:16 +00:00
Mark Nielsen
ac1f907e77 MDL-34837 backup: Restore does not fail when some courses have the same name 2012-10-15 17:18:34 +08:00
Frederic Massart
3b232aeffb MDL-28346 Backup: Restore does not fail when a file is missing 2012-09-03 14:13:11 +08:00
Adrian Greeve
a689cd1def MDL-34469 - lib - replacement of the deprecated get_context_instance and get_context_by_id functions (group 15) 2012-07-30 14:59:57 +08:00
Petr Skoda
c52551dc3c MDL-8249 localise standard role names and descriptions if empty 2012-07-06 08:22:34 +02:00
David Mudrák
83b2cc562d MDL-33430 Set newcontextid and newitemid when sending file to the pool 2012-06-21 02:31:18 +02:00
David Mudrák
4b6b087faf MDL-33430 Do not restore aliases yet, stash them for later processing 2012-06-21 02:29:34 +02:00
Eloy Lafuente (stronk7)
f0852f474b MDL-33630 backup: invalidate ids cache on temptable drop. 2012-06-10 04:57:40 +02:00
Rajesh Taneja
e7b24943e6 MDL-27120 backup: fixed docblock and code cleanup 2012-05-29 16:22:45 +08:00
Tony Levi
7f98b12f91 MDL-27120: Cache DB operations in restore_dbops 2012-05-29 14:44:07 +08:00
Dongsheng Cai
6723372514 MDL-28666 Extends repository to support references
1. Allow repository to create references to external contents
2. Extends files API to handle file references
3. Generic file caching
4. Backup/restore file references
5. Download external contents if repository uninstalled
6. Allow filepicker to display iframe
7. PHPUnit test suits
2012-05-21 11:57:51 +08:00
Eloy Lafuente (stronk7)
ac6dc09c26 MDL-29248 backup: take rid of the setting and code handling the 'private' user filearea 2012-03-01 13:09:47 +01:00
Eloy Lafuente (stronk7)
ede7105fd9 MDL-27233 move the restorer enrol/ra creation to the very beginning of the restore process
Some early steps in restore are using capability checks to decide how to
restore some information. But at that stage, if the course contents have
been removed and the user had perms at course level only (usually teacher)
the process can fail because some content is not restoreable due to the
lack of permissions.

Moving the restorer step to the beginning really helps is those situations
and it does not hurt at all.

Also, fixed one notice detected when testing this.
2011-11-25 01:07:27 +01:00
Eloy Lafuente (stronk7)
0620787a17 Merge branch 'w47_MDL-27233_m22_restoreenrol' of git://github.com/skodak/moodle 2011-11-24 23:44:24 +01:00
Petr Skoda
d53e3298c0 MDL-27233 add new options to keep enrols and groups purging existing course in restore 2011-11-23 18:38:27 +01:00
Eloy Lafuente (stronk7)
1acad8eed7 MDL-30192 restore - prevent any extra info to be created for deleted users 2011-11-18 13:03:08 +01:00
Ankit Kumar Agarwal
ef6b3ba159 MDL-29035 Backups making email match case-insensitive when restoring backups 2011-11-03 10:18:15 +05:30
Aparup Banerjee
ed6a14eb03 MDL-28453 backup - made temporary restoration courses hidden by default. 2011-07-25 16:34:11 +08:00
Eloy Lafuente
648a575eda NOBUG: Added support for after_restore() methods on restore. Will help some blocks. 2010-11-01 15:53:35 +00:00
Eloy Lafuente
41941110fd MDL-22138 backup - I know smaller cathedrals than this, yay quizzes! 2010-10-24 10:43:42 +00:00
Sam Hemelryk
593fc4a977 restore MDL-23863 Category->coursecount is incremented if restoring to a new course. 2010-09-21 10:12:58 +00:00
Petr Skoda
e894efc31c MDL-24321 switching to stdClass in /backup/ 2010-09-21 08:47:01 +00:00