19declare(strict_types=1);
42 return 'RecordFilesMigration';
63 $this->db = $environment->getResource(
Environment::RESOURCE_DATABASE);
69 $files = $this->getFiles();
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);
101 if (!is_dir($this->getExportDir())) {
104 foreach (scandir($this->getExportDir()) as $file) {
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;
static getDir(string $a_dir, bool $a_rec=false, ?string $a_sub_dir="")
get directory
static getDataDir()
get data directory (outside webspace)
Class ilResourceStorageMigrationHelper.
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
An environment holds resources to be used in the setup process.
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...