◆ __construct()
ilFileObjectToStorageMigrationRunner::__construct |
( |
Filesystem |
$file_system, |
|
|
ilDBInterface |
$database, |
|
|
string |
$log_file_path |
|
) |
| |
ilFileObjectToStorageMigration constructor.
- Parameters
-
Definition at line 70 of file class.ilFileObjectToStorageMigrationRunner.php.
References $builder, $database, and $file_system.
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);
Class ilObjFileStakeholder.
Interface StakeholderDBRepository.
Class ResourceDBRepository.
Class RevisionDBRepository.
Class StorageHandlerFactory.
Class StandardRepositoryPreloader.
◆ getMigrateToNewObjectId()
ilFileObjectToStorageMigrationRunner::getMigrateToNewObjectId |
( |
| ) |
|
◆ getResource()
- Parameters
-
- Returns
- StorableResource
- Exceptions
-
Definition at line 192 of file class.ilFileObjectToStorageMigrationRunner.php.
References $d, and ilFileObjectToStorageDirectory\getObjectId().
Referenced by migrate().
195 $r = $this->database->queryF(
"SELECT rid FROM file_data WHERE file_id = %s", [
'integer'],
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();
Interface StorageResource.
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
◆ logMigratedFile()
ilFileObjectToStorageMigrationRunner::logMigratedFile |
( |
int |
$object_id, |
|
|
string |
$rid, |
|
|
int |
$version, |
|
|
string |
$old_path, |
|
|
string |
$status, |
|
|
string |
$movement_implementation, |
|
|
string |
$aditional_info = null |
|
) |
| |
|
private |
◆ migrate()
Definition at line 109 of file class.ilFileObjectToStorageMigrationRunner.php.
References Vendor\Package\$e, $movement_implementation, getMigrateToNewObjectId(), ilFileObjectToStorageDirectory\getObjectId(), getResource(), ilFileObjectToStorageDirectory\getVersions(), logMigratedFile(), and ilFileObjectToStorageDirectory\tearDown().
Referenced by ilObjFileDAV\handleFileUpload(), and ilFileVersionsGUI\migrate().
117 $aditional_info =
'';
119 $stream = Streams::ofResource(fopen($version->getPath(),
'rb'));
123 $version->getVersion(),
124 $version->getOwner(),
125 $version->getTitle(),
129 $this->resource_builder->appendFromStream(
133 $this->keep_originals
137 $aditional_info = $t->getMessage();
142 $resource->getIdentification()->serialize(),
143 $version->getVersion(),
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]
Class FileNamePolicyException.
getResource(ilFileObjectToStorageDirectory $item)
logMigratedFile(int $object_id, string $rid, int $version, string $old_path, string $status, string $movement_implementation, string $aditional_info=null)
getMigrateToNewObjectId()
Class ilFileObjectToStorageInfoResolver.
◆ setMigrateToNewObjectId()
ilFileObjectToStorageMigrationRunner::setMigrateToNewObjectId |
( |
?int |
$migrate_to_new_object_id | ) |
|
◆ $consumer_factory
ilFileObjectToStorageMigrationRunner::$consumer_factory |
|
protected |
◆ $database
ilFileObjectToStorageMigrationRunner::$database |
|
protected |
◆ $file_system
ilFileObjectToStorageMigrationRunner::$file_system |
|
protected |
◆ $keep_originals
ilFileObjectToStorageMigrationRunner::$keep_originals = false |
|
protected |
◆ $migrate_to_new_object_id
ilFileObjectToStorageMigrationRunner::$migrate_to_new_object_id = null |
|
protected |
◆ $migration_log_handle
ilFileObjectToStorageMigrationRunner::$migration_log_handle |
|
protected |
◆ $movement_implementation
ilFileObjectToStorageMigrationRunner::$movement_implementation |
|
protected |
◆ $resource_builder
ilFileObjectToStorageMigrationRunner::$resource_builder |
|
protected |
◆ $stakeholder
ilFileObjectToStorageMigrationRunner::$stakeholder |
|
protected |
◆ $storage_manager
ilFileObjectToStorageMigrationRunner::$storage_manager |
|
protected |
The documentation for this class was generated from the following file: