ILIAS
release_10 Revision v10.1-43-ga1241a92c2f
◀ ilDoc Overview
ShortFilePayload.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\FileDelivery\Token\Signer\Payload
;
22
23
use
ILIAS\FileDelivery\Setup\BaseDirObjective
;
24
28
class
ShortFilePayload
extends
StructuredPayload
29
{
30
protected
string
$mime_type
=
''
;
31
protected
string
$disposition
=
''
;
32
protected
int
$user_id
= 0;
33
34
public
function
__construct
(
35
private
string
$uri,
36
private
string
$file_name
37
) {
38
// try to shorten uri
39
$base =
BaseDirObjective::get
();
40
if
($base !== null) {
41
$uri = str_replace($base,
''
, $uri);
42
}
43
44
parent::__construct
([
45
'p'
=> $uri,
46
'n'
=> $file_name,
47
'd'
=> filemtime($this->uri)
48
]);
49
}
50
51
public
static
function
fromArray
(array $raw_payload): self
52
{
53
return
new
self
(
54
$raw_payload[
'p'
],
55
$raw_payload[
'n'
],
56
$raw_payload[
'd'
]
57
);
58
}
59
60
public
function
getUri
(): string
61
{
62
$uri = $this->uri;
63
// try to expand uri
64
$base =
BaseDirObjective::get
();
65
if
($base !== null) {
66
return
$base . $uri;
67
}
68
69
return
$uri;
70
}
71
72
public
function
getMimeType
(): string
73
{
74
return
$this->mime_type
;
75
}
76
77
public
function
getFileName
(): string
78
{
79
return
$this->file_name;
80
}
81
82
public
function
getDisposition
(): string
83
{
84
return
$this->disposition
;
85
}
86
87
public
function
getUserId
():
int
88
{
89
return
$this->user_id
;
90
}
91
}
ILIAS\FileDelivery\Token\Signer\Payload\ShortFilePayload\getMimeType
getMimeType()
Definition:
ShortFilePayload.php:72
ILIAS\FileDelivery\Token\Signer\Payload\StructuredPayload
Definition:
StructuredPayload.php:26
ILIAS\FileDelivery\Token\Signer\Payload\ShortFilePayload
Definition:
ShortFilePayload.php:28
ILIAS\FileDelivery\Token\Signer\Payload\ShortFilePayload\getFileName
getFileName()
Definition:
ShortFilePayload.php:77
ILIAS\FileDelivery\Token\Signer\Payload\ShortFilePayload\$mime_type
string $mime_type
Definition:
ShortFilePayload.php:30
ILIAS\FileDelivery\Token\Signer\Payload
Definition:
BadPayload.php:21
ILIAS\FileDelivery\Token\Signer\Payload\ShortFilePayload\getDisposition
getDisposition()
Definition:
ShortFilePayload.php:82
ILIAS\FileDelivery\Token\Signer\Payload\ShortFilePayload\fromArray
static fromArray(array $raw_payload)
Definition:
ShortFilePayload.php:51
ILIAS\FileDelivery\Token\Signer\Payload\ShortFilePayload\$user_id
int $user_id
Definition:
ShortFilePayload.php:32
ILIAS\FileDelivery\Token\Signer\Payload\ShortFilePayload\getUri
getUri()
Definition:
ShortFilePayload.php:60
ILIAS\GlobalScreen\Provider\__construct
__construct(Container $dic, ilPlugin $plugin)
Definition:
PluginProviderHelper.php:37
ILIAS\FileDelivery\Setup\BaseDirObjective\get
static get()
Definition:
BaseDirObjective.php:70
ILIAS\FileDelivery\Token\Signer\Payload\ShortFilePayload\$disposition
string $disposition
Definition:
ShortFilePayload.php:31
ILIAS\FileDelivery\Token\Signer\Payload\ShortFilePayload\__construct
__construct(private string $uri, private string $file_name)
Definition:
ShortFilePayload.php:34
ILIAS\FileDelivery\Token\Signer\Payload\ShortFilePayload\getUserId
getUserId()
Definition:
ShortFilePayload.php:87
ILIAS\Repository\int
int(string $key)
Definition:
trait.BaseGUIRequest.php:61
BaseDirObjective
components
ILIAS
FileDelivery
src
Token
Signer
Payload
ShortFilePayload.php
Generated on Wed Sep 10 2025 15:15:37 for ILIAS by
1.8.13 (using
Doxyfile
)