ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
IRSSWrapper.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Repository\IRSS;
22
40
42{
43 protected $filesystems;
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 ) {
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 $zip_path = $this->stream($rid)?->getMetadata("uri");
455 try {
456 $stream = Streams::ofFileInsideZIP(
457 $zip_path,
458 $entry
459 );
460 $stream->close();
461 return true;
462 } catch (\Exception $e) {
463 return false;
464 }
465 }
466
467
468 // this currently does not work due to issues in the irss
469 /*
470 public function importContainerFromZipUploadResult(
471 UploadResult $result,
472 ResourceStakeholder $stakeholder
473 ): string {
474 // if the result is not OK, we skip it
475 if (!$result->isOK()) {
476 return "";
477 }
478
479 // we store the file in the IRSS
480 $container_id = $this->irss->manage()->containerFromUpload(
481 $result,
482 $stakeholder
483 );
484 return $container_id->serialize();
485 }*/
486
490 public function getContainerStreams(
491 string $container_id,
492 ResourceStakeholder $stakeholder
493 ): \Generator {
494 foreach ($this->irss->consume()->containerZIP(
495 $this->getResourceIdForIdString($container_id)
496 )->getZIP()->getFileStreams() as $stream) {
497 yield $stream;
498 }
499 }
500
501 public function getContainerPaths(
502 string $container_id
503 ): \Generator {
504 foreach ($this->irss->consume()->containerZIP(
505 $this->getResourceIdForIdString($container_id)
506 )->getZIP()->getPaths() as $path) {
507 yield $path;
508 }
509 }
510
511 public function getContainerEntries(
512 string $container_id
513 ): array {
514 $reader = new ZipReader(
515 $this->irss->consume()->stream($this->getResourceIdForIdString($container_id))->getStream()
516 );
517 return $reader->getStructure();
518 }
519
521 string $container_id,
522 string $dir_path
523 ): array {
524 $reader = new ZipReader(
525 $this->irss->consume()->stream($this->getResourceIdForIdString($container_id))->getStream()
526 );
527 $entries = [];
528 foreach ($reader->getStructure() as $path => $entry) {
529 $dirname = $entry['dirname'] ?? '';
530 if ($dirname !== $dir_path) {
531 continue;
532 }
533 $entries[$path] = $entry;
534 }
535 return $entries;
536 }
537
539 string $source_container_id,
540 string $target_container_id,
541 string $source_dir_path = "",
542 string $target_dir_path = ""
543 ): void {
544 $reader = new ZipReader(
545 $this->irss->consume()->stream($this->getResourceIdForIdString($source_container_id))->getStream()
546 );
547 $entries = [];
548 foreach ($reader->getStructure() as $path => $entry) {
549 if (str_starts_with($entry['dirname'], $source_dir_path) && !$entry['is_dir']) {
550 $this->addStreamToContainer(
551 $target_container_id,
552 $this->getStreamOfContainerEntry($source_container_id, $path),
553 $target_dir_path . "/" . substr($path, strlen($source_dir_path))
554 );
555 }
556 }
557 }
558
559 public function createContainer(
560 ResourceStakeholder $stakeholder,
561 string $title = "container.zip"
562 ): string {
563 if ($title === "") {
564 throw new \ilException("Container title missing.");
565 }
566 // create empty container resource. empty zips are not allowed, we need at least one file which is hidden
567 $tmp_dir_info = new \SplFileInfo(\ilFileUtils::ilTempnam());
568 $this->filesystems->temp()->createDir($tmp_dir_info->getFilename());
569 $tmp_dir = $tmp_dir_info->getRealPath();
570 $options = (new ZipOptions())
571 ->withZipOutputName($title)
572 ->withZipOutputPath($tmp_dir);
573 $empty_zip = $this->archives->zip(
574 [],
575 $options
576 );
577 $rid = $this->irss->manageContainer()->containerFromStream(
578 $empty_zip->get(),
579 $stakeholder,
580 $title
581 );
582 \ilFileUtils::delDir($tmp_dir);
583 return $rid->serialize();
584 }
585
587 string $local_zip_path,
588 ResourceStakeholder $stakeholder
589 ): string {
590 $stream = fopen($local_zip_path, 'r');
591 $fs = new Stream($stream);
592
593 $rid = $this->irss->manageContainer()->containerFromStream(
594 $fs,
595 $stakeholder
596 );
597 return $rid->serialize();
598 }
599
601 string $local_dir_path,
602 ResourceStakeholder $stakeholder,
603 string $container_path = "",
604 bool $recursive = true,
605 string $title = "container.zip"
606 ): string {
607 $real_dir_path = realpath($local_dir_path);
608 $rid = $this->createContainer($stakeholder, $title);
609 if ($recursive) {
610 $iterator = new \RecursiveIteratorIterator(
611 new \RecursiveDirectoryIterator(
612 $local_dir_path,
613 \RecursiveDirectoryIterator::SKIP_DOTS | \RecursiveDirectoryIterator::CURRENT_AS_SELF
614 ),
615 \RecursiveIteratorIterator::SELF_FIRST
616 );
617 } else {
618 $iterator = new \DirectoryIterator($local_dir_path);
619 }
620 if ($container_path !== "") {
621 $container_path = $container_path . "/";
622 }
623 foreach ($iterator as $file) {
624 if (!$file->isDir() && !$file->isDot()) {
625 $file->getRealPath();
626 $this->addLocalFileToContainer(
627 $rid,
628 $file->getRealPath(),
629 $container_path . substr($file->getRealPath(), strlen($real_dir_path) + 1)
630 );
631 }
632 }
633 return $rid;
634 }
635
636 public function addLocalFileToContainer(
637 string $rid,
638 string $fullpath,
639 string $path
640 ): void {
641 $id = $this->getResourceIdForIdString($rid);
642 $stream = fopen($fullpath, 'r');
643 $fs = new Stream($stream);
644 $this->irss->manageContainer()->removePathInsideContainer($id, $path);
645 $this->irss->manageContainer()->addStreamToContainer(
646 $id,
647 $fs,
648 $path
649 );
650 fclose($stream);
651 }
652
653 public function addStringToContainer(
654 string $rid,
655 string $content,
656 string $path
657 ): void {
658 $id = $this->getResourceIdForIdString($rid);
659 $stream = fopen('php://memory', 'r+');
660 fwrite($stream, $content);
661 rewind($stream);
662 $fs = new Stream($stream);
663 $this->irss->manageContainer()->removePathInsideContainer($id, $path);
664 $this->irss->manageContainer()->addStreamToContainer(
665 $id,
666 $fs,
667 $path
668 );
669 fclose($stream);
670 }
671
672 public function addDirectoryToContainer(
673 string $rid,
674 string $source_dir,
675 string $target_path = ""
676 ): void {
677 $source_dir = realpath($source_dir);
678 $directoryIterator = new \RecursiveDirectoryIterator(
679 $source_dir,
680 \FilesystemIterator::SKIP_DOTS
681 );
682
683 $recursiveIterator = new \RecursiveIteratorIterator(
684 $directoryIterator,
685 \RecursiveIteratorIterator::LEAVES_ONLY
686 );
687
688 foreach ($recursiveIterator as $fileInfo) {
689 if ($fileInfo->isFile()) {
690 $fullPath = $fileInfo->getPathname();
691 $relativePath = substr($fullPath, strlen($source_dir) + 1);
692 $files[] = $relativePath;
693 $this->addLocalFileToContainer(
694 $rid,
695 $fullPath,
696 $target_path . "/" . $relativePath
697 );
698 }
699 }
700 }
701
702 public function addUploadToContainer(
703 string $rid,
704 UploadResult $result
705 ): void {
706 $id = $this->getResourceIdForIdString($rid);
707 $this->irss->manageContainer()->addUploadToContainer(
708 $id,
709 $result,
710 "images"
711 );
712 }
713
714 public function getContainerUri(
715 string $rid,
716 string $path
717 ): string {
718 $id = $this->getResourceIdForIdString($rid);
719 $uri = $this->irss->consume()->containerURI(
720 $id,
721 $path,
722 8 * 60
723 )->getURI();
724 // temp fixes wrong slash escaping, maybe due to 24805bcaabb33b1c5c82609dbe6791c55577c6a4
725 $uri = str_replace("%2F", "/", (string) $uri);
726 return (string) $uri;
727 }
728
729 public function getContainerZip(
730 string $rid
731 ): Unzip {
732 $id = $this->getResourceIdForIdString($rid);
733 return $this->irss->consume()->containerZIP(
734 $id
735 )->getZIP();
736 }
737
738
739
741 string $rid,
742 string $tmp_name,
743 string $target_path
744 ): void {
745 $upload = $this->upload;
746
747 if (!$upload->hasBeenProcessed()) {
748 $upload->process();
749 }
750 foreach ($upload->getResults() as $name => $result) {
751 // we must check if these are files from this input
752 if ($name !== $tmp_name) {
753 continue;
754 }
755 // if the result is not OK, we skip it
756 if (!$result->isOK()) {
757 continue;
758 }
759
760 $id = $this->getResourceIdForIdString($rid);
761
762 if (!is_null($id)) {
763 // if target path is a directory, addUploadToContainer
764 // can be used, the original filename will be appended
765 if ($target_path === "" || str_ends_with($target_path, "/")) {
766 $this->irss->manageContainer()->addUploadToContainer(
767 $id,
768 $result,
769 "/"
770 );
771 } else {
772 // we have a full path given (renaming the
773 // original name)
774 $this->addLocalFileToContainer(
775 $rid,
776 $result->getPath(),
777 $target_path
778 );
779 }
780 }
781 }
782 }
783
785 string $rid,
786 UploadResult $result,
787 string $target_path
788 ): void {
789 // if the result is not OK, we skip it
790 if (!$result->isOK()) {
791 return;
792 }
793
794 $id = $this->getResourceIdForIdString($rid);
795
796 if (!is_null($id)) {
797 $this->irss->manageContainer()->addUploadToContainer(
798 $id,
799 $result,
800 $target_path
801 );
802 }
803 }
804
805 public function addStreamToContainer(
806 string $rid,
807 FileStream $stream,
808 string $path
809 ): void {
810 $id = $this->getResourceIdForIdString($rid);
811
812 if (!is_null($id)) {
813 $this->irss->manageContainer()->addStreamToContainer(
814 $id,
815 $stream,
816 $path
817 );
818 }
819 }
820
821 public function removePathFromContainer(
822 string $rid,
823 string $path
824 ): void {
825 $id = $this->getResourceIdForIdString($rid);
826 if (!is_null($id)) {
827 $this->irss->manageContainer()->removePathInsideContainer($id, $path);
828 }
829 }
830
831 // currently broken, see https://mantis.ilias.de/view.php?id=44135
832 public function renameContainer(
833 string $rid,
834 string $title
835 ): void {
836 $id = $this->getResourceIdForIdString($rid);
837 $rev = $this->irss->manageContainer()->getCurrentRevision($id);
838 $info = $rev->getInformation();
839 $info->setTitle($title);
840 $rev->setInformation($info);
841 $this->irss->manageContainer()->updateRevision($rev);
842 }
843
844}
$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