ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
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 39 of file class.ilCloudUtil.php.

References normalizePath().

Referenced by ilCloudFileTree\addFolderToService().

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

References $path, and normalizePath().

53  {
54  $path = ilCloudUtil::normalizePath(str_replace('//', '/', $path1 . $path2));
55  if($path == "/")
56  {
57  return $path;
58  }
59  else
60  {
61  return "/".ltrim($path,"/")."/";
62  }
63  }
$path
Definition: index.php:22
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\addNode(), ilCloudFileTree\createNode(), joinPaths(), joinPathsAbsolute(), ilCloudFileNode\setPath(), ilObjCloud\setRootFolder(), ilCloudFileTree\setRootPath(), and ilCloudPluginSettingsGUI\updateSettings().

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

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