ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
class.ilCloudUtil.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
15 {
20  public static function normalizePath($path)
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  }
33 
39  public static function joinPaths($path1,$path2)
40  {
41  $path1 = ilCloudUtil::normalizePath($path1);
42  $path2 = ilCloudUtil::normalizePath($path2);
43  return ilCloudUtil::normalizePath(str_replace('//','/',$path1.$path2));
44  }
45 
52  public static function joinPathsAbsolute($path1, $path2)
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  }
64 
65 }
66 
67 ?>
static joinPathsAbsolute($path1, $path2)
With trailing and leading slashes.
static joinPaths($path1, $path2)
$path
Definition: index.php:22
Class ilCloudUtil.
static normalizePath($path)