19declare(strict_types=1);
40 public const string SHORT =
'/go/';
41 public const string LONG =
'/goto.php/';
51 $ilObjDataCache =
$DIC[
"ilObjDataCache"];
53 if ($a_type ===
'' && $a_ref_id) {
54 $a_type = $ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($a_ref_id));
57 $a_params = array_merge($a_params, [$append]);
58 $a_params = array_filter($a_params,
static fn($value):
bool => $value !==
"");
60 if (!empty($a_type)) {
61 return (
string) $this->
build(
63 $a_ref_id !==
null ?
new ReferenceId($a_ref_id) :
null,
74 array $additional_parameters = []
76 $uri = $this->getBaseURI()
77 . $this->config->
get(
Config::STATIC_LINK_ENDPOINT)
78 . $this->buildTarget(
$namespace, $reference_id, $additional_parameters);
86 array $additional_parameters = []
89 . ($reference_id !== null ?
'/' . $reference_id->toInt() :
'')
91 . implode(
'/', $additional_parameters);
96 if ($this->cache !==
null) {
100 $base_path = $this->config->get(Config::BASE_URL);
102 $offset = match (
true) {
103 str_contains((
string) $base_path, self::SHORT) => strpos((
string) $base_path, self::SHORT),
104 str_contains((
string) $base_path, self::LONG) => strpos((
string) $base_path, rtrim(self::LONG,
'/')),
105 str_contains((
string) $base_path, rtrim(self::LONG,
'/')) => strpos((
string) $base_path, rtrim(self::LONG,
'/')),
106 str_contains((
string) $base_path,
'Customizing') => strpos((
string) $base_path,
'Customizing'),
107 str_contains((
string) $base_path,
'src') => strpos((
string) $base_path,
'src'),
108 str_contains((
string) $base_path,
'webservices') => strpos((
string) $base_path,
'webservices'),
112 if ($offset ===
false) {
113 return $this->cache =
new URI(trim((
string) $base_path,
'/'));
116 $uri_string = substr(
121 return $this->cache =
new URI(
122 trim($uri_string,
'/')
The scope of this class is split ilias-conform URI's into components.
buildTarget(string $namespace, ?ReferenceId $reference_id=null, array $additional_parameters=[])
build(string $namespace, ?ReferenceId $reference_id=null, array $additional_parameters=[])
buildLegacy(?int $a_ref_id, string $a_type='', array $a_params=[], string $append="")
__construct(private Configuration $config,)
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($err=$client->getError()) $namespace
A configuration for the setup.