The class responsible for files migration.
More...
|
| __construct (moodle1_converter $converter, $contextid=null, $component=null, $filearea=null, $itemid=0, $userid=null) |
| Constructor optionally accepting some default values for the migrated files.
|
|
| get_fileids () |
| Returns the list of all file ids migrated by this instance so far.
|
|
| 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.
|
|
| migrate_directory ($rootpath, $relpath='/') |
|
| migrate_file ($sourcepath, $filepath='/', $filename=null, $sortorder=0, $timecreated=null, $timemodified=null) |
|
| reset_fileids () |
| Explicitly clear the list of file ids migrated by this instance so far.
|
|
|
string | $component |
| component name of the files being migrated
|
|
int | $contextid |
| context id of the files being migrated
|
|
moodle1_converter | $converter |
| instance we serve to
|
|
string | $filearea |
| file area of the files being migrated
|
|
int | $itemid = 0 |
| item id of the files being migrated
|
|
int | $userid |
| user id
|
|
|
| add_file_to_pool ($pathname) |
| Copies the given file to the pool directory.
|
|
| make_file_record (array $fileinfo) |
| internal implementation details ////////////////////////////////////////
|
|
| stash_file (array $filerecord) |
| Stashes the file record into 'files' stash and adds the record id to list of migrated files.
|
|
|
string | $basepath |
| the root of the converter temp directory
|
|
array | $fileids = array() |
| of file ids that were migrated by this instance
|
|
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_file_manager::__construct |
( |
moodle1_converter | $converter, |
|
|
| $contextid = null, |
|
|
| $component = null, |
|
|
| $filearea = null, |
|
|
| $itemid = 0, |
|
|
| $userid = null ) |
Constructor optionally accepting some default values for the migrated files.
- Parameters
-
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 |
◆ add_file_to_pool()
moodle1_file_manager::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.
- Parameters
-
string | $pathname | the full path to the file |
- Return values
-
array | with keys (string)contenthash, (int)filesize, (bool)newfile |
◆ get_fileids()
moodle1_file_manager::get_fileids |
( |
| ) |
|
Returns the list of all file ids migrated by this instance so far.
- Return values
-
◆ log()
moodle1_file_manager::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.
Implements loggable.
◆ make_file_record()
moodle1_file_manager::make_file_record |
( |
array | $fileinfo | ) |
|
|
protected |
internal implementation details ////////////////////////////////////////
Prepares a fake record from the files table
- Parameters
-
array | $fileinfo | explicit file data |
- Return values
-
◆ stash_file()
moodle1_file_manager::stash_file |
( |
array | $filerecord | ) |
|
|
protected |
Stashes the file record into 'files' stash and adds the record id to list of migrated files.
- Parameters
-
The documentation for this class was generated from the following file:
- backup/converter/moodle1/lib.php