ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
ILIAS\WebDAV\Mount\UriBuilder Class Reference
+ Collaboration diagram for ILIAS\WebDAV\Mount\UriBuilder:

Public Member Functions

 __construct (private ServerRequestInterface $request, private Config $config)
 
 getWebDavDefaultUri (int $ref_id)
 
 getWebDavKonquerorUri (int $ref_id)
 
 getWebDavNautilusUri (int $ref_id)
 
 getUriToMountInstructionModalByRef (int $ref_id)
 
 getUriToMountInstructionModalByLanguage (string $language)
 

Private Member Functions

 uri ()
 
 host ()
 
 basePath ()
 
 resolveBasePath (string $original_path)
 
 getWebDavPathToRef (int $ref_id)
 
 getWebDavBasePath ()
 
 buildSchemedUri (string $placeholder, string $path)
 

Private Attributes

const array SCHEMAS
 
UriInterface $uri = null
 
string $host = null
 
string $base_path = null
 

Detailed Description

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

Definition at line 30 of file UriBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\WebDAV\Mount\UriBuilder::__construct ( private ServerRequestInterface  $request,
private Config  $config 
)

Definition at line 45 of file UriBuilder.php.

48 {
49 }

Member Function Documentation

◆ basePath()

ILIAS\WebDAV\Mount\UriBuilder::basePath ( )
private

Definition at line 69 of file UriBuilder.php.

69 : string
70 {
71 return $this->base_path ??= $this->resolveBasePath($this->uri()->getPath());
72 }
resolveBasePath(string $original_path)
Definition: UriBuilder.php:74

References ILIAS\WebDAV\Mount\UriBuilder\resolveBasePath(), and ILIAS\WebDAV\Mount\UriBuilder\uri().

Referenced by ILIAS\WebDAV\Mount\UriBuilder\getWebDavBasePath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildSchemedUri()

ILIAS\WebDAV\Mount\UriBuilder::buildSchemedUri ( string  $placeholder,
string  $path 
)
private

Definition at line 132 of file UriBuilder.php.

132 : string
133 {
134 $scheme = self::SCHEMAS[$placeholder];
135 if ($this->uri()->getScheme() === 'https') {
136 $scheme .= 's';
137 }
138 return $scheme . '://' . $this->host() . $path;
139 }
$path
Definition: ltiservices.php:30

References $path, ILIAS\WebDAV\Mount\UriBuilder\host(), and ILIAS\WebDAV\Mount\UriBuilder\uri().

Referenced by ILIAS\WebDAV\Mount\UriBuilder\getWebDavDefaultUri(), ILIAS\WebDAV\Mount\UriBuilder\getWebDavKonquerorUri(), and ILIAS\WebDAV\Mount\UriBuilder\getWebDavNautilusUri().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUriToMountInstructionModalByLanguage()

ILIAS\WebDAV\Mount\UriBuilder::getUriToMountInstructionModalByLanguage ( string  $language)

Definition at line 114 of file UriBuilder.php.

114 : string
115 {
116 return $this->getWebDavBasePath() . '/' . $language . '?' . $this->config->getMountInstructionsQuery();
117 }

References ILIAS\WebDAV\Mount\UriBuilder\getWebDavBasePath().

+ Here is the call graph for this function:

◆ getUriToMountInstructionModalByRef()

ILIAS\WebDAV\Mount\UriBuilder::getUriToMountInstructionModalByRef ( int  $ref_id)

Definition at line 109 of file UriBuilder.php.

109 : string
110 {
111 return $this->getWebDavPathToRef($ref_id) . '?' . $this->config->getMountInstructionsQuery();
112 }
$ref_id
Definition: ltiauth.php:66

References ILIAS\WebDAV\Mount\UriBuilder\getWebDavPathToRef().

+ Here is the call graph for this function:

◆ getWebDavBasePath()

ILIAS\WebDAV\Mount\UriBuilder::getWebDavBasePath ( )
private

Definition at line 124 of file UriBuilder.php.

124 : string
125 {
126 if ($this->config->prependClientName() && $this->config->getClientId() !== '') {
127 return $this->basePath() . '/' . $this->config->getClientId();
128 }
129 return $this->basePath();
130 }

References ILIAS\WebDAV\Mount\UriBuilder\basePath().

Referenced by ILIAS\WebDAV\Mount\UriBuilder\getUriToMountInstructionModalByLanguage(), and ILIAS\WebDAV\Mount\UriBuilder\getWebDavPathToRef().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWebDavDefaultUri()

ILIAS\WebDAV\Mount\UriBuilder::getWebDavDefaultUri ( int  $ref_id)

Definition at line 94 of file UriBuilder.php.

94 : string
95 {
96 return $this->buildSchemedUri('default', $this->getWebDavPathToRef($ref_id));
97 }
buildSchemedUri(string $placeholder, string $path)
Definition: UriBuilder.php:132

References ILIAS\WebDAV\Mount\UriBuilder\buildSchemedUri(), and ILIAS\WebDAV\Mount\UriBuilder\getWebDavPathToRef().

+ Here is the call graph for this function:

◆ getWebDavKonquerorUri()

ILIAS\WebDAV\Mount\UriBuilder::getWebDavKonquerorUri ( int  $ref_id)

Definition at line 99 of file UriBuilder.php.

99 : string
100 {
101 return $this->buildSchemedUri('konqueror', $this->getWebDavPathToRef($ref_id));
102 }

References ILIAS\WebDAV\Mount\UriBuilder\buildSchemedUri(), and ILIAS\WebDAV\Mount\UriBuilder\getWebDavPathToRef().

+ Here is the call graph for this function:

◆ getWebDavNautilusUri()

ILIAS\WebDAV\Mount\UriBuilder::getWebDavNautilusUri ( int  $ref_id)

Definition at line 104 of file UriBuilder.php.

104 : string
105 {
106 return $this->buildSchemedUri('nautilus', $this->getWebDavPathToRef($ref_id));
107 }

References ILIAS\WebDAV\Mount\UriBuilder\buildSchemedUri(), and ILIAS\WebDAV\Mount\UriBuilder\getWebDavPathToRef().

+ Here is the call graph for this function:

◆ getWebDavPathToRef()

ILIAS\WebDAV\Mount\UriBuilder::getWebDavPathToRef ( int  $ref_id)
private

Definition at line 119 of file UriBuilder.php.

119 : string
120 {
121 return $this->getWebDavBasePath() . '/ref_' . $ref_id;
122 }

References $ref_id, and ILIAS\WebDAV\Mount\UriBuilder\getWebDavBasePath().

Referenced by ILIAS\WebDAV\Mount\UriBuilder\getUriToMountInstructionModalByRef(), ILIAS\WebDAV\Mount\UriBuilder\getWebDavDefaultUri(), ILIAS\WebDAV\Mount\UriBuilder\getWebDavKonquerorUri(), and ILIAS\WebDAV\Mount\UriBuilder\getWebDavNautilusUri().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ host()

ILIAS\WebDAV\Mount\UriBuilder::host ( )
private

Definition at line 56 of file UriBuilder.php.

56 : string
57 {
58 if ($this->host !== null) {
59 return $this->host;
60 }
61 $host = $this->uri()->getHost();
62 $port = $this->uri()->getPort();
63 if ($port !== null && !in_array($port, [80, 443], true)) {
64 $host .= ':' . $port;
65 }
66 return $this->host = $host;
67 }

References ILIAS\WebDAV\Mount\UriBuilder\$host, ILIAS\WebDAV\Mount\UriBuilder\host(), and ILIAS\WebDAV\Mount\UriBuilder\uri().

Referenced by ILIAS\WebDAV\Mount\UriBuilder\buildSchemedUri(), and ILIAS\WebDAV\Mount\UriBuilder\host().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resolveBasePath()

ILIAS\WebDAV\Mount\UriBuilder::resolveBasePath ( string  $original_path)
private

Definition at line 74 of file UriBuilder.php.

74 : string
75 {
76 $endpoint = $this->config->getEndpoint();
77 $segments = explode('/', $original_path);
78
79 if (in_array($endpoint, $segments, true)) {
80 $kept = [];
81 foreach ($segments as $segment) {
82 $kept[] = $segment;
83 if ($segment === $endpoint) {
84 break;
85 }
86 }
87 return implode('/', $kept);
88 }
89
90 $kept = array_slice($segments, 0, -1);
91 return implode('/', $kept) . '/' . $endpoint;
92 }

Referenced by ILIAS\WebDAV\Mount\UriBuilder\basePath().

+ Here is the caller graph for this function:

◆ uri()

ILIAS\WebDAV\Mount\UriBuilder::uri ( )
private

Definition at line 51 of file UriBuilder.php.

51 : UriInterface
52 {
53 return $this->uri ??= $this->request->getUri();
54 }

References ILIAS\WebDAV\Mount\UriBuilder\uri().

Referenced by ILIAS\WebDAV\Mount\UriBuilder\basePath(), ILIAS\WebDAV\Mount\UriBuilder\buildSchemedUri(), ILIAS\WebDAV\Mount\UriBuilder\host(), and ILIAS\WebDAV\Mount\UriBuilder\uri().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $base_path

string ILIAS\WebDAV\Mount\UriBuilder::$base_path = null
private

Definition at line 43 of file UriBuilder.php.

◆ $host

string ILIAS\WebDAV\Mount\UriBuilder::$host = null
private

Definition at line 42 of file UriBuilder.php.

Referenced by ILIAS\WebDAV\Mount\UriBuilder\host().

◆ $uri

UriInterface ILIAS\WebDAV\Mount\UriBuilder::$uri = null
private

Definition at line 41 of file UriBuilder.php.

◆ SCHEMAS

const array ILIAS\WebDAV\Mount\UriBuilder::SCHEMAS
private
Initial value:
= [
'default' => 'http',
'konqueror' => 'webdav',
'nautilus' => 'dav',
]

Definition at line 35 of file UriBuilder.php.


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