Class ilWebDAVTree.
More...
Class ilWebDAVTree.
This class is used for manual tree traversal from a WebDAV-Request if it isn't handled by Sabre
Mostly used for lock and unlock calls. Might be refactored to be a substitute for Sabre in a future version.
- Author
- Raphael Heer rapha.nosp@m.el.h.nosp@m.eer@h.nosp@m.slu..nosp@m.ch $Id$
Definition at line 17 of file class.ilWebDAVTree.php.
◆ getInstance()
static ilWebDAVTree::getInstance |
( |
| ) |
|
|
static |
Definition at line 21 of file class.ilWebDAVTree.php.
23 if (!isset(self::$instance)) {
24 self::$instance =
new self();
26 return self::$instance;
◆ getRefIdForGivenRootAndPath()
static ilWebDAVTree::getRefIdForGivenRootAndPath |
( |
int |
$start_ref, |
|
|
string |
$path_from_startnode |
|
) |
| |
|
static |
- Parameters
-
int | $start_ref | |
string | $path_from_startnode | |
- Returns
- int
Definition at line 98 of file class.ilWebDAVTree.php.
100 return self::iterateRecursiveThroughTree(explode(
'/', $path_from_startnode), 0, $start_ref);
◆ getRefIdForWebDAVPath()
static ilWebDAVTree::getRefIdForWebDAVPath |
( |
|
$a_uri | ) |
|
|
static |
Returns the ref_id of the given webdav path.
Path starts without php-script
Examples
Path starts at a ref: <client_name>/ref_<ref_id>/folder1/folder2 Path starts at root: <client_name>/ILIAS/foo_container1/course1/
- Parameters
-
- Returns
- int|mixed
- Exceptions
-
Definition at line 42 of file class.ilWebDAVTree.php.
44 $a_uri = strtolower(trim($a_uri,
'/'));
51 $splitted_path = explode(
'/', $a_uri, 3);
54 if (count($splitted_path) < 2) {
58 $repository_mountpoint = $splitted_path[1];
59 $path_in_mountpoint = $splitted_path[2];
63 if ($repository_mountpoint ==
'ilias') {
64 if ($path_in_mountpoint !=
'') {
65 $ref_path = self::getRefIdForGivenRootAndPath(ROOT_FOLDER_ID, $path_in_mountpoint);
66 $searched_node = $ref_path[count($ref_path) - 1];
67 $ref_id = $searched_node[
'child'];
69 $ref_id = ROOT_FOLDER_ID;
73 elseif (substr($splitted_path[1], 0, 4) ==
'ref_') {
76 $start_node = (int) explode(
'_', $repository_mountpoint)[1];
77 if ($path_in_mountpoint !=
'' && $start_node > 0) {
78 $ref_id = self::getRefIdForGivenRootAndPath($start_node, $path_in_mountpoint);
79 } elseif ($path_in_mountpoint ==
'') {
80 $ref_id = $start_node;
◆ iterateRecursiveThroughTree()
static ilWebDAVTree::iterateRecursiveThroughTree |
( |
|
$path_title_array, |
|
|
|
$searched_element_index, |
|
|
|
$parent_ref_id |
|
) |
| |
|
staticprotected |
Recursive function to iterate through tree with given path.
- Parameters
-
$path_title_array | Array with all object titles in this path |
$searched_element_index | Index for the path_title_array which points to the searched obj title |
$parent_ref_id | Ref ID of parent of the searched element |
- Returns
- int
Definition at line 111 of file class.ilWebDAVTree.php.
References $DIC, ilObject\_lookupObjectId(), and ilObject\_lookupTitle().
116 if ($path_title_array[$searched_element_index] ==
'' || count($path_title_array) == $searched_element_index) {
117 return $parent_ref_id;
121 foreach ($DIC->repositoryTree()->getChildIds($parent_ref_id) as $child_ref) {
124 if ($path_title_array[$searched_element_index] == $child_title) {
125 if (count($path_title_array) - 1 == $searched_element_index) {
130 return self::iterateRecursiveThroughTree($path_title_array, $searched_element_index + 1, $child_ref);
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
◆ $instance
The documentation for this class was generated from the following file: