ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\FileDelivery\Services Class Reference
+ Collaboration diagram for ILIAS\FileDelivery\Services:

Public Member Functions

 __construct (private StreamDelivery $delivery, private LegacyDelivery $legacy_delivery, private DataSigner $data_signer, private \ILIAS\HTTP\Services $http)
 
 delivery ()
 
 legacyDelivery ()
 
 buildTokenURL (FileStream $stream, string $filename, Disposition $disposition, int $user_id, int $valid_for_at_least_hours)
 

Data Fields

const DELIVERY_ENDPOINT = '/deliver.php/'
 

Protected Member Functions

 getBaseURI ()
 

Private Attributes

string $base_uri = null
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 33 of file Services.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\FileDelivery\Services::__construct ( private StreamDelivery  $delivery,
private LegacyDelivery  $legacy_delivery,
private DataSigner  $data_signer,
private \ILIAS\HTTP\Services  $http 
)

Definition at line 39 of file Services.php.

44  {
45  }

Member Function Documentation

◆ buildTokenURL()

ILIAS\FileDelivery\Services::buildTokenURL ( FileStream  $stream,
string  $filename,
Disposition  $disposition,
int  $user_id,
int  $valid_for_at_least_hours 
)

Definition at line 57 of file Services.php.

References $token, and ILIAS\FileDelivery\Services\getBaseURI().

63  : URI {
64  // a new DateTimeImmutable which is set to the end of now + $valid_for_at_least_hours hours
65  $valid_for_at_least_hours++;
66  $until = new \DateTimeImmutable(
67  (new \DateTimeImmutable("now +$valid_for_at_least_hours hours"))->format('Y-m-d H:00')
68  );
69 
70  $token = $this->data_signer->getSignedStreamToken(
71  $stream,
72  $filename,
73  $disposition,
74  $user_id,
75  $until
76  );
77  return new URI(
78  $this->getBaseURI() . self::DELIVERY_ENDPOINT . $token
79  );
80  }
$token
Definition: xapitoken.php:70
$filename
Definition: buildRTE.php:78
+ Here is the call graph for this function:

◆ delivery()

ILIAS\FileDelivery\Services::delivery ( )

Definition at line 47 of file Services.php.

47  : StreamDelivery
48  {
49  return $this->delivery;
50  }

◆ getBaseURI()

ILIAS\FileDelivery\Services::getBaseURI ( )
protected

Definition at line 82 of file Services.php.

References ILIAS\FileDelivery\http().

Referenced by ILIAS\FileDelivery\Services\buildTokenURL().

82  : string
83  {
84  return $this->base_uri ?? $this->base_uri = rtrim(
85  $this->http->request()->getUri()->getScheme()
86  . '://' . $this->http->request()->getUri()->getHost()
87  . dirname($this->http->request()->getUri()->getPath()),
88  "/"
89  );
90  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ legacyDelivery()

ILIAS\FileDelivery\Services::legacyDelivery ( )

Definition at line 52 of file Services.php.

52  : LegacyDelivery
53  {
54  return $this->legacy_delivery;
55  }

Field Documentation

◆ $base_uri

string ILIAS\FileDelivery\Services::$base_uri = null
private

Definition at line 37 of file Services.php.

◆ DELIVERY_ENDPOINT

const ILIAS\FileDelivery\Services::DELIVERY_ENDPOINT = '/deliver.php/'

Definition at line 35 of file Services.php.


The documentation for this class was generated from the following file: