ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
IRSSWrapper.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Repository\IRSS;
22
40
42{
44 protected \ILIAS\FileDelivery\Services $file_delivery;
45 protected \ILIAS\FileUpload\FileUpload $upload;
46 protected \ILIAS\ResourceStorage\Services $irss;
48
49 public function __construct(
50 protected DataService $data
51 ) {
52 global $DIC;
53
54 if (!$DIC->isDependencyAvailable("resourceStorage")) {
55 return;
56 }
57 $this->irss = $DIC->resourceStorage();
58 $this->archives = $DIC->archives();
59 $this->upload = $DIC->upload();
60 $this->archives = $DIC->archives();
61 $this->file_delivery = $DIC->fileDelivery();
62 $this->filesystems = $DIC->filesystem();
63 }
64
66 {
67 return $this->irss->collection()->id();
68 }
69
70 protected function getNewCollectionIdAsString(): string
71 {
72 return $this->getNewCollectionId()->serialize();
73 }
74
75 public function createEmptyCollection(): string
76 {
77 $new_id = $this->getNewCollectionId();
78 $new_collection = $this->irss->collection()->get($new_id);
79 $this->irss->collection()->store($new_collection);
80 return $new_id->serialize();
81 }
82
83 public function getCollectionForIdString(string $rcid): ResourceCollection
84 {
85 return $this->irss->collection()->get($this->irss->collection()->id($rcid));
86 }
87
89 string $rcid,
90 ResourceStakeholder $stakeholder
91 ): void {
92 $id = $this->irss->collection()->id($rcid);
93 $this->irss->collection()->remove($id, $stakeholder, true);
94 }
95
96 /*
97 public function copyResourcesToDir(
98 string $rcid,
99 ResourceStakeholder $stakeholder,
100 string $dir
101 ) {
102 $collection = $this->irss->collection()->get($this->irss->collection()->id($rcid));
103 foreach ($collection->getResourceIdentifications() as $rid) {
104 $info = $this->irss->manage()->getResource($rid)
105 ->getCurrentRevision()
106 ->getInformation();
107 $stream = $this->irss->consume()->stream($rid);
108 $stream->getContents();
109 }
110 }*/
111
113 ResourceCollection $collection,
114 array $file_input,
115 ResourceStakeholder $stakeholder
116 ): void {
117 $upload = $this->upload;
118
119 if (is_array($file_input)) {
120 if (!$upload->hasBeenProcessed()) {
121 $upload->process();
122 }
123 foreach ($upload->getResults() as $name => $result) {
124 // we must check if these are files from this input
125 if (!in_array($name, $file_input["tmp_name"] ?? [], true)) {
126 continue;
127 }
128 // if the result is not OK, we skip it
129 if (!$result->isOK()) {
130 continue;
131 }
132
133 // we store the file in the IRSS
134 $rid = $this->irss->manage()->upload(
135 $result,
136 $stakeholder
137 );
138 // and add its identification to the collection
139 $collection->add($rid);
140 }
141 // we store the collection after all files have been added
142 $this->irss->collection()->store($collection);
143 }
144 }
145
147 ResourceCollection $collection,
148 string $directory,
149 ResourceStakeholder $stakeholder
150 ): void {
151 $sourceFS = LegacyPathHelper::deriveFilesystemFrom($directory);
152 $sourceDir = LegacyPathHelper::createRelativePath($directory);
153
154 // check if arguments are directories
155 if (!$sourceFS->hasDir($sourceDir)) {
156 return;
157 }
158
159 $sourceList = $sourceFS->listContents($sourceDir, false);
160
161 foreach ($sourceList as $item) {
162 if ($item->isDir()) {
163 continue;
164 }
165 try {
166 $stream = $sourceFS->readStream($item->getPath());
167 $rid = $this->irss->manage()->stream(
168 $stream,
169 $stakeholder
170 );
171 $collection->add($rid);
172 } catch (\ILIAS\Filesystem\Exception\FileAlreadyExistsException $e) {
173 }
174 }
175 $this->irss->collection()->store($collection);
176 }
177
179 {
180 return $this->irss->manage()->find($rid);
181 }
182
184 array $file_input,
185 ResourceStakeholder $stakeholder
186 ): string {
187 $upload = $this->upload;
188
189 if (is_array($file_input)) {
190 if (!$upload->hasBeenProcessed()) {
191 $upload->process();
192 }
193 foreach ($upload->getResults() as $name => $result) {
194 // we must check if these are files from this input
195 if ($name !== ($file_input["tmp_name"] ?? "")) {
196 continue;
197 }
198 // if the result is not OK, we skip it
199 if (!$result->isOK()) {
200 continue;
201 }
202
203 // we store the file in the IRSS
204 $rid = $this->irss->manage()->upload(
205 $result,
206 $stakeholder
207 );
208 return $rid->serialize();
209 }
210 }
211 return "";
212 }
213
215 UploadResult $result,
216 ResourceStakeholder $stakeholder
217 ): string {
218 // if the result is not OK, we skip it
219 if (!$result->isOK()) {
220 return "";
221 }
222
223 // we store the file in the IRSS
224 $rid = $this->irss->manage()->upload(
225 $result,
226 $stakeholder
227 );
228 return $rid->serialize();
229 }
230
231 public function importLocalFile(
232 string $file,
233 string $name,
234 ResourceStakeholder $stakeholder
235 ): string {
236 $sourceFS = LegacyPathHelper::deriveFilesystemFrom($file);
237 $sourceFile = LegacyPathHelper::createRelativePath($file);
238
239 //try {
240 $stream = $sourceFS->readStream($sourceFile);
241 $rid = $this->irss->manage()->stream(
242 $stream,
243 $stakeholder,
244 $name
245 );
246 //} catch (\Exception $e) {
247 // return "";
248 //}
249 return $rid->serialize();
250 }
251
252 public function importStream(
253 Stream $stream,
254 ResourceStakeholder $stakeholder
255 ): string {
256 $rid = $this->irss->manage()->stream(
257 $stream,
258 $stakeholder
259 );
260 return $rid->serialize();
261 }
262
263 public function renameCurrentRevision(
264 string $rid,
265 string $title
266 ): void {
267 $id = $this->getResourceIdForIdString($rid);
268 $rev = $this->irss->manage()->getCurrentRevision($id);
269 $info = $rev->getInformation();
270 $info->setTitle($title);
271 $rev->setInformation($info);
272 $this->irss->manage()->updateRevision($rev);
273 }
274
275 public function deliverFile(string $rid): void
276 {
277 $id = $this->getResourceIdForIdString($rid);
278 if ($id) {
279 $revision = $this->irss->manage()->getCurrentRevision($id);
280 $this->irss->consume()->download($id)->overrideFileName($revision->getTitle())->run();
281 }
282 }
283
284 public function stream(string $rid): ?FileStream
285 {
286 $id = $this->getResourceIdForIdString($rid);
287 if ($id) {
288 return $this->irss->consume()->stream($id)->getStream();
289 }
290 return null;
291 }
292
293 public function getResourcePath(string $rid): string
294 {
295 $stream = $this->stream($rid);
296 if ($stream) {
297 return $stream->getMetadata('uri') ?? '';
298 }
299 return "";
300 }
301
302 public function getResource(string $rid): ?StorableResource
303 {
304 $id = $this->getResourceIdForIdString($rid);
305 if ($id) {
306 return $this->irss->manage()->getResource($id);
307 }
308 return null;
309 }
310
312 ResourceCollection $collection
313 ): \Generator {
314 foreach ($collection->getResourceIdentifications() as $rid) {
315 $info = $this->irss->manage()->getResource($rid)
316 ->getCurrentRevision()
317 ->getInformation();
318 $src = $this->irss->consume()->src($rid)->getSrc();
319 yield $this->data->resourceInformation(
320 $rid->serialize(),
321 $info->getTitle(),
322 $info->getSize(),
323 $info->getCreationDate()->getTimestamp(),
324 $info->getMimeType(),
325 $src
326 );
327 }
328 }
329
330 public function getResourceInfo(
331 string $rid
333 $rid = $this->getResourceIdForIdString($rid);
334 $info = $this->irss->manage()->getResource($rid)
335 ->getCurrentRevision()
336 ->getInformation();
337 $src = $this->irss->consume()->src($rid)->getSrc();
338 return $this->data->resourceInformation(
339 $rid->serialize(),
340 $info->getTitle(),
341 $info->getSize(),
342 $info->getCreationDate()->getTimestamp(),
343 $info->getMimeType(),
344 $src
345 );
346 }
347
348 public function clone(
349 string $from_rc_id
350 ): string {
351 if ($from_rc_id !== "") {
352 $cloned_rcid = $this->irss->collection()->clone($this->irss->collection()->id($from_rc_id));
353 return $cloned_rcid->serialize();
354 }
355 return "";
356 }
357
358 public function cloneResource(
359 string $from_rid
360 ): string {
361 if ($from_rid !== "") {
362 $cloned_rid = $this->irss->manage()->clone($this->getResourceIdForIdString($from_rid));
363 return $cloned_rid->serialize();
364 }
365 return "";
366 }
367
368 public function cloneContainer(
369 string $from_rid
370 ): string {
371 if ($from_rid !== "") {
372 $cloned_rid = $this->irss->manageContainer()->clone($this->getResourceIdForIdString($from_rid));
373 return $cloned_rid->serialize();
374 }
375 return "";
376 }
377
378 public function deleteResource(string $rid, ResourceStakeholder $stakeholder): void
379 {
380 if ($rid !== "") {
381 $res = $this->getResourceIdForIdString($rid);
382 if ($res) {
383 $this->irss->manage()->remove($this->getResourceIdForIdString($rid), $stakeholder);
384 }
385 }
386 }
387
389 string $rid,
390 string $entry,
391 ResourceCollection $target_collection,
392 ResourceStakeholder $target_stakeholder
393 ): void {
394 $entry_parts = explode("/", $entry);
395 $stream = $this->getStreamOfContainerEntry($rid, $entry);
396 $feedback_rid = $this->irss->manage()->stream(
397 $stream,
398 $target_stakeholder,
399 $entry_parts[2]
400 );
401 $target_collection->add($feedback_rid);
402 $this->irss->collection()->store($target_collection);
403 }
404
405 //
406 // Container
407 //
408
410 string $rid,
411 string $entry
412 ): ZIPStream {
413 $zip_path = $this->stream($rid)->getMetadata("uri");
414 return Streams::ofFileInsideZIP(
415 $zip_path,
416 $entry
417 );
418 }
419
420 public function getContainerEntryInfo(
421 string $container_id,
422 string $path
423 ): array {
424 $reader = new ZipReader(
425 $this->irss->consume()->stream($this->getResourceIdForIdString($container_id))->getStream()
426 );
427 return $reader->getItem($path)[1];
428 }
429
430 public function deliverContainerEntry(
431 string $container_id,
432 string $path
433 ): void {
434 $reader = new ZipReader(
435 $this->irss->consume()->stream($this->getResourceIdForIdString($container_id))->getStream()
436 );
437 [$stream, $info] = $reader->getItem($path);
438
439 $this->file_delivery->delivery()->deliver(
440 $stream,
441 $info['basename'],
442 $info['mime_type'],
443 Disposition::ATTACHMENT
444 );
445 }
446
450 public function hasContainerEntry(
451 string $rid,
452 string $entry
453 ): bool {
454 if ($rid === "") {
455 return false;
456 }
457 $zip_path = $this->stream($rid)?->getMetadata("uri");
458 if (is_null($zip_path)) {
459 return false;
460 }
461 try {
462 $stream = Streams::ofFileInsideZIP(
463 $zip_path,
464 $entry
465 );
466 $stream->close();
467 return true;
468 } catch (\Exception $e) {
469 return false;
470 }
471 }
472
473
474 // this currently does not work due to issues in the irss
475 /*
476 public function importContainerFromZipUploadResult(
477 UploadResult $result,
478 ResourceStakeholder $stakeholder
479 ): string {
480 // if the result is not OK, we skip it
481 if (!$result->isOK()) {
482 return "";
483 }
484
485 // we store the file in the IRSS
486 $container_id = $this->irss->manage()->containerFromUpload(
487 $result,
488 $stakeholder
489 );
490 return $container_id->serialize();
491 }*/
492
496 public function getContainerStreams(
497 string $container_id,
498 ResourceStakeholder $stakeholder
499 ): \Generator {
500 foreach ($this->irss->consume()->containerZIP(
501 $this->getResourceIdForIdString($container_id)
502 )->getZIP()->getFileStreams() as $stream) {
503 yield $stream;
504 }
505 }
506
507 public function getContainerPaths(
508 string $container_id
509 ): \Generator {
510 foreach ($this->irss->consume()->containerZIP(
511 $this->getResourceIdForIdString($container_id)
512 )->getZIP()->getPaths() as $path) {
513 yield $path;
514 }
515 }
516
517 public function getContainerEntries(
518 string $container_id
519 ): array {
520 $rid = $this->getResourceIdForIdString($container_id);
521 if (is_null($rid)) {
522 return [];
523 }
524 $reader = new ZipReader(
525 $this->irss->consume()->stream($rid)->getStream()
526 );
527 return $reader->getStructure();
528 }
529
531 string $container_id,
532 string $dir_path
533 ): array {
534 $rid = $this->getResourceIdForIdString($container_id);
535 if (is_null($rid)) {
536 return [];
537 }
538 $reader = new ZipReader(
539 $this->irss->consume()->stream($rid)->getStream()
540 );
541 $entries = [];
542 foreach ($reader->getStructure() as $path => $entry) {
543 $dirname = $entry['dirname'] ?? '';
544 if ($dirname !== $dir_path) {
545 continue;
546 }
547 $entries[$path] = $entry;
548 }
549 return $entries;
550 }
551
553 string $source_container_id,
554 string $target_container_id,
555 string $source_dir_path = "",
556 string $target_dir_path = ""
557 ): void {
558 $reader = new ZipReader(
559 $this->irss->consume()->stream($this->getResourceIdForIdString($source_container_id))->getStream()
560 );
561 $entries = [];
562 foreach ($reader->getStructure() as $path => $entry) {
563 if (str_starts_with($entry['dirname'], $source_dir_path) && !$entry['is_dir']) {
564 $this->addStreamToContainer(
565 $target_container_id,
566 $this->getStreamOfContainerEntry($source_container_id, $path),
567 $target_dir_path . "/" . substr($path, strlen($source_dir_path))
568 );
569 }
570 }
571 }
572
573 public function createContainer(
574 ResourceStakeholder $stakeholder,
575 string $title = "container.zip"
576 ): string {
577 if ($title === "") {
578 throw new \ilException("Container title missing.");
579 }
580 // create empty container resource. empty zips are not allowed, we need at least one file which is hidden
581 $tmp_dir_info = new \SplFileInfo(\ilFileUtils::ilTempnam());
582 $this->filesystems->temp()->createDir($tmp_dir_info->getFilename());
583 $tmp_dir = $tmp_dir_info->getRealPath();
584 $options = (new ZipOptions())
585 ->withZipOutputName($title)
586 ->withZipOutputPath($tmp_dir);
587 $empty_zip = $this->archives->zip(
588 [],
590 );
591 $rid = $this->irss->manageContainer()->containerFromStream(
592 $empty_zip->get(),
593 $stakeholder,
594 $title
595 );
596 \ilFileUtils::delDir($tmp_dir);
597 return $rid->serialize();
598 }
599
601 string $local_zip_path,
602 ResourceStakeholder $stakeholder
603 ): string {
604 $stream = fopen($local_zip_path, 'r');
605 $fs = new Stream($stream);
606
607 $rid = $this->irss->manageContainer()->containerFromStream(
608 $fs,
609 $stakeholder
610 );
611 return $rid->serialize();
612 }
613
615 string $local_dir_path,
616 ResourceStakeholder $stakeholder,
617 string $container_path = "",
618 bool $recursive = true,
619 string $title = "container.zip"
620 ): string {
621 $real_dir_path = realpath($local_dir_path);
622 $rid = $this->createContainer($stakeholder, $title);
623 if ($recursive) {
624 $iterator = new \RecursiveIteratorIterator(
625 new \RecursiveDirectoryIterator(
626 $local_dir_path,
627 \RecursiveDirectoryIterator::SKIP_DOTS | \RecursiveDirectoryIterator::CURRENT_AS_SELF
628 ),
629 \RecursiveIteratorIterator::SELF_FIRST
630 );
631 } else {
632 $iterator = new \DirectoryIterator($local_dir_path);
633 }
634 if ($container_path !== "") {
635 $container_path = $container_path . "/";
636 }
637 foreach ($iterator as $file) {
638 if (!$file->isDir() && !$file->isDot()) {
639 $file->getRealPath();
640 $this->addLocalFileToContainer(
641 $rid,
642 $file->getRealPath(),
643 $container_path . substr($file->getRealPath(), strlen($real_dir_path) + 1)
644 );
645 }
646 }
647 return $rid;
648 }
649
650 public function addLocalFileToContainer(
651 string $rid,
652 string $fullpath,
653 string $path
654 ): void {
655 $id = $this->getResourceIdForIdString($rid);
656 $stream = fopen($fullpath, 'r');
657 $fs = new Stream($stream);
658 $this->irss->manageContainer()->removePathInsideContainer($id, $path);
659 $this->irss->manageContainer()->addStreamToContainer(
660 $id,
661 $fs,
662 $path
663 );
664 fclose($stream);
665 }
666
667 public function addStringToContainer(
668 string $rid,
669 string $content,
670 string $path
671 ): void {
672 $id = $this->getResourceIdForIdString($rid);
673 $stream = fopen('php://memory', 'r+');
674 fwrite($stream, $content);
675 rewind($stream);
676 $fs = new Stream($stream);
677 $this->irss->manageContainer()->removePathInsideContainer($id, $path);
678 $this->irss->manageContainer()->addStreamToContainer(
679 $id,
680 $fs,
681 $path
682 );
683 fclose($stream);
684 }
685
686 public function addDirectoryToContainer(
687 string $rid,
688 string $source_dir,
689 string $target_path = ""
690 ): void {
691 $source_dir = realpath($source_dir);
692 $directoryIterator = new \RecursiveDirectoryIterator(
693 $source_dir,
694 \FilesystemIterator::SKIP_DOTS
695 );
696
697 $recursiveIterator = new \RecursiveIteratorIterator(
698 $directoryIterator,
699 \RecursiveIteratorIterator::LEAVES_ONLY
700 );
701
702 foreach ($recursiveIterator as $fileInfo) {
703 if ($fileInfo->isFile()) {
704 $fullPath = $fileInfo->getPathname();
705 $relativePath = substr($fullPath, strlen($source_dir) + 1);
706 $files[] = $relativePath;
707 $this->addLocalFileToContainer(
708 $rid,
709 $fullPath,
710 $target_path . "/" . $relativePath
711 );
712 }
713 }
714 }
715
716 public function addUploadToContainer(
717 string $rid,
718 UploadResult $result
719 ): void {
720 $id = $this->getResourceIdForIdString($rid);
721 $this->irss->manageContainer()->addUploadToContainer(
722 $id,
723 $result,
724 "images"
725 );
726 }
727
728 public function getContainerUri(
729 string $rid,
730 string $path
731 ): string {
732 $id = $this->getResourceIdForIdString($rid);
733 $uri = $this->irss->consume()->containerURI(
734 $id,
735 $path,
736 8 * 60
737 )->getURI();
738 // temp fixes wrong slash escaping, maybe due to 24805bcaabb33b1c5c82609dbe6791c55577c6a4
739 $uri = str_replace("%2F", "/", (string) $uri);
740 return (string) $uri;
741 }
742
743 public function getContainerZip(
744 string $rid
745 ): Unzip {
746 $id = $this->getResourceIdForIdString($rid);
747 return $this->irss->consume()->containerZIP(
748 $id
749 )->getZIP();
750 }
751
752
753
755 string $rid,
756 string $tmp_name,
757 string $target_path
758 ): void {
759 $upload = $this->upload;
760
761 if (!$upload->hasBeenProcessed()) {
762 $upload->process();
763 }
764 foreach ($upload->getResults() as $name => $result) {
765 // we must check if these are files from this input
766 if ($name !== $tmp_name) {
767 continue;
768 }
769 // if the result is not OK, we skip it
770 if (!$result->isOK()) {
771 continue;
772 }
773
774 $id = $this->getResourceIdForIdString($rid);
775
776 if (!is_null($id)) {
777 // if target path is a directory, addUploadToContainer
778 // can be used, the original filename will be appended
779 if ($target_path === "" || str_ends_with($target_path, "/")) {
780 $this->irss->manageContainer()->addUploadToContainer(
781 $id,
782 $result,
783 "/"
784 );
785 } else {
786 // we have a full path given (renaming the
787 // original name)
788 $this->addLocalFileToContainer(
789 $rid,
790 $result->getPath(),
791 $target_path
792 );
793 }
794 }
795 }
796 }
797
799 string $rid,
800 UploadResult $result,
801 string $target_path
802 ): void {
803 // if the result is not OK, we skip it
804 if (!$result->isOK()) {
805 return;
806 }
807
808 $id = $this->getResourceIdForIdString($rid);
809
810 if (!is_null($id)) {
811 $this->irss->manageContainer()->addUploadToContainer(
812 $id,
813 $result,
814 $target_path
815 );
816 }
817 }
818
819 public function addStreamToContainer(
820 string $rid,
821 FileStream $stream,
822 string $path
823 ): void {
824 $id = $this->getResourceIdForIdString($rid);
825
826 if (!is_null($id)) {
827 $this->irss->manageContainer()->addStreamToContainer(
828 $id,
829 $stream,
830 $path
831 );
832 }
833 }
834
835 public function removePathFromContainer(
836 string $rid,
837 string $path
838 ): void {
839 $id = $this->getResourceIdForIdString($rid);
840 if (!is_null($id)) {
841 $this->irss->manageContainer()->removePathInsideContainer($id, $path);
842 }
843 }
844
845 // currently broken, see https://mantis.ilias.de/view.php?id=44135
846 public function renameContainer(
847 string $rid,
848 string $title
849 ): void {
850 $id = $this->getResourceIdForIdString($rid);
851 $rev = $this->irss->manageContainer()->getCurrentRevision($id);
852 $info = $rev->getInformation();
853 $info->setTitle($title);
854 $rev->setInformation($info);
855 $this->irss->manageContainer()->updateRevision($rev);
856 }
857
858}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
getMetadata($key=null)
@inheritDoc
Definition: Stream.php:306
Stream factory which enables the user to create streams without the knowledge of the concrete class.
Definition: Streams.php:32
The legacy path helper provides convenient functions for the integration of the filesystem service wi...
ILIAS FileDelivery Services $file_delivery
Definition: IRSSWrapper.php:44
importFileFromUploadResult(UploadResult $result, ResourceStakeholder $stakeholder)
hasContainerEntry(string $rid, string $entry)
Is there a better way to check this?
getStreamOfContainerEntry(string $rid, string $entry)
addEntryOfZipResourceToCollection(string $rid, string $entry, ResourceCollection $target_collection, ResourceStakeholder $target_stakeholder)
importFileFromUploadResultToContainer(string $rid, UploadResult $result, string $target_path)
createContainer(ResourceStakeholder $stakeholder, string $title="container.zip")
addDirectoryToContainer(string $rid, string $source_dir, string $target_path="")
importFilesFromLegacyUploadToCollection(ResourceCollection $collection, array $file_input, ResourceStakeholder $stakeholder)
ILIAS ResourceStorage Services $irss
Definition: IRSSWrapper.php:46
renameContainer(string $rid, string $title)
getContainerEntryInfo(string $container_id, string $path)
getContainerStreams(string $container_id, ResourceStakeholder $stakeholder)
removePathFromContainer(string $rid, string $path)
addStreamToContainer(string $rid, FileStream $stream, string $path)
getContainerEntriesOfPath(string $container_id, string $dir_path)
createContainerFromLocalDir(string $local_dir_path, ResourceStakeholder $stakeholder, string $container_path="", bool $recursive=true, string $title="container.zip")
addContainerDirToTargetContainer(string $source_container_id, string $target_container_id, string $source_dir_path="", string $target_dir_path="")
getContainerPaths(string $container_id)
getCollectionResourcesInfo(ResourceCollection $collection)
deliverContainerEntry(string $container_id, string $path)
addUploadToContainer(string $rid, UploadResult $result)
renameCurrentRevision(string $rid, string $title)
deleteCollectionForIdString(string $rcid, ResourceStakeholder $stakeholder)
Definition: IRSSWrapper.php:88
deleteResource(string $rid, ResourceStakeholder $stakeholder)
__construct(protected DataService $data)
Definition: IRSSWrapper.php:49
getContainerUri(string $rid, string $path)
addLocalFileToContainer(string $rid, string $fullpath, string $path)
ILIAS FileUpload FileUpload $upload
Definition: IRSSWrapper.php:45
importFileFromLegacyUploadToContainer(string $rid, string $tmp_name, string $target_path)
importFilesFromDirectoryToCollection(ResourceCollection $collection, string $directory, ResourceStakeholder $stakeholder)
createContainerFromLocalZip(string $local_zip_path, ResourceStakeholder $stakeholder)
importStream(Stream $stream, ResourceStakeholder $stakeholder)
importLocalFile(string $file, string $name, ResourceStakeholder $stakeholder)
importFileFromLegacyUpload(array $file_input, ResourceStakeholder $stakeholder)
addStringToContainer(string $rid, string $content, string $path)
getContainerEntries(string $container_id)
add(ResourceIdentification $identification)
getItem(string $path_inside_zip, ?array $structure=null)
Definition: ZipReader.php:124
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
$info
Definition: entry_point.php:21
The Filesystems interface defines the access methods which can be used to fetch the different filesys...
Definition: Filesystems.php:30
The base interface for all filesystem streams.
Definition: FileStream.php:32
$path
Definition: ltiservices.php:30
$res
Definition: ltiservices.php:69
static filesystems()
Returns the loaded filesystems.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
if(!file_exists('../ilias.ini.php'))
global $DIC
Definition: shib_login.php:26