ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
IRSSWrapper.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace 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;
47  protected Archives $archives;
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 
88  public function deleteCollectionForIdString(
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 
178  public function getResourceIdForIdString(string $rid): ?ResourceIdentification
179  {
180  return $this->irss->manage()->find($rid);
181  }
182 
183  public function importFileFromLegacyUpload(
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 
214  public function importFileFromUploadResult(
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 
311  public function getCollectionResourcesInfo(
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 
409  public function getStreamOfContainerEntry(
410  string $rid,
411  string $entry
412  ): ZIPStream {
413  $zip_path = $this->stream($rid)->getMetadata("uri");
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 
520  public function getContainerEntriesOfPath(
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($local_dir_path, \RecursiveDirectoryIterator::SKIP_DOTS),
612  \RecursiveIteratorIterator::SELF_FIRST
613  );
614  } else {
615  $iterator = new \DirectoryIterator($local_dir_path);
616  }
617  if ($container_path !== "") {
618  $container_path = $container_path . "/";
619  }
620  foreach ($iterator as $file) {
621  if (!$file->isDir() && !$file->isDot()) {
622  $file->getRealPath();
624  $rid,
625  $file->getRealPath(),
626  $container_path . substr($file->getRealPath(), strlen($real_dir_path) + 1)
627  );
628  }
629  }
630  return $rid;
631  }
632 
633  public function addLocalFileToContainer(
634  string $rid,
635  string $fullpath,
636  string $path
637  ): void {
638  $id = $this->getResourceIdForIdString($rid);
639  $stream = fopen($fullpath, 'r');
640  $fs = new Stream($stream);
641  $this->irss->manageContainer()->removePathInsideContainer($id, $path);
642  $this->irss->manageContainer()->addStreamToContainer(
643  $id,
644  $fs,
645  $path
646  );
647  fclose($stream);
648  }
649 
650  public function addStringToContainer(
651  string $rid,
652  string $content,
653  string $path
654  ): void {
655  $id = $this->getResourceIdForIdString($rid);
656  $stream = fopen('php://memory', 'r+');
657  fwrite($stream, $content);
658  rewind($stream);
659  $fs = new Stream($stream);
660  $this->irss->manageContainer()->removePathInsideContainer($id, $path);
661  $this->irss->manageContainer()->addStreamToContainer(
662  $id,
663  $fs,
664  $path
665  );
666  fclose($stream);
667  }
668 
669  public function addDirectoryToContainer(
670  string $rid,
671  string $source_dir,
672  string $target_path = ""
673  ): void {
674  $source_dir = realpath($source_dir);
675  $directoryIterator = new \RecursiveDirectoryIterator(
676  $source_dir,
677  \FilesystemIterator::SKIP_DOTS
678  );
679 
680  $recursiveIterator = new \RecursiveIteratorIterator(
681  $directoryIterator,
682  \RecursiveIteratorIterator::LEAVES_ONLY
683  );
684 
685  foreach ($recursiveIterator as $fileInfo) {
686  if ($fileInfo->isFile()) {
687  $fullPath = $fileInfo->getPathname();
688  $relativePath = substr($fullPath, strlen($source_dir) + 1);
689  $files[] = $relativePath;
691  $rid,
692  $fullPath,
693  $target_path . "/" . $relativePath
694  );
695  }
696  }
697  }
698 
699  public function addUploadToContainer(
700  string $rid,
701  UploadResult $result
702  ): void {
703  $id = $this->getResourceIdForIdString($rid);
704  $this->irss->manageContainer()->addUploadToContainer(
705  $id,
706  $result,
707  "images"
708  );
709  }
710 
711  public function getContainerUri(
712  string $rid,
713  string $path
714  ): string {
715  $id = $this->getResourceIdForIdString($rid);
716  $uri = $this->irss->consume()->containerURI(
717  $id,
718  $path,
719  8 * 60
720  )->getURI();
721  // temp fixes wrong slash escaping, maybe due to 24805bcaabb33b1c5c82609dbe6791c55577c6a4
722  $uri = str_replace("%2F", "/", (string) $uri);
723  return (string) $uri;
724  }
725 
726  public function getContainerZip(
727  string $rid
728  ): Unzip {
729  $id = $this->getResourceIdForIdString($rid);
730  return $this->irss->consume()->containerZIP(
731  $id
732  )->getZIP();
733  }
734 
735 
736 
738  string $rid,
739  string $tmp_name,
740  string $target_path
741  ): void {
742  $upload = $this->upload;
743 
744  if (!$upload->hasBeenProcessed()) {
745  $upload->process();
746  }
747  foreach ($upload->getResults() as $name => $result) {
748  // we must check if these are files from this input
749  if ($name !== $tmp_name) {
750  continue;
751  }
752  // if the result is not OK, we skip it
753  if (!$result->isOK()) {
754  continue;
755  }
756 
757  $id = $this->getResourceIdForIdString($rid);
758 
759  if (!is_null($id)) {
760  // if target path is a directory, addUploadToContainer
761  // can be used, the original filename will be appended
762  if ($target_path === "" || str_ends_with($target_path, "/")) {
763  $this->irss->manageContainer()->addUploadToContainer(
764  $id,
765  $result,
766  "/"
767  );
768  } else {
769  // we have a full path given (renaming the
770  // original name)
772  $rid,
773  $result->getPath(),
774  $target_path
775  );
776  }
777  }
778  }
779  }
780 
782  string $rid,
783  UploadResult $result,
784  string $target_path
785  ): void {
786  // if the result is not OK, we skip it
787  if (!$result->isOK()) {
788  return;
789  }
790 
791  $id = $this->getResourceIdForIdString($rid);
792 
793  if (!is_null($id)) {
794  $this->irss->manageContainer()->addUploadToContainer(
795  $id,
796  $result,
797  $target_path
798  );
799  }
800  }
801 
802  public function addStreamToContainer(
803  string $rid,
804  FileStream $stream,
805  string $path
806  ): void {
807  $id = $this->getResourceIdForIdString($rid);
808 
809  if (!is_null($id)) {
810  $this->irss->manageContainer()->addStreamToContainer(
811  $id,
812  $stream,
813  $path
814  );
815  }
816  }
817 
818  public function removePathFromContainer(
819  string $rid,
820  string $path
821  ): void {
822  $id = $this->getResourceIdForIdString($rid);
823  if (!is_null($id)) {
824  $this->irss->manageContainer()->removePathInsideContainer($id, $path);
825  }
826  }
827 
828  // currently broken, see https://mantis.ilias.de/view.php?id=44135
829  public function renameContainer(
830  string $rid,
831  string $title
832  ): void {
833  $id = $this->getResourceIdForIdString($rid);
834  $rev = $this->irss->manageContainer()->getCurrentRevision($id);
835  $info = $rev->getInformation();
836  $info->setTitle($title);
837  $rev->setInformation($info);
838  $this->irss->manageContainer()->updateRevision($rev);
839  }
840 
841 }
$res
Definition: ltiservices.php:66
static createRelativePath(string $absolute_path)
Creates a relative path from an absolute path which starts with a valid storage location.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS FileUpload FileUpload $upload
Definition: IRSSWrapper.php:45
addEntryOfZipResourceToCollection(string $rid, string $entry, ResourceCollection $target_collection, ResourceStakeholder $target_stakeholder)
getCollectionResourcesInfo(ResourceCollection $collection)
addStringToContainer(string $rid, string $content, string $path)
getContainerUri(string $rid, string $path)
createContainerFromLocalZip(string $local_zip_path, ResourceStakeholder $stakeholder)
getContainerPaths(string $container_id)
Interface Observer Contains several chained tasks and infos about them.
importFileFromLegacyUpload(array $file_input, ResourceStakeholder $stakeholder)
importLocalFile(string $file, string $name, ResourceStakeholder $stakeholder)
ILIAS FileDelivery Services $file_delivery
Definition: IRSSWrapper.php:44
addStreamToContainer(string $rid, FileStream $stream, string $path)
renameContainer(string $rid, string $title)
static ofFileInsideZIP(string $path_to_zip, string $path_inside_zip)
Definition: Streams.php:84
getContainerEntries(string $container_id)
getContainerStreams(string $container_id, ResourceStakeholder $stakeholder)
$path
Definition: ltiservices.php:29
__construct(protected DataService $data)
Definition: IRSSWrapper.php:49
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
addDirectoryToContainer(string $rid, string $source_dir, string $target_path="")
getItem(string $path_inside_zip, ?array $structure=null)
Definition: ZipReader.php:124
hasContainerEntry(string $rid, string $entry)
Is there a better way to check this?
deleteResource(string $rid, ResourceStakeholder $stakeholder)
static filesystems()
Returns the loaded filesystems.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
removePathFromContainer(string $rid, string $path)
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
createContainer(ResourceStakeholder $stakeholder, string $title="container.zip")
global $DIC
Definition: shib_login.php:22
importFilesFromLegacyUploadToCollection(ResourceCollection $collection, array $file_input, ResourceStakeholder $stakeholder)
addUploadToContainer(string $rid, UploadResult $result)
deleteCollectionForIdString(string $rcid, ResourceStakeholder $stakeholder)
Definition: IRSSWrapper.php:88
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
static deriveFilesystemFrom(string $absolute_path)
Tries to fetch the filesystem responsible for the absolute path.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
importFilesFromDirectoryToCollection(ResourceCollection $collection, string $directory, ResourceStakeholder $stakeholder)
getContainerEntryInfo(string $container_id, string $path)
addLocalFileToContainer(string $rid, string $fullpath, string $path)
deliverContainerEntry(string $container_id, string $path)
importStream(Stream $stream, ResourceStakeholder $stakeholder)
addContainerDirToTargetContainer(string $source_container_id, string $target_container_id, string $source_dir_path="", string $target_dir_path="")
importFileFromUploadResult(UploadResult $result, ResourceStakeholder $stakeholder)
getStreamOfContainerEntry(string $rid, string $entry)
getContainerEntriesOfPath(string $container_id, string $dir_path)
importFileFromUploadResultToContainer(string $rid, UploadResult $result, string $target_path)
The base interface for all filesystem streams.
Definition: FileStream.php:31
importFileFromLegacyUploadToContainer(string $rid, string $tmp_name, string $target_path)
renameCurrentRevision(string $rid, string $title)
ILIAS ResourceStorage Services $irss
Definition: IRSSWrapper.php:46
createContainerFromLocalDir(string $local_dir_path, ResourceStakeholder $stakeholder, string $container_path="", bool $recursive=true, string $title="container.zip")