ILIAS  release_8 Revision v8.23
ilFileObjectToStorageMigration Class Reference
+ Inheritance diagram for ilFileObjectToStorageMigration:
+ Collaboration diagram for ilFileObjectToStorageMigration:

Public Member Functions

 getLabel ()
 
 getDefaultAmountOfStepsPerRun ()
 
 getPreconditions (Environment $environment)
 
 prepare (Environment $environment)
 
 step (Environment $environment)
 
 getRemainingAmountOfSteps ()
 

Data Fields

const MIGRATION_LOG_CSV = "migration_log.csv"
 

Protected Member Functions

 showConfirmation (Environment $environment)
 

Protected Attributes

bool $prepared = false
 
ilFileObjectToStorageMigrationRunner $runner
 
ilDBInterface $database
 

Private Attributes

const FILE_PATH_REGEX = '/.*\/file_([\d]*)$/'
 
ilFileObjectToStorageMigrationHelper $helper = null
 
bool $confirmed = false
 

Detailed Description

Definition at line 24 of file class.ilFileObjectToStorageMigration.php.

Member Function Documentation

◆ getDefaultAmountOfStepsPerRun()

ilFileObjectToStorageMigration::getDefaultAmountOfStepsPerRun ( )

Definition at line 46 of file class.ilFileObjectToStorageMigration.php.

46  : int
47  {
48  return 10;
49  }

◆ getLabel()

ilFileObjectToStorageMigration::getLabel ( )

Definition at line 38 of file class.ilFileObjectToStorageMigration.php.

38  : string
39  {
40  return "Migration of File-Objects to Storage service";
41  }

◆ getPreconditions()

ilFileObjectToStorageMigration::getPreconditions ( Environment  $environment)

Definition at line 54 of file class.ilFileObjectToStorageMigration.php.

References ilResourceStorageMigrationHelper\getPreconditions().

+ Here is the call graph for this function:

◆ getRemainingAmountOfSteps()

ilFileObjectToStorageMigration::getRemainingAmountOfSteps ( )

Definition at line 108 of file class.ilFileObjectToStorageMigration.php.

References $d.

108  : int
109  {
110  $r = $this->database->query("SELECT COUNT(file_id) AS amount FROM file_data WHERE rid IS NULL OR rid = '';");
111  $d = $this->database->fetchObject($r);
112 
113  return (int) $d->amount;
114  }
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296

◆ prepare()

ilFileObjectToStorageMigration::prepare ( Environment  $environment)

Definition at line 62 of file class.ilFileObjectToStorageMigration.php.

References $DIC, and Vendor\Package\$f.

62  : void
63  {
64  $irss_helper = new ilResourceStorageMigrationHelper(
66  $environment
67  );
68 
69  $legacy_files_dir = $irss_helper->getClientDataDir() . "/ilFile";
70  $this->helper = new ilFileObjectToStorageMigrationHelper(
71  $irss_helper
72  );
73 
74  global $DIC;
75  $DIC['ilDB'] = $irss_helper->getDatabase(); // needed inside some method calls to ILIAS
76 
77  $storage_configuration = new LocalConfig($irss_helper->getClientDataDir());
79 
80  $this->runner = new ilFileObjectToStorageMigrationRunner(
81  $f->getLocal($storage_configuration),
82  $irss_helper,
83  self::MIGRATION_LOG_CSV
84  );
85 
86  $this->database = $irss_helper->getDatabase();
87  }
Class ilObjFileStakeholder.
global $DIC
Definition: feed.php:28
Class ilResourceStorageMigrationHelper.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ showConfirmation()

ilFileObjectToStorageMigration::showConfirmation ( Environment  $environment)
protected
Parameters
Environment$environment
Returns
void

Definition at line 120 of file class.ilFileObjectToStorageMigration.php.

References ILIAS\Setup\Environment\getResource().

Referenced by step().

120  : void
121  {
122  if (!$this->confirmed) {
123  $io = $environment->getResource(Setup\Environment::RESOURCE_ADMIN_INTERACTION);
124  $this->confirmed = $io->confirmExplicit(
125  'The migration of File-Objects should be done in ILIAS 7 not 8, see Modules/File/classes/Setup/MISSING_MIGRATION.md, type "Understood" to proceed',
126  'Understood'
127  );
128  }
129  }
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ step()

ilFileObjectToStorageMigration::step ( Environment  $environment)

Definition at line 92 of file class.ilFileObjectToStorageMigration.php.

References ILIAS\Setup\Environment\getResource(), and showConfirmation().

92  : void
93  {
94  if ($this->helper === null) {
95  $environment->getResource(Environment::RESOURCE_ADMIN_INTERACTION)->inform(
96  "No migration possible, base-directory not found."
97  );
98  return;
99  }
100  $this->showConfirmation($environment);
101  $item = $this->helper->getNext();
102  $this->runner->migrate($item);
103  }
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
+ Here is the call graph for this function:

Field Documentation

◆ $confirmed

bool ilFileObjectToStorageMigration::$confirmed = false
private

Definition at line 31 of file class.ilFileObjectToStorageMigration.php.

◆ $database

ilDBInterface ilFileObjectToStorageMigration::$database
protected

Definition at line 33 of file class.ilFileObjectToStorageMigration.php.

◆ $helper

ilFileObjectToStorageMigrationHelper ilFileObjectToStorageMigration::$helper = null
private

Definition at line 28 of file class.ilFileObjectToStorageMigration.php.

◆ $prepared

bool ilFileObjectToStorageMigration::$prepared = false
protected

Definition at line 30 of file class.ilFileObjectToStorageMigration.php.

◆ $runner

ilFileObjectToStorageMigrationRunner ilFileObjectToStorageMigration::$runner
protected

Definition at line 32 of file class.ilFileObjectToStorageMigration.php.

◆ FILE_PATH_REGEX

const ilFileObjectToStorageMigration::FILE_PATH_REGEX = '/.*\/file_([\d]*)$/'
private

Definition at line 26 of file class.ilFileObjectToStorageMigration.php.

◆ MIGRATION_LOG_CSV

const ilFileObjectToStorageMigration::MIGRATION_LOG_CSV = "migration_log.csv"

Definition at line 27 of file class.ilFileObjectToStorageMigration.php.


The documentation for this class was generated from the following file: