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

Static Public Member Functions | |
| static | generate_id ($entropy) |
| static | available_converters ($restore=true) |
| static | export_converter_dependencies ($converter, $dependency) |
| static | detect_moodle2_format ($tempdir) |
| static | to_moodle2_format ($tempdir, $format=null, $logger=null) |
| static | set_inforef ($contextid) |
| static | get_inforef ($contextid) |
Static Protected Member Functions | |
| static | choose_conversion_path ($format, array $descriptions) |
| end of public API ////////////////////////////////////////////////////// | |
Provides various functionality via its static methods
Definition at line 34 of file convert_helper.class.php.
| static available_converters | ( | $ | restore = true | ) | [static] |
Returns the list of all available converters and loads their classes
Converter must be installed as a directory in backup/converter/ and its method is_available() must return true to get to the list.
Definition at line 53 of file convert_helper.class.php.


| static choose_conversion_path | ( | $ | format, |
| array $ | descriptions | ||
| ) | [static, protected] |
end of public API //////////////////////////////////////////////////////
Choose the best conversion path for the given format
Given the source format and the list of available converters and their properties, this methods picks the most effective way how to convert the source format into the target moodle2 format. The method returns a list of converters that should be called, in order.
This implementation uses Dijkstra's algorithm to find the shortest way through the oriented graph.
| string | $format | the source backup format, one of backup::FORMAT_xxx |
| array | $descriptions | list of base_converter::description() indexed by the converter name |
Reimplemented in testable_convert_helper.
Definition at line 255 of file convert_helper.class.php.

| static detect_moodle2_format | ( | $ | tempdir | ) | [static] |
Detects if the given folder contains an unpacked moodle2 backup
| string | $tempdir | the name of the backup directory |
Definition at line 139 of file convert_helper.class.php.

| static export_converter_dependencies | ( | $ | converter, |
| $ | dependency | ||
| ) | [static] |
Definition at line 105 of file convert_helper.class.php.

| static generate_id | ( | $ | entropy | ) | [static] |
| string | $entropy |
Definition at line 40 of file convert_helper.class.php.


| static get_inforef | ( | $ | contextid | ) | [static] |
Definition at line 233 of file convert_helper.class.php.
| static set_inforef | ( | $ | contextid | ) | [static] |
Inserts an inforef into the conversion temp table
Definition at line 229 of file convert_helper.class.php.
| static to_moodle2_format | ( | $ | tempdir, |
| $ | format = null, |
||
| $ | logger = null |
||
| ) | [static] |
Converts the given directory with the backup into moodle2 format
| string | $tempdir | The directory to convert |
| string | $format | The current format, if already detected |
| base_logger|null | if the conversion should be logged, use this logger |
| convert_helper_exception |
Definition at line 175 of file convert_helper.class.php.

