ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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.

40 {
41 $path1 = ilCloudUtil::normalizePath($path1);
42 $path2 = ilCloudUtil::normalizePath($path2);
43 return ilCloudUtil::normalizePath(str_replace('//','/',$path1.$path2));
44 }
static normalizePath($path)

References normalizePath().

Referenced by ilCloudFileTree\addFolderToService().

+ 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.

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

References $path, and normalizePath().

+ 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.

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 }

References $path.

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

+ Here is the caller graph for this function:

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