43 protected string $from =
'fsv1';
44 protected string $to =
'fsv2';
48 return \ilStorageHandlerV1Migration::class;
62 new \ilIniFilesLoadedObjective(),
63 new \ilDatabaseUpdatedObjective(),
70 $ilias_ini = $environment->
getResource(Environment::RESOURCE_ILIAS_INI);
73 $data_dir = $ilias_ini->readVariable(
'clients',
'datadir');
74 $this->data_dir = $data_dir .
"/" .
$client_id;
76 $configuration =
new LocalConfig(
"{$data_dir}/{$client_id}");
78 $filesystem =
$f->getLocal($configuration);
80 $this->database = $environment->
getResource(Environment::RESOURCE_DATABASE);
96 $container[
'filesystem.storage'] = $filesystem;
98 $this->resource_builder = $init->getResourceBuilder(
$container);
102 $this->resource_builder,
111 $io = $environment->
getResource(Environment::RESOURCE_ADMIN_INTERACTION);
113 $r = $this->database->queryF(
114 "SELECT rid FROM il_resource WHERE storage_id = %s LIMIT 1",
118 $d = $this->database->fetchObject($r);
121 if (!$this->migrator->migrate($resource, $this->to)) {
122 $i = $resource->getIdentification()->serialize();
124 'Resource ' .
$i .
' not migrated, file not found. All Stakeholder have been informed about the deletion.' 132 $r = $this->database->queryF(
133 "SELECT COUNT(rid) as old_storage FROM il_resource WHERE storage_id != %s",
137 $d = $this->database->fetchObject($r);
139 return (
int)(
$d->old_storage ?? 0);
step(Environment $environment)
Run one step of the migration.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilStorageContainersExistingObjective.
A migration is a potentially long lasting operation that can be broken into discrete steps...
Responsible for loading the Resource Storage into the dependency injection container of ILIAS...
getRemainingAmountOfSteps()
Count up how many "things" need to be migrated.
Class FlySystemFilesystemFactory.
Customizing of pimple-DIC for ILIAS.
prepare(Environment $environment)
Prepare the migration by means of some environment.
DirectoryIterator $iterator
Class ResourceIdentification.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
getDefaultAmountOfStepsPerRun()
Tell the default amount of steps to be executed for one run of the migration.
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
Class ilStorageHandlerV1Migration.
An environment holds resources to be used in the setup process.
ILIAS ResourceStorage StorageHandler Migrator $migrator
ILIAS ResourceStorage Resource ResourceBuilder $resource_builder
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
getPreconditions(Environment $environment)