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);
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
An exception for terminatinating execution or to throw for unit testing.
Customizing of pimple-DIC for ILIAS.
Class LocalConfig This class is used to configure the local filesystem adapter.
Class FlySystemFilesystemFactory.
Interface Identification.
Class FileNamePolicyStack.
Class ResourceDBRepository.
Class RevisionDBRepository.
Interface StakeholderDBRepository.
Class FileSystemStorageHandler.
Class StorageHandlerFactory.
Wrapper around symfonies input and output facilities to provide just the functionality required for t...
Class ilStorageContainersExistingObjective.
Class ilStorageHandlerV1Migration.
getDefaultAmountOfStepsPerRun()
Tell the default amount of steps to be executed for one run of the migration.
getRemainingAmountOfSteps()
Count up how many "things" need to be migrated.
getPreconditions(Environment $environment)
Objectives the migration depend on.
prepare(Environment $environment)
Prepare the migration by means of some environment.
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
An environment holds resources to be used in the setup process.
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
A migration is a potentially long lasting operation that can be broken into discrete steps.
step(Environment $environment)
Run one step of the migration.