ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilCloudUtil Class Reference

Class ilCloudUtil. More...

+ Collaboration diagram for ilCloudUtil:

Static Public Member Functions

static normalizePath ($path)
 
static joinPaths ($path1, $path2)
 
static joinPathsAbsolute ($path1, $path2)
 With trailing and leading slashes. More...
 

Detailed Description

Class ilCloudUtil.

Some utility function, mostly for path handling.

Author
Timon Amstutz timon.nosp@m..ams.nosp@m.tutz@.nosp@m.ilub.nosp@m..unib.nosp@m.e.ch
Version
$Id$

Definition at line 14 of file class.ilCloudUtil.php.

Member Function Documentation

◆ joinPaths()

static ilCloudUtil::joinPaths (   $path1,
  $path2 
)
static
Parameters
$path1
$path2
Returns
string

Definition at line 36 of file class.ilCloudUtil.php.

References normalizePath().

Referenced by ilCloudFileTree\addFolderToService().

37  {
38  $path1 = ilCloudUtil::normalizePath($path1);
39  $path2 = ilCloudUtil::normalizePath($path2);
40  return ilCloudUtil::normalizePath(str_replace('//', '/', $path1 . $path2));
41  }
static normalizePath($path)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ joinPathsAbsolute()

static ilCloudUtil::joinPathsAbsolute (   $path1,
  $path2 
)
static

With trailing and leading slashes.

Parameters
$path1
$path2
Returns
string

Definition at line 49 of file class.ilCloudUtil.php.

References $path, and normalizePath().

50  {
51  $path = ilCloudUtil::normalizePath(str_replace('//', '/', $path1 . $path2));
52  if ($path == "/") {
53  return $path;
54  } else {
55  return "/" . ltrim($path, "/") . "/";
56  }
57  }
$path
Definition: aliased.php:25
static normalizePath($path)
+ Here is the call graph for this function:

◆ normalizePath()

static ilCloudUtil::normalizePath (   $path)
static
Parameters
$path
Returns
string

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

References $path.

Referenced by ilCloudFileTree\addFolderToService(), ilCloudFileTree\addIdBasedNode(), ilCloudFileTree\addNode(), ilCloudFileTree\createNode(), joinPaths(), joinPathsAbsolute(), ilCloudFileNode\setPath(), ilObjCloud\setRootFolder(), ilCloudFileTree\setRootPath(), and ilCloudPluginSettingsGUI\updateSettings().

21  {
22  if ($path == "." || $path == "/" || $path == "") {
23  $path = "/";
24  } else {
25  $path = "/" . rtrim(ltrim(str_replace('//', '/', $path), "/"), "/");
26  }
27 
28  return $path;
29  }
$path
Definition: aliased.php:25
+ Here is the caller graph for this function:

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