ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 40 of file class.ilCloudUtil.php.

References normalizePath().

Referenced by ilCloudFileTree\addFolderToService().

41  {
42  $path1 = ilCloudUtil::normalizePath($path1);
43  $path2 = ilCloudUtil::normalizePath($path2);
44 
45  return ilCloudUtil::normalizePath(str_replace('//', '/', $path1 . $path2));
46  }
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 57 of file class.ilCloudUtil.php.

References normalizePath().

58  {
59  $path = ilCloudUtil::normalizePath(str_replace('//', '/', $path1 . $path2));
60  if ($path == "/") {
61  return $path;
62  } else {
63  return "/" . ltrim($path, "/") . "/";
64  }
65  }
static normalizePath($path)
+ Here is the call graph for this function:

◆ normalizePath()

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

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

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

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

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