51 protected $to =
'fsv2';
55 return 'ilStorageHandlerV1Migration';
66 new \ilIniFilesLoadedObjective(),
67 new \ilDatabaseUpdatedObjective(),
74 $ilias_ini = $environment->
getResource(Environment::RESOURCE_ILIAS_INI);
77 $data_dir = $ilias_ini->readVariable(
'clients',
'datadir');
80 $configuration =
new LocalConfig(
"{$data_dir}/{$client_id}");
82 $filesystem =
$f->getLocal($configuration);
84 $this->database = $environment->
getResource(Environment::RESOURCE_DATABASE);
101 $storage_handler_factory,
111 $storage_handler_factory,
112 $this->resource_builder,
122 $io = $environment->
getResource(Environment::RESOURCE_ADMIN_INTERACTION);
124 $r = $this->database->queryF(
125 "SELECT rid FROM il_resource WHERE storage_id = %s LIMIT 1",
129 $d = $this->database->fetchObject($r);
132 if (!$this->migrator->migrate($resource, $this->to)) {
133 $i = $resource->getIdentification()->serialize();
134 $io->text(
'Resource ' .
$i .
' not migrated, file not found. All Stakeholder have been informed about the deletion.');
141 $r = $this->database->queryF(
142 "SELECT COUNT(rid) as old_storage FROM il_resource WHERE storage_id != %s",
146 $d = $this->database->fetchObject($r);
148 return (
int) (
$d->old_storage ?? 0);
step(Environment $environment)
Run one step of the migration.
Interface StakeholderDBRepository.
Class ilStorageContainersExistingObjective.
A migration is a potentially long lasting operation that can be broken into discrete steps...
getRemainingAmountOfSteps()
Count up how many "things" need to be migrated.
Class FlySystemFilesystemFactory.
Customizing of pimple-DIC for ILIAS.
Class ResourceDBRepository.
prepare(Environment $environment)
Prepare the migration by means of some environment.
Interface Identification.
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 RevisionDBRepository.
Class ilStorageHandlerV1Migration.
An environment holds resources to be used in the setup process.
Class StorageHandlerFactory.
Class LocalConfig This class is used to configure the local filesystem adapter.
Class FileSystemStorageHandler.
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Class FileNamePolicyStack.
getPreconditions(Environment $environment)
Objectives the migration depend on.