ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ContainerURIConsumer.php
Go to the documentation of this file.
1<?php
2
20
26
31{
32 use GetRevisionTrait;
33
35 protected ?int $revision_number = null;
36
40 public function __construct(
41 private SrcBuilder $src_builder,
42 private StorableResource $resource,
43 private StreamAccess $stream_access,
44 private string $start_file,
45 private float $valid_for_at_least_minutes = 60.0
46 ) {
47 global $DIC;
48 $this->archives = $DIC->archives();
49 }
50
51 public function getURI(): ?URI
52 {
53 $filename = basename($this->start_file);
54 if ($filename === '') {
55 $filename = null;
56 }
57
58 $startfile = urlencode($this->start_file); // e.g. for files with " " (spaces)
59 $startfile = str_replace(urlencode("/"), "/", $startfile); // we must keep directory sepparators
60
61 $uri_string = $this->src_builder->getRevisionURL(
62 $this->stream_access->populateRevision($this->getRevision()),
63 true,
64 $this->valid_for_at_least_minutes,
67
68 try {
69 return new URI($uri_string);
70 } catch (\Throwable) {
71 return null;
72 }
73 }
74}
$filename
Definition: buildRTE.php:78
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:35
__construct(private SrcBuilder $src_builder, private StorableResource $resource, private StreamAccess $stream_access, private string $start_file, private float $valid_for_at_least_minutes=60.0)
DownloadConsumer constructor.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:26