13use ILIAS\ResourceStorage\StorageHandler\FileSystemStorageHandlerV2;
74 $this->migration_log_handle = fopen($log_file_path,
'ab');
81 $this->movement_implementation = $storage_handler->movementImplementation();
88 $storage_handler_factory,
89 $revisionDBRepository,
90 $resourceDBRepository,
91 $informationDBRepository,
92 $stakeholderDBRepository,
97 $resourceDBRepository,
98 $revisionDBRepository,
99 $informationDBRepository,
100 $stakeholderDBRepository
102 $this->consumer_factory =
new ConsumerFactory($storage_handler_factory);
117 $aditional_info =
'';
119 $stream = Streams::ofResource(fopen($version->getPath(),
'rb'));
123 $version->getVersion(),
124 $version->getOwner(),
125 $version->getTitle(),
126 (
new DateTimeImmutable())->setTimestamp($version->getCreationDateTimestamp())
129 $this->resource_builder->appendFromStream(
133 $this->keep_originals
135 }
catch (Throwable $t) {
137 $aditional_info = $t->getMessage();
142 $resource->getIdentification()->serialize(),
143 $version->getVersion(),
146 $this->movement_implementation,
150 $resource->addStakeholder($this->stakeholder);
152 $this->resource_builder->store($resource);
153 $this->database->manipulateF(
154 'UPDATE file_data SET rid = %s WHERE file_id = %s',
156 [$resource->getIdentification()->serialize(), $object_id]
174 string $aditional_info =
null
176 fputcsv($this->migration_log_handle, [
195 $r = $this->database->queryF(
"SELECT rid FROM file_data WHERE file_id = %s", [
'integer'],
196 [$item->getObjectId()]);
197 $d = $this->database->fetchObject($r);
199 if (isset(
$d->rid) &&
$d->rid !==
'' && ($resource_identification = $this->storage_manager->find(
$d->rid)) && $resource_identification !==
null) {
200 $resource = $this->resource_builder->get($resource_identification);
202 $resource = $this->resource_builder->newBlank();
212 return $this->migrate_to_new_object_id;
221 $this->migrate_to_new_object_id = $migrate_to_new_object_id;
222 $this->keep_originals =
true;
An exception for terminatinating execution or to throw for unit testing.
Class Streams Stream factory which enables the user to create streams without the knowledge of the co...
Class FileNamePolicyException.
Class StandardRepositoryPreloader.
Class ResourceDBRepository.
Class RevisionDBRepository.
Interface StakeholderDBRepository.
Class StorageHandlerFactory.
Class ilFileObjectToStorageDirectory.
Class ilFileObjectToStorageInfoResolver.
migrate(ilFileObjectToStorageDirectory $item)
@inheritDoc
logMigratedFile(int $object_id, string $rid, int $version, string $old_path, string $status, string $movement_implementation, string $aditional_info=null)
$migrate_to_new_object_id
__construct(Filesystem $file_system, ilDBInterface $database, string $log_file_path)
ilFileObjectToStorageMigration constructor.
getResource(ilFileObjectToStorageDirectory $item)
setMigrateToNewObjectId(?int $migrate_to_new_object_id)
getMigrateToNewObjectId()
Class ilObjFileStakeholder.
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
Interface Filesystem The filesystem interface provides the public interface for the Filesystem servic...
Interface StorageResource.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class FlySystemFileAccessTest \Provider\FlySystem @runTestsInSeparateProcesses @preserveGlobalState d...