ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilWebDAVUriBuilder Class Reference
+ Collaboration diagram for ilWebDAVUriBuilder:

Public Member Functions

 __construct (\Psr\Http\Message\RequestInterface $a_request)
 
 getWebDavDefaultUri (int $a_ref_id)
 
 getWebDavNautilusUri (int $a_ref_id)
 
 getWebDavKonquerorUri (int $a_ref_id)
 
 getUriToMountInstructionModalByRef (int $a_ref_id)
 
 getUriToMountInstructionModalByLanguage (string $language)
 

Protected Member Functions

 changePathToWebDavScript (string $a_original_path)
 
 getWebDavPathToRef (int $a_ref_id)
 
 getWebDavPathToLanguageTemplate (string $language)
 
 getWebDavUriByPlaceholderName (string $placeholder_name, int $a_ref_id)
 

Protected Attributes

 $request
 
 $schemas
 
 $mount_instructions_query = 'mount-instructions'
 
 $webdav_script_name = 'webdav.php'
 

Detailed Description

Definition at line 4 of file class.ilWebDAVUriBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

ilWebDAVUriBuilder::__construct ( \Psr\Http\Message\RequestInterface  $a_request)

Definition at line 20 of file class.ilWebDAVUriBuilder.php.

21 {
22 $this->request = $a_request;
23
24 $this->uri = $a_request->getUri();
25 $this->host = $this->uri->getHost();
26
27 $this->client_id = CLIENT_ID;
28 $this->web_path_to_script = $this->changePathToWebDavScript($this->uri->getPath());
29 }
changePathToWebDavScript(string $a_original_path)

References changePathToWebDavScript().

+ Here is the call graph for this function:

Member Function Documentation

◆ changePathToWebDavScript()

ilWebDAVUriBuilder::changePathToWebDavScript ( string  $a_original_path)
protected
Parameters
string$a_original_path
Returns
string

Definition at line 37 of file class.ilWebDAVUriBuilder.php.

38 {
39 $exploded_path = explode('/', $a_original_path);
40
41 if (in_array($this->webdav_script_name, $exploded_path)) {
42 return implode('/', array_splice($exploded_path, 0, -2));
43 }
44
45 return implode('/', array_splice($exploded_path, 0, -1)) . '/' . $this->webdav_script_name;
46 }

References $webdav_script_name.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ getUriToMountInstructionModalByLanguage()

ilWebDAVUriBuilder::getUriToMountInstructionModalByLanguage ( string  $language)
Parameters
string$language
Returns
string

Definition at line 120 of file class.ilWebDAVUriBuilder.php.

121 {
123 }
getWebDavPathToLanguageTemplate(string $language)

References $mount_instructions_query, and getWebDavPathToLanguageTemplate().

+ Here is the call graph for this function:

◆ getUriToMountInstructionModalByRef()

ilWebDAVUriBuilder::getUriToMountInstructionModalByRef ( int  $a_ref_id)
Parameters
int$a_ref_id
Returns
string

Definition at line 111 of file class.ilWebDAVUriBuilder.php.

112 {
113 return $this->getWebDavPathToRef($a_ref_id) . '?' . $this->mount_instructions_query;
114 }

References $mount_instructions_query, and getWebDavPathToRef().

+ Here is the call graph for this function:

◆ getWebDavDefaultUri()

ilWebDAVUriBuilder::getWebDavDefaultUri ( int  $a_ref_id)
Parameters
int$a_ref_id
Returns
string

Definition at line 84 of file class.ilWebDAVUriBuilder.php.

85 {
86 return $this->getWebDavUriByPlaceholderName('default', $a_ref_id);
87 }
getWebDavUriByPlaceholderName(string $placeholder_name, int $a_ref_id)

References getWebDavUriByPlaceholderName().

+ Here is the call graph for this function:

◆ getWebDavKonquerorUri()

ilWebDAVUriBuilder::getWebDavKonquerorUri ( int  $a_ref_id)
Parameters
int$a_ref_id
Returns
string

Definition at line 102 of file class.ilWebDAVUriBuilder.php.

103 {
104 return $this->getWebDavUriByPlaceholderName('konqueror', $a_ref_id);
105 }

References getWebDavUriByPlaceholderName().

+ Here is the call graph for this function:

◆ getWebDavNautilusUri()

ilWebDAVUriBuilder::getWebDavNautilusUri ( int  $a_ref_id)
Parameters
int$a_ref_id
Returns
string

Definition at line 93 of file class.ilWebDAVUriBuilder.php.

94 {
95 return $this->getWebDavUriByPlaceholderName('nautilus', $a_ref_id);
96 }

References getWebDavUriByPlaceholderName().

+ Here is the call graph for this function:

◆ getWebDavPathToLanguageTemplate()

ilWebDAVUriBuilder::getWebDavPathToLanguageTemplate ( string  $language)
protected
Parameters
string$language
Returns
string

Definition at line 61 of file class.ilWebDAVUriBuilder.php.

62 {
63 return "$this->web_path_to_script/$this->client_id/$language";
64 }

Referenced by getUriToMountInstructionModalByLanguage().

+ Here is the caller graph for this function:

◆ getWebDavPathToRef()

ilWebDAVUriBuilder::getWebDavPathToRef ( int  $a_ref_id)
protected
Parameters
int$a_ref_id
Returns
string

Definition at line 52 of file class.ilWebDAVUriBuilder.php.

53 {
54 return "$this->web_path_to_script/$this->client_id/ref_$a_ref_id";
55 }

Referenced by getUriToMountInstructionModalByRef(), and getWebDavUriByPlaceholderName().

+ Here is the caller graph for this function:

◆ getWebDavUriByPlaceholderName()

ilWebDAVUriBuilder::getWebDavUriByPlaceholderName ( string  $placeholder_name,
int  $a_ref_id 
)
protected
Parameters
string$placeholder_name
int$a_ref_id
Returns
string

Definition at line 71 of file class.ilWebDAVUriBuilder.php.

72 {
73 $scheme = $this->schemas[$placeholder_name];
74 if ($this->uri->getScheme() == 'https') {
75 $scheme .= 's';
76 }
77 return $scheme . '://' . $this->host . $this->getWebDavPathToRef($a_ref_id);
78 }

References getWebDavPathToRef().

Referenced by getWebDavDefaultUri(), getWebDavKonquerorUri(), and getWebDavNautilusUri().

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

Field Documentation

◆ $mount_instructions_query

ilWebDAVUriBuilder::$mount_instructions_query = 'mount-instructions'
protected

◆ $request

ilWebDAVUriBuilder::$request
protected

Definition at line 7 of file class.ilWebDAVUriBuilder.php.

◆ $schemas

ilWebDAVUriBuilder::$schemas
protected
Initial value:
= array(
'default' => 'http',
'konqueror' => 'webdav',
'nautilus' => 'dav'
)

Definition at line 10 of file class.ilWebDAVUriBuilder.php.

◆ $webdav_script_name

ilWebDAVUriBuilder::$webdav_script_name = 'webdav.php'
protected

Definition at line 18 of file class.ilWebDAVUriBuilder.php.

Referenced by changePathToWebDavScript().


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