19 declare(strict_types=1);
42 return 'RecordFilesMigration';
70 $object_id = array_key_first($files);
71 $file_path = $files[$object_id][0];
72 $stakeholder = (
new Stakeholder())->withOwnerId(6);
74 $rid = $irss_helper->movePathToStorage($file_path, 6,
null,
null,
false);
75 $this->db->manipulate(
76 "INSERT INTO adv_md_record_files VALUES (" 86 foreach ($this->
getFiles() as $object_id => $file_paths) {
87 $steps += count($file_paths);
107 (!preg_match(
'/^export_([0-9]+)$/', $file, $matches) && $file !==
"export") ||
108 in_array($file, [
'.',
'..',
'.DS_Store'])
112 $object_id = count($matches) == 2
115 $dirs[$object_id] = $this->
getExportDir() . DIRECTORY_SEPARATOR . $file;
117 foreach ($dirs as $object_id => $dir) {
120 if (in_array($file_name, [
'.',
'..',
'.DS_Store'])) {
123 $files_in_dir[] = $dir . DIRECTORY_SEPARATOR . $file_name;
125 if (!empty($files_in_dir)) {
126 $files[$object_id] = $files_in_dir;
A migration is a potentially long lasting operation that can be broken into discrete steps...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getDir(string $a_dir, bool $a_rec=false, ?string $a_sub_dir="")
get directory
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
static getDataDir()
get data directory (outside webspace)
An environment holds resources to be used in the setup process.