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


Public Member Functions | |
| __construct (moodle1_converter $converter, $contextid=null, $component=null, $filearea=null, $itemid=0, $userid=null) | |
| migrate_file ($sourcepath, $filepath= '/', $filename=null, $sortorder=0, $timecreated=null, $timemodified=null) | |
| migrate_directory ($rootpath, $relpath='/') | |
| get_fileids () | |
| reset_fileids () | |
| log ($message, $level, $a=null, $depth=null, $display=false) | |
Data Fields | |
| $converter | |
| $contextid | |
| $component | |
| $filearea | |
| $itemid = 0 | |
| $userid | |
Protected Member Functions | |
| make_file_record (array $fileinfo) | |
| internal implementation details //////////////////////////////////////// | |
| add_file_to_pool ($pathname) | |
| stash_file (array $filerecord) | |
Protected Attributes | |
| $basepath | |
| $textlib | |
| $fileids = array() | |
The class responsible for files migration
The files in Moodle 1.9 backup are stored in moddata, user_files, group_files, course_files and site_files folders.
| __construct | ( | moodle1_converter $ | converter, |
| $ | contextid = null, |
||
| $ | component = null, |
||
| $ | filearea = null, |
||
| $ | itemid = 0, |
||
| $ | userid = null |
||
| ) |
Constructor optionally accepting some default values for the migrated files
| moodle1_converter | $converter | the converter instance we serve to |
| int | $contextid | initial context id of the files being migrated |
| string | $component | initial component name of the files being migrated |
| string | $filearea | initial file area of the files being migrated |
| int | $itemid | initial item id of the files being migrated |
| int | $userid | initial user id of the files being migrated |
Definition at line 1180 of file lib.php.

| add_file_to_pool | ( | $ | pathname | ) | [protected] |
Copies the given file to the pool directory
Returns an array containing SHA1 hash of the file contents, the file size and a flag indicating whether the file was actually added to the pool or whether it was already there.
| string | $pathname | the full path to the file |
Definition at line 1386 of file lib.php.


| get_fileids | ( | ) |
| log | ( | $ | message, |
| $ | level, | ||
| $ | a = null, |
||
| $ | depth = null, |
||
| $ | display = false |
||
| ) |
| make_file_record | ( | array $ | fileinfo | ) | [protected] |
| migrate_directory | ( | $ | rootpath, |
| $ | relpath = '/' |
||
| ) |
| migrate_file | ( | $ | sourcepath, |
| $ | filepath = '/', |
||
| $ | filename = null, |
||
| $ | sortorder = 0, |
||
| $ | timecreated = null, |
||
| $ | timemodified = null |
||
| ) |
| reset_fileids | ( | ) |
| stash_file | ( | array $ | filerecord | ) | [protected] |