ILIAS  trunk Revision v12.0_alpha-1329-g1094ddb0c33
ResourceBuilder.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
37use ILIAS\ResourceStorage\Preloader\SecureString;
51
58{
59 use SecureString;
60
77
81 protected array $resource_cache = [];
83 private bool $auto_migrate = true;
84
89 public function __construct(
90 private StorageHandlerFactory $storage_handler_factory,
91 Repositories $repositories,
92 private LockHandler $lock_handler,
93 private StreamAccess $stream_access,
94 protected FileNamePolicy $file_name_policy = new NoneFileNamePolicy()
95 ) {
96 $this->primary_storage_handler = $this->storage_handler_factory->getPrimary();
97 $this->revision_repository = $repositories->getRevisionRepository();
98 $this->resource_repository = $repositories->getResourceRepository();
99 $this->information_repository = $repositories->getInformationRepository();
100 $this->stakeholder_repository = $repositories->getStakeholderRepository();
101 }
102
103 //
104 // Methods to create new Resources (from an Upload, a Stream od just a blank one)
105 //
106
110 public function new(
111 UploadResult $result,
112 InfoResolver $info_resolver,
113 ResourceType $type = ResourceType::SINGLE_FILE
115 $resource = $this->resource_repository->blank(
116 $this->primary_storage_handler->getIdentificationGenerator()->getUniqueResourceIdentification(),
117 $type
118 );
119
120 return $this->append($resource, $result, $info_resolver, RevisionStatus::PUBLISHED);
121 }
122
123 public function newFromStream(
124 FileStream $stream,
125 InfoResolver $info_resolver,
126 bool $keep_original = false,
127 ResourceType $type = ResourceType::SINGLE_FILE
129 $resource = $this->resource_repository->blank(
130 $this->primary_storage_handler->getIdentificationGenerator()->getUniqueResourceIdentification(),
131 $type
132 );
133
134 return $this->appendFromStream(
135 $resource,
136 $stream,
137 $info_resolver,
139 $keep_original
140 );
141 }
142
143 public function newBlank(ResourceType $type = ResourceType::SINGLE_FILE): StorableResource
144 {
145 $resource = $this->resource_repository->blank(
146 $this->primary_storage_handler->getIdentificationGenerator()->getUniqueResourceIdentification(),
147 $type
148 );
149 $resource->setStorageID($this->primary_storage_handler->getID());
150
151 return $resource;
152 }
153
154 //
155 // Methods to append something to an existing resource
156 //
157
158 public function append(
159 StorableResource $resource,
160 UploadResult $result,
161 InfoResolver $info_resolver,
162 RevisionStatus $status
164 if (
165 $status !== RevisionStatus::DRAFT
166 && $resource->getCurrentRevisionIncludingDraft()->getStatus() === RevisionStatus::DRAFT) {
167 throw new \LogicException(
168 'You can not replace a draft revision with a published, you must publish the current revision first'
169 );
170 }
171
172 $new_revision = $this->revision_repository->blankFromUpload($info_resolver, $resource, $result, $status);
173
174 if ($resource->getCurrentRevisionIncludingDraft()->getStatus() === RevisionStatus::DRAFT) {
175 $clone_revision = $this->buildDraftReplacementRevision($resource, $new_revision, $info_resolver);
176 $resource->replaceRevision($clone_revision);
177 } else {
178 $new_revision = $this->populateRevisionInfo($new_revision, $info_resolver);
179 $resource->addRevision($new_revision);
180 }
181
182 $resource->setStorageID(
183 $resource->getStorageID() === '' ? $this->primary_storage_handler->getID() : $resource->getStorageID()
184 );
185
186 return $resource;
187 }
188
192 public function replaceWithUpload(
193 StorableResource $resource,
194 UploadResult $result,
195 InfoResolver $info_resolver
197 if ($resource->getCurrentRevisionIncludingDraft()->getStatus() === RevisionStatus::DRAFT) {
198 throw new \LogicException('You can not replace a draft revision, you must publish it first');
199 }
200 $revision = $this->revision_repository->blankFromUpload(
201 $info_resolver,
202 $resource,
203 $result,
205 );
206 $revision = $this->populateRevisionInfo($revision, $info_resolver);
207
208 foreach ($resource->getAllRevisionsIncludingDraft() as $existing_revision) {
209 $this->deleteRevision($resource, $existing_revision);
210 }
211
212 $resource->addRevision($revision);
213 $resource->setStorageID(
214 $resource->getStorageID() === '' ? $this->primary_storage_handler->getID() : $resource->getStorageID()
215 );
216
217 return $resource;
218 }
219
220 public function appendFromStream(
221 StorableResource $resource,
222 FileStream $stream,
223 InfoResolver $info_resolver,
224 RevisionStatus $status,
225 bool $keep_original = false,
227 if (
228 $status !== RevisionStatus::DRAFT
229 && $resource->getCurrentRevisionIncludingDraft()->getStatus() === RevisionStatus::DRAFT) {
230 throw new \LogicException(
231 'You can not replace a draft revision with a published, you must publish the current revision first'
232 );
233 }
234
235 $new_revision = $this->revision_repository->blankFromStream(
236 $info_resolver,
237 $resource,
238 $stream,
239 $status,
240 $keep_original
241 );
242
243 if ($resource->getCurrentRevisionIncludingDraft()->getStatus() === RevisionStatus::DRAFT) {
244 $clone_revision = $this->buildDraftReplacementRevision($resource, $new_revision, $info_resolver);
245 $resource->replaceRevision($clone_revision);
246 } else {
247 $new_revision = $this->populateRevisionInfo($new_revision, $info_resolver);
248 $resource->addRevision($new_revision);
249 }
250
251 $resource->setStorageID(
252 $resource->getStorageID() === '' ? $this->primary_storage_handler->getID() : $resource->getStorageID()
253 );
254
255 return $resource;
256 }
257
258 public function replaceWithStream(
259 StorableResource $resource,
260 FileStream $stream,
261 InfoResolver $info_resolver,
262 bool $keep_original = false,
264 if ($resource->getCurrentRevisionIncludingDraft()->getStatus() === RevisionStatus::DRAFT) {
265 throw new \LogicException('You can not replace a draft revision, you must publish it first');
266 }
267 $revision = $this->revision_repository->blankFromStream(
268 $info_resolver,
269 $resource,
270 $stream,
272 $keep_original
273 );
274 $revision = $this->populateRevisionInfo($revision, $info_resolver);
275
276 foreach ($resource->getAllRevisionsIncludingDraft() as $existing_revision) {
277 $this->deleteRevision($resource, $existing_revision);
278 }
279
280 $resource->addRevision($revision);
281 $resource->setStorageID(
282 $resource->getStorageID() === '' ? $this->primary_storage_handler->getID() : $resource->getStorageID()
283 );
284
285 return $resource;
286 }
287
288 public function appendFromRevision(
289 StorableResource $resource,
290 int $revision_number
292 if ($resource->getCurrentRevisionIncludingDraft()->getStatus() === RevisionStatus::DRAFT) {
293 throw new \LogicException('You can not replace a draft revision, you must publish it first');
294 }
295 $existing_revision = $resource->getSpecificRevision($revision_number);
296 if ($existing_revision instanceof FileRevision) {
297 $info_resolver = new ClonedRevisionInfoResolver(
298 $resource->getMaxRevision(false) + 1,
299 $existing_revision
300 );
301
302 $cloned_revision = $this->revision_repository->blankFromClone(
303 $info_resolver,
304 $resource,
305 $existing_revision
306 );
307
308 $this->populateRevisionInfo($cloned_revision, $info_resolver);
309
310 $resource->addRevision($cloned_revision);
311 $resource->setStorageID(
312 $resource->getStorageID() === '' ? $this->primary_storage_handler->getID() : $resource->getStorageID()
313 );
314 return $resource;
315 }
316 return $resource;
317 }
318
320 StorableResource $resource,
321 Revision $new_revision,
322 InfoResolver $info_resolver
323 ): Revision {
324 $current_revision = $resource->getCurrentRevisionIncludingDraft();
325 $stream_replacement = new StreamReplacementRevision(
326 $resource->getIdentification(),
327 $this->extractStream($new_revision)
328 );
329 $stream_replacement = $this->populateRevisionInfo($stream_replacement, $info_resolver);
330 $stream_replacement->setVersionNumber($current_revision->getVersionNumber());
331 $stream_replacement->setStatus(RevisionStatus::DRAFT);
332
333 return $stream_replacement;
334 }
335
339 public function has(ResourceIdentification $identification): bool
340 {
341 return $this->resource_repository->has($identification);
342 }
343
348 public function store(StorableResource $resource): void
349 {
350 foreach ($resource->getAllRevisionsIncludingDraft() as $revision) {
351 $this->file_name_policy->check($revision->getInformation()->getSuffix());
352 }
353
354 $r = $this->lock_handler->lockTables(
355 array_merge(
356 $this->resource_repository->getNamesForLocking(),
357 $this->revision_repository->getNamesForLocking(),
358 $this->information_repository->getNamesForLocking(),
359 $this->stakeholder_repository->getNamesForLocking()
360 ),
361 function () use ($resource): void {
362 $this->resource_repository->store($resource);
363
364 foreach ($resource->getAllRevisionsIncludingDraft() as $revision) {
365 $this->storeRevision($revision, $resource);
366 }
367
368 foreach ($resource->getStakeholders() as $stakeholder) {
369 $this->stakeholder_repository->register($resource->getIdentification(), $stakeholder);
370 }
371 }
372 );
373
374 $r->runAndUnlock();
375 }
376
380 public function clone(StorableResource $resource): StorableResource
381 {
382 $new_resource = $this->newBlank($resource->getType());
383 foreach ($resource->getStakeholders() as $stakeholder) {
384 $stakeholder = clone $stakeholder;
385 $new_resource->addStakeholder($stakeholder);
386 }
387
388 foreach ($resource->getAllRevisionsIncludingDraft() as $existing_revision) {
389 if (!$existing_revision instanceof FileRevision) {
390 continue;
391 }
392 $info_resolver = new ClonedRevisionInfoResolver(
393 $existing_revision->getVersionNumber(),
394 $existing_revision
395 );
396
397 $existing_revision = $this->stream_access->populateRevision($existing_revision);
398
399 $cloned_revision = new FileStreamRevision(
400 $new_resource->getIdentification(),
401 $existing_revision->maybeStreamResolver()->getStream(),
402 true
403 );
404
405 $this->populateRevisionInfo($cloned_revision, $info_resolver);
406 $cloned_revision->setVersionNumber($existing_revision->getVersionNumber());
407
408 $new_resource->addRevision($cloned_revision);
409 }
410 $this->store($new_resource);
411 return $new_resource;
412 }
413
418 public function storeRevision(Revision $revision, ?StorableResource $resource = null): void
419 {
420 $storage_handler = empty($revision->getStorageID())
421 ? $this->primary_storage_handler
422 : $this->storage_handler_factory->getHandlerForRevision($revision);
423
424 if ($revision instanceof UploadedFileRevision) {
425 // check policies
426 $this->file_name_policy->check($revision->getInformation()->getSuffix());
427 $storage_handler->storeUpload($revision);
428 }
429 if ($revision instanceof FileStreamRevision) {
430 $storage_handler->storeStream($revision);
431 }
432 if ($revision instanceof CloneRevision) {
433 $storage_handler->cloneRevision($revision);
434 }
435 if ($revision instanceof StreamReplacementRevision) {
436 $storage_handler->streamReplacement($revision);
437 }
438 $this->revision_repository->store($revision);
439 $this->information_repository->store($revision->getInformation(), $revision);
440
441 // we replace the revision with the populated one
442 if ($resource !== null) {
443 $replace_revision = new FileRevision($revision->getIdentification());
444 $replace_revision->setVersionNumber($revision->getVersionNumber());
445 $replace_revision->setOwnerId($revision->getOwnerId());
446 $replace_revision->setTitle($revision->getTitle());
447 $replace_revision->setStatus($revision->getStatus());
448 $replace_revision->setInformation($revision->getInformation());
449 $replace_revision->setStorageID($revision->getStorageID());
450
451 $resource->replaceRevision($replace_revision);
452 }
453 }
454
459 public function get(ResourceIdentification $identification): StorableResource
460 {
461 if (isset($this->resource_cache[$identification->serialize()])) {
462 return $this->resource_cache[$identification->serialize()];
463 }
464 $resource = $this->resource_repository->get($identification);
465
466 if ($this->auto_migrate && $resource->getStorageID() !== $this->primary_storage_handler->getID()) {
467 global $DIC;
470 $migrator->migrate($resource, $this->primary_storage_handler->getID());
471 $resource->setStorageID($this->primary_storage_handler->getID());
472 }
473
474 $this->resource_cache[$identification->serialize()] = $this->populateNakedResourceWithRevisionsAndStakeholders(
475 $resource
476 );
477
478 return $this->resource_cache[$identification->serialize()];
479 }
480
481 public function publish(StorableResource $resource): bool
482 {
483 $revision = $resource->getCurrentRevisionIncludingDraft();
484 if ($revision->getStatus() === RevisionStatus::PUBLISHED) {
485 return false;
486 }
487 $revision->setStatus(RevisionStatus::PUBLISHED);
488 $this->store($resource);
489 return true;
490 }
491
492 public function unpublish(StorableResource $resource): bool
493 {
494 $revision = $resource->getCurrentRevisionIncludingDraft();
495 if ($revision->getStatus() === RevisionStatus::DRAFT) {
496 return false;
497 }
498 $revision->setStatus(RevisionStatus::DRAFT);
499 $this->store($resource);
500 return true;
501 }
502
503 public function extractStream(Revision $revision): FileStream
504 {
505 switch (true) {
506 case $revision instanceof FileStreamRevision:
507 return Streams::ofReattachableResource($revision->getStream()->detach());
508 case $revision instanceof UploadedFileRevision:
509 return Streams::ofReattachableResource(fopen($revision->getUpload()->getPath(), 'rb'));
510 case $revision instanceof CloneRevision:
511 return $revision->getRevisionToClone()->getStream();
512 case $revision instanceof FileRevision:
513 if ($revision->getStorageID() !== '') {
514 return $this->storage_handler_factory->getHandlerForRevision(
515 $revision
516 )->getStream($revision);
517 }
518
519 return $this->storage_handler_factory->getHandlerForResource(
520 $this->get($revision->getIdentification())
521 )->getStream($revision);
522 default:
523 throw new \LogicException('This revision type is not supported');
524 }
525 }
526
531 public function remove(StorableResource $resource, ?ResourceStakeholder $stakeholder = null): bool
532 {
533 $sucessful = true;
534 if ($stakeholder instanceof ResourceStakeholder) {
535 $this->stakeholder_repository->deregister($resource->getIdentification(), $stakeholder);
536 $sucessful = $stakeholder->resourceHasBeenDeleted($resource->getIdentification());
537 $resource->removeStakeholder($stakeholder);
538 if ($resource->getStakeholders() !== []) {
539 return $sucessful;
540 }
541 }
542 foreach ($resource->getStakeholders() as $s) {
543 $sucessful = $s->resourceHasBeenDeleted($resource->getIdentification()) && $sucessful;
544 }
545
546 foreach ($resource->getAllRevisionsIncludingDraft() as $revision) {
547 $this->deleteRevision($resource, $revision);
548 }
549
550 $this->storage_handler_factory->getHandlerForResource($resource)->deleteResource($resource);
551 $this->resource_repository->delete($resource);
552
553 return $sucessful;
554 }
555
556 public function removeRevision(StorableResource $resource, int $revision_number): void
557 {
558 $reveision_to_delete = $resource->getSpecificRevision($revision_number);
559 if ($reveision_to_delete !== null) {
560 $this->deleteRevision($resource, $reveision_to_delete);
561 }
562 $this->store($resource);
563 }
564
565 // Container Actions
568 string $path_inside_container,
569 ): bool {
570 $revision = $container->getCurrentRevisionIncludingDraft();
571 $stream = $this->extractStream($revision);
572
573 // create directory inside ZipArchive
574 try {
575 $zip = new \ZipArchive();
576 $zip->open($stream->getMetadata()['uri']);
577 $path_inside_container = $this->ensurePathInZIP($zip, $path_inside_container, false);
578 $zip->close();
579
580 // cleanup revision and flavours
581 $this->storage_handler_factory->getHandlerForRevision($revision)->clearFlavours($revision);
582 $revision->getInformation()->setSize(filesize($stream->getMetadata()['uri']));
583 $this->storeRevision($revision);
584
585 return true;
586 } catch (\Throwable) {
587 return false;
588 }
589 }
590
591 private function ensurePathInZIP(\ZipArchive $zip, string $path, bool $is_file): string
592 {
593 // ZIP entries must be stored as relative paths. Some extraction tools
594 // (e.g. Windows Explorer) silently hide entries whose names start with
595 // "/". See Mantis 0045580 / 0047237.
596 $path = ltrim($path, '/');
597 if ($path === '') {
598 return '';
599 }
600
601 $filename = '';
602 if ($is_file) {
603 $filename = basename($path);
604 $path = dirname($path);
605 if (in_array($path, ['.', '/', ''], true)) {
606 return $filename;
607 }
608 }
609
610 $parts = explode('/', $path);
611 $root = array_shift($parts);
612
613 // ensure the root directory exists (tolerate legacy entries that were
614 // stored with a leading slash)
615 if ($zip->locateName($root . '/') === false
616 && $zip->locateName('/' . $root . '/') === false
617 ) {
618 $zip->addEmptyDir($root);
619 }
620
621 $path_inside_container = $root;
622 foreach ($parts as $part) {
623 $path_inside_container .= '/' . $part;
624 if ($zip->locateName($path_inside_container . '/') === false) {
625 $zip->addEmptyDir($path_inside_container . '/');
626 }
627 }
628
629 if ($filename === '') {
630 return $path_inside_container . '/';
631 }
632
633 return $path_inside_container . '/' . $filename;
634 }
635
638 string $path_inside_container,
639 ): bool {
640 $revision = $container->getCurrentRevisionIncludingDraft();
641 $stream = $this->extractStream($revision);
642
643 // create directory inside ZipArchive
644 try {
645 $zip = new \ZipArchive();
646 $zip->open($stream->getMetadata()['uri']);
647
648 $return = $zip->deleteName($path_inside_container);
649 // remove all files inside the directory
650 for ($i = 0; $i < $zip->numFiles; $i++) {
651 $path = $zip->getNameIndex($i);
652 if ($path === false) {
653 continue;
654 }
655 if (str_starts_with($path, $path_inside_container)) {
656 $zip->deleteIndex($i);
657 }
658 }
659
660 $zip->close();
661
662 // cleanup revision and flavours
663 $this->storage_handler_factory->getHandlerForRevision($revision)->clearFlavours($revision);
664 $revision->getInformation()->setSize(filesize($stream->getMetadata()['uri']));
665 $this->storeRevision($revision);
666
667 return $return;
668 } catch (\Throwable) {
669 $this->storage_handler_factory->getHandlerForRevision($revision)->clearFlavours($revision);
670 return false;
671 }
672 }
673
674 public function addUploadToContainer(
676 UploadResult $result,
677 string $parent_path_inside_container,
678 ): bool {
679 $revision = $container->getCurrentRevisionIncludingDraft();
680 $stream = $this->extractStream($revision);
681
682 // create directory inside ZipArchive
683 try {
684 $zip = new \ZipArchive();
685 $zip->open($stream->getMetadata()['uri']);
686
687 $parent_path_inside_container = $this->ensurePathInZIP($zip, $parent_path_inside_container, false);
688
689 $path_inside_zip = rtrim($parent_path_inside_container, '/') . '/' . $result->getName();
690
691 $return = $zip->addFile(
692 $result->getPath(),
693 $path_inside_zip
694 );
695 $zip->close();
696
697 // cleanup revision and flavours
698 $this->storage_handler_factory->getHandlerForRevision($revision)->clearFlavours($revision);
699 $revision->getInformation()->setSize(filesize($stream->getMetadata()['uri']));
700 $this->storeRevision($revision);
701
702 return $return;
703 } catch (\Throwable) {
704 return false;
705 }
706
707 return true;
708 }
709
710 public function addStreamToContainer(
712 FileStream $stream,
713 string $path_inside_container,
714 ): bool {
715 $revision = $container->getCurrentRevisionIncludingDraft();
716 $revision_stream = $this->extractStream($revision);
717
718 try {
719 $zip = new \ZipArchive();
720 $zip->open($revision_stream->getMetadata()['uri']);
721
722 $path_inside_container = $this->ensurePathInZIP($zip, $path_inside_container, true);
723
724 $return = $zip->addFromString(
725 $path_inside_container,
726 (string) $stream
727 );
728 $zip->close();
729
730 // cleanup revision and flavours
731 $this->storage_handler_factory->getHandlerForRevision($revision)->clearFlavours($revision);
732 $revision->getInformation()->setSize(filesize($revision_stream->getMetadata()['uri']));
733 $this->storeRevision($revision);
734
735 return $return;
736 } catch (\Throwable) {
737 return false;
738 }
739
740 return true;
741 }
742
743 private function deleteRevision(StorableResource $resource, Revision $revision): void
744 {
745 try {
746 $this->storage_handler_factory->getHandlerForResource($resource)->deleteRevision($revision);
747 } catch (\Throwable) {
748 }
749
750 $this->information_repository->delete($revision->getInformation(), $revision);
751 $this->revision_repository->delete($revision);
752 $resource->removeRevision($revision);
753 }
754
756 {
757 $revisions = $this->revision_repository->get($resource);
758 $resource->setRevisions($revisions);
759
760 foreach ($revisions->getAll(true) as $revision) {
761 $information = $this->information_repository->get($revision);
762 $revision->setInformation($information);
763 $revision->setStorageID($resource->getStorageID());
764 // $revisions->replaceSingleRevision($this->stream_access->populateRevision($revision)); // currently we do not need populating the stream every time, we will do that in consumers only
765 }
766
767 foreach ($this->stakeholder_repository->getStakeholders($resource->getIdentification()) as $s) {
768 $resource->addStakeholder($s);
769 }
770
771 return $resource;
772 }
773
774 private function populateRevisionInfo(Revision $revision, InfoResolver $info_resolver): Revision
775 {
776 $info = $revision->getInformation();
777
778 $info->setTitle($this->secure($info_resolver->getFileName()));
779 $info->setMimeType($info_resolver->getMimeType());
780 $info->setSuffix($this->secure($info_resolver->getSuffix()));
781 $info->setSize($info_resolver->getSize());
782 $info->setCreationDate($info_resolver->getCreationDate());
783
784 $revision->setInformation($info);
785 $revision->setTitle($this->secure($info_resolver->getRevisionTitle()));
786 $revision->setOwnerId($info_resolver->getOwnerId());
787
788 return $revision;
789 }
790}
$filename
Definition: buildRTE.php:78
Stream factory which enables the user to create streams without the knowledge of the concrete class.
Definition: Streams.php:32
ensurePathInZIP(\ZipArchive $zip, string $path, bool $is_file)
StakeholderRepository $stakeholder_repository
@readonly
newFromStream(FileStream $stream, InfoResolver $info_resolver, bool $keep_original=false, ResourceType $type=ResourceType::SINGLE_FILE)
newBlank(ResourceType $type=ResourceType::SINGLE_FILE)
appendFromStream(StorableResource $resource, FileStream $stream, InfoResolver $info_resolver, RevisionStatus $status, bool $keep_original=false,)
addUploadToContainer(StorableContainerResource $container, UploadResult $result, string $parent_path_inside_container,)
replaceWithStream(StorableResource $resource, FileStream $stream, InfoResolver $info_resolver, bool $keep_original=false,)
populateRevisionInfo(Revision $revision, InfoResolver $info_resolver)
addStreamToContainer(StorableContainerResource $container, FileStream $stream, string $path_inside_container,)
ResourceRepository $resource_repository
@readonly
appendFromRevision(StorableResource $resource, int $revision_number)
populateNakedResourceWithRevisionsAndStakeholders(StorableResource $resource)
RevisionRepository $revision_repository
@readonly
storeRevision(Revision $revision, ?StorableResource $resource=null)
@description Store one Revision
__construct(private StorageHandlerFactory $storage_handler_factory, Repositories $repositories, private LockHandler $lock_handler, private StreamAccess $stream_access, protected FileNamePolicy $file_name_policy=new NoneFileNamePolicy())
ResourceBuilder constructor.
createDirectoryInsideContainer(StorableContainerResource $container, string $path_inside_container,)
store(StorableResource $resource)
@description after you have modified a resource, you can store it here
removePathInsideContainer(StorableContainerResource $container, string $path_inside_container,)
has(ResourceIdentification $identification)
@description check if a resource exists
deleteRevision(StorableResource $resource, Revision $revision)
replaceWithUpload(StorableResource $resource, UploadResult $result, InfoResolver $info_resolver)
@inheritDoc
removeRevision(StorableResource $resource, int $revision_number)
append(StorableResource $resource, UploadResult $result, InfoResolver $info_resolver, RevisionStatus $status)
buildDraftReplacementRevision(StorableResource $resource, Revision $new_revision, InfoResolver $info_resolver)
InformationRepository $information_repository
@readonly
clone(StorableResource $resource)
@description Clone anexisting resource with all it's revisions, stakeholders and information
$info
Definition: entry_point.php:21
The base interface for all filesystem streams.
Definition: FileStream.php:32
setRevisions(RevisionCollection $collection)
setInformation(Information $information)
$path
Definition: ltiservices.php:30
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(!file_exists('../ilias.ini.php'))
global $DIC
Definition: shib_login.php:26
$container
@noRector
Definition: wac.php:37