|
Moodle
2.2.1
http://www.collinsharper.com
|


| static description | ( | ) | [static] |
Reimplemented from base_converter.
| static detect_format | ( | $ | tempdir | ) | [static] |
Detects the Moodle 1.9 format of the backup directory
| string | $tempdir | the name of the backup directory |
Reimplemented from base_converter.
Definition at line 89 of file lib.php.

| execute | ( | ) | [protected] |
Converts the contents of the tempdir into the target format in the workdir
Reimplemented from base_converter.
Definition at line 145 of file lib.php.

| static find_referenced_files | ( | $ | text | ) | [static] |
| get_contextid | ( | $ | level, |
| $ | instance = 0 |
||
| ) |
Generates an artificial context id
Moodle 1.9 backups do not contain any context information. But we need them in Moodle 2.x format so here we generate fictive context id for every given context level + instance combo.
CONTEXT_SYSTEM and CONTEXT_COURSE ignore the $instance as they represent a single system or the course being restored.
| int | $level | the context level, like CONTEXT_COURSE or CONTEXT_MODULE |
| int | $instance | the instance id, for example $course->id for courses or $cm->id for activity modules |
Definition at line 536 of file lib.php.

| get_file_manager | ( | $ | contextid = null, |
| $ | component = null, |
||
| $ | filearea = null, |
||
| $ | itemid = 0, |
||
| $ | userid = null |
||
| ) |
Creates and returns new instance of the file manager
| int | $contextid | the default context id of the files being migrated |
| string | $component | the default component name of the files being migrated |
| string | $filearea | the default file area of the files being migrated |
| int | $itemid | the default item id of the files being migrated |
| int | $userid | initial user id of the files being migrated |
| get_inforef_manager | ( | $ | name, |
| $ | id = 0 |
||
| ) |
Creates and returns new instance of the inforef manager
| string | $name | the name of the annotator (like course, section, activity, block) |
| int | $id | the id of the annotator if required |
| get_nextid | ( | ) |
| get_stash | ( | $ | stashname, |
| $ | itemid = 0 |
||
| ) |
Restores a given stash stored previously by self::set_stash()
| string | $stashname | name of the stash |
| int | $itemid | optional id for multiple infos within the same stashname |
| moodle1_convert_empty_storage_exception | if the info has not been stashed previously |
Definition at line 462 of file lib.php.


| get_stash_itemids | ( | $ | stashname | ) |
| get_stash_names | ( | ) |
| get_stash_or_default | ( | $ | stashname, |
| $ | itemid = 0, |
||
| $ | default = null |
||
| ) |
Restores a given stash or returns the given default if there is no such stash
| string | $stashname | name of the stash |
| int | $itemid | optional id for multiple infos within the same stashname |
| mixed | $default | information to return if the info has not been stashed previously |
Definition at line 481 of file lib.php.

| grouped_parent_exists | ( | $ | pelement, |
| $ | elements | ||
| ) | [protected] |
Helper method used by self::register_handler()
| convert_path | $pelement | path element |
| array | of convert_path instances |
Definition at line 212 of file lib.php.

| init | ( | ) | [protected] |
Initialize the instance if needed, called by the constructor
Here we create objects we need before the execution.
Reimplemented from base_converter.
Definition at line 116 of file lib.php.

| log | ( | $ | message, |
| $ | level, | ||
| $ | a = null, |
||
| $ | depth = null, |
||
| $ | display = false |
||
| ) |
This function will be responsible for handling the params, and to call to the corresponding logger->process() once all modifications in params have been performed
Reimplemented from base_converter.
Definition at line 79 of file lib.php.

| static migrate_referenced_files | ( | $ | text, |
| moodle1_file_manager $ | fileman | ||
| ) | [static] |
Migrates all course files referenced from the hypertext using the given filemanager
This is typically used to convert images embedded into the intro fields.
| string | $text | hypertext containing $$ referenced |
| moodle1_file_manager | $fileman | file manager to use for the file migration |
Definition at line 600 of file lib.php.


| path_end_reached | ( | $ | path | ) |
| path_start_reached | ( | $ | path | ) |
Executes operations required at the start of a watched path
For MOD and BLOCK paths, this is supported only for the sub-paths, not the root module/block element. For the illustration:
You CAN'T attach on_xxx_start() listener to a path like /MOODLE_BACKUP/COURSE/MODULES/MOD/WORKSHOP because the <MOD> must be processed first in self::process_chunk() where $this->currentmod is set.
You CAN attach some on_xxx_start() listener to a path like /MOODLE_BACKUP/COURSE/MODULES/MOD/WORKSHOP/SUBMISSIONS because it is a sub-path under <MOD> and we have $this->currentmod already set when the <SUBMISSIONS> is reached.
| string | $path | in the original file |
| process_chunk | ( | $ | data | ) |
Process the data obtained from the XML parser processor
This methods receives one chunk of information from the XML parser processor and dispatches it, following the naming rules. We are expanding the modules and blocks paths here to include the plugin's name.
| array | $data |
Definition at line 238 of file lib.php.

| register_handler | ( | moodle1_handler $ | handler, |
| array $ | elements | ||
| ) | [protected] |
| static rewrite_filephp_usage | ( | $ | text, |
| array $ | files | ||
| ) | [static] |
| set_stash | ( | $ | stashname, |
| $ | info, | ||
| $ | itemid = 0 |
||
| ) |
Stores some information for later processing
This implementation uses backup_ids_temp table to store data. Make sure that the $stashname + $itemid combo is unique.
| string | $stashname | name of the stash |
| mixed | $info | information to stash |
| int | $itemid | optional id for multiple infos within the same stashname |
Definition at line 445 of file lib.php.


| const SKIP_ALL_CHILDREN = -991399 |