29use ILIAS\ResourceStorage\StorageHandler\FileSystemStorageHandlerV2;
64 if (is_dir($legacy_directory)) {
65 $this->migration_log_handle = fopen($legacy_directory . $log_file_name,
'ab');
67 $this->migration_log_handle =
false;
71 $this->storage_manager = $irss_helper->
getManager();
88 $stream = Streams::ofResource(fopen(
$version->getPath(),
'rb'));
95 (
new DateTimeImmutable())->setTimestamp(
$version->getCreationDateTimestamp())
98 $this->resource_builder->appendFromStream(
102 $this->keep_originals
104 }
catch (Throwable $t) {
106 $aditional_info = $t->getMessage();
111 $resource->getIdentification()->serialize(),
115 $this->movement_implementation,
119 $resource->addStakeholder($this->stakeholder);
121 $this->resource_builder->store($resource);
122 $this->database->manipulateF(
123 'UPDATE file_data SET rid = %s WHERE file_id = %s',
125 [$resource->getIdentification()->serialize(), $object_id]
129 $this->database->manipulateF(
130 'UPDATE file_data SET rid = %s WHERE file_id = %s',
132 [
'error', $object_id]
148 string $aditional_info =
null
150 if (!$this->migration_log_handle) {
153 fputcsv($this->migration_log_handle, [
172 $r = $this->database->queryF(
173 "SELECT rid FROM file_data WHERE file_id = %s",
175 [$item->getObjectId()]
177 $d = $this->database->fetchObject($r);
179 if (isset(
$d->rid) &&
$d->rid !==
'' && ($resource_identification = $this->storage_manager->find(
181 )) && $resource_identification !==
null) {
182 $resource = $this->resource_builder->get($resource_identification);
184 $resource = $this->resource_builder->newBlank();
194 return $this->migrate_to_new_object_id;
203 $this->migrate_to_new_object_id = $migrate_to_new_object_id;
204 $this->keep_originals =
true;
Class FileNamePolicyException.
Class StandardRepositoryPreloader.
Class ResourceDBRepository.
Class RevisionDBRepository.
Interface StakeholderDBRepository.
Class StorageHandlerFactory.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilFileObjectToStorageInfoResolver.
migrate(ilFileObjectToStorageDirectory $item)
@inheritDoc
ConsumerFactory $consumer_factory
int $migrate_to_new_object_id
ResourceStakeholder $stakeholder
ResourceBuilder $resource_builder
logMigratedFile(int $object_id, string $rid, int $version, string $old_path, string $status, string $movement_implementation, string $aditional_info=null)
getResource(ilFileObjectToStorageDirectory $item)
string $movement_implementation
setMigrateToNewObjectId(?int $migrate_to_new_object_id)
getMigrateToNewObjectId()
__construct(Filesystem $file_system, ilResourceStorageMigrationHelper $irss_helper, string $log_file_name)
Class ilResourceStorageMigrationHelper.
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
Interface StorageResource.
Interface ResourceStakeholder.
Class FlySystemFileAccessTest \Provider\FlySystem @runTestsInSeparateProcesses @preserveGlobalState d...