Moodle  2.2.1
http://www.collinsharper.com
convert_helper Class Reference
Inheritance diagram for convert_helper:

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 //////////////////////////////////////////////////////

Detailed Description

Provides various functionality via its static methods

Definition at line 34 of file convert_helper.class.php.


Member Function Documentation

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.

See also:
base_converter::is_available()
Returns:
array of strings

Definition at line 53 of file convert_helper.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

See also:
http://en.wikipedia.org/wiki/Dijkstra's_algorithm
Author:
David Mudrak <david@moodle.com>
Parameters:
string$formatthe source backup format, one of backup::FORMAT_xxx
array$descriptionslist of base_converter::description() indexed by the converter name
Returns:
array ordered list of converter names to call (may be empty if not reachable)

Reimplemented in testable_convert_helper.

Definition at line 255 of file convert_helper.class.php.

Here is the caller graph for this function:

static detect_moodle2_format ( tempdir) [static]

Detects if the given folder contains an unpacked moodle2 backup

Parameters:
string$tempdirthe name of the backup directory
Returns:
boolean true if moodle2 format detected, false otherwise

Definition at line 139 of file convert_helper.class.php.

Here is the caller graph for this function:

static export_converter_dependencies ( converter,
dependency 
) [static]

Definition at line 105 of file convert_helper.class.php.

Here is the caller graph for this function:

static generate_id ( entropy) [static]
Parameters:
string$entropy
Returns:
string random identifier

Definition at line 40 of file convert_helper.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Parameters:
string$tempdirThe directory to convert
string$formatThe current format, if already detected
base_logger|nullif the conversion should be logged, use this logger
Exceptions:
convert_helper_exception
Returns:
bool false if unable to find the conversion path, true otherwise

Definition at line 175 of file convert_helper.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations