ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ILIAS\FileDelivery\Services Class Reference
+ Collaboration diagram for ILIAS\FileDelivery\Services:

Public Member Functions

 __construct (private \ILIAS\FileDelivery\Delivery\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 32 of file Services.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 38 of file Services.php.

43  {
44  }

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 56 of file Services.php.

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

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

◆ delivery()

ILIAS\FileDelivery\Services::delivery ( )

Definition at line 46 of file Services.php.

◆ getBaseURI()

ILIAS\FileDelivery\Services::getBaseURI ( )
protected

Definition at line 81 of file Services.php.

References ILIAS\FileDelivery\http().

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

81  : string
82  {
83  return $this->base_uri ?? $this->base_uri = rtrim(
84  $this->http->request()->getUri()->getScheme()
85  . '://' . $this->http->request()->getUri()->getHost()
86  . ($this->http->request()->getUri()->getPort() ? ':' . $this->http->request()->getUri()->getPort() : '')
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 51 of file Services.php.

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

Field Documentation

◆ $base_uri

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

Definition at line 36 of file Services.php.

◆ DELIVERY_ENDPOINT

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

Definition at line 34 of file Services.php.


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