|
Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
The class responsible for files migration. More...
Public Member Functions | |
| __construct (moodle1_converter $converter, $contextid=null, $component=null, $filearea=null, $itemid=0, $userid=null) | |
| Constructor optionally accepting some default values for the migrated files. More... | |
| get_fileids () | |
| Returns the list of all file ids migrated by this instance so far. More... | |
| 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. More... | |
| 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. | |
Public Attributes | |
| 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 | |
Protected Member Functions | |
| add_file_to_pool ($pathname) | |
| Copies the given file to the pool directory. More... | |
| make_file_record (array $fileinfo) | |
| internal implementation details //////////////////////////////////////// More... | |
| stash_file (array $filerecord) | |
| Stashes the file record into 'files' stash and adds the record id to list of migrated files. More... | |
Protected Attributes | |
| 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.
| 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.
| 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 |
|
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 |
| array | with keys (string)contenthash, (int)filesize, (bool)newfile |
| moodle1_file_manager::get_fileids | ( | ) |
Returns the list of all file ids migrated by this instance so far.
| array | of int |
| 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.
|
protected |
internal implementation details ////////////////////////////////////////
Prepares a fake record from the files table
| array | $fileinfo | explicit file data |
| array |
|
protected |
Stashes the file record into 'files' stash and adds the record id to list of migrated files.
| array | $filerecord |