39 $web, $webRelativeWithLeadingDot, $webRelativeWithoutLeadingDot, $storage, $customizing, $customizingRelativeWithLeadingDot, $libs, $libsRelativeWithLeadingDot, $temp
44 case self::checkPossiblePath($temp, $absolute_path):
46 case self::checkPossiblePath($web, $absolute_path):
48 case self::checkPossiblePath($webRelativeWithLeadingDot, $absolute_path):
50 case self::checkPossiblePath($webRelativeWithoutLeadingDot, $absolute_path):
52 case self::checkPossiblePath($storage, $absolute_path):
54 case self::checkPossiblePath($customizing, $absolute_path):
56 case self::checkPossiblePath($customizingRelativeWithLeadingDot, $absolute_path):
58 case self::checkPossiblePath($libs, $absolute_path):
60 case self::checkPossiblePath($libsRelativeWithLeadingDot, $absolute_path):
63 throw new \InvalidArgumentException(
"Invalid path supplied. Path must start with the web, storage, temp, customizing or libs storage location. Path given: '{$absolute_path}'");
83 $web, $webRelativeWithLeadingDot, $webRelativeWithoutLeadingDot, $storage, $customizing, $customizingRelativeWithLeadingDot, $libs, $libsRelativeWithLeadingDot, $temp
89 case self::checkPossiblePath($webRelativeWithoutLeadingDot, $absolute_path):
90 return self::resolveRelativePath($webRelativeWithoutLeadingDot, $absolute_path);
92 case self::checkPossiblePath($webRelativeWithLeadingDot, $absolute_path):
93 return self::resolveRelativePath($webRelativeWithLeadingDot, $absolute_path);
95 case self::checkPossiblePath($web, $absolute_path):
96 return self::resolveRelativePath($web, $absolute_path);
98 case self::checkPossiblePath($temp, $absolute_path):
99 return self::resolveRelativePath($temp, $absolute_path);
101 case self::checkPossiblePath($storage, $absolute_path):
102 return self::resolveRelativePath($storage, $absolute_path);
104 case self::checkPossiblePath($customizing, $absolute_path):
105 return self::resolveRelativePath($customizing, $absolute_path);
107 case self::checkPossiblePath($customizingRelativeWithLeadingDot, $absolute_path):
108 return self::resolveRelativePath($customizingRelativeWithLeadingDot, $absolute_path);
110 case self::checkPossiblePath($libs, $absolute_path):
112 case self::checkPossiblePath($libsRelativeWithLeadingDot, $absolute_path):
113 return self::resolveRelativePath($libsRelativeWithLeadingDot, $absolute_path);
115 throw new \InvalidArgumentException(
"Invalid path supplied. Path must start with the web, storage, temp, customizing or libs storage location. Path given: '{$absolute_path}'");
122 $real_possible_path = realpath($possible_path);
125 case $possible_path === $absolute_path:
126 case $real_possible_path === $absolute_path:
128 case strpos($absolute_path, $possible_path) === 0:
129 return substr($absolute_path, strlen($possible_path) + 1);
130 case strpos($absolute_path, $real_possible_path) === 0:
131 return substr($absolute_path, strlen($real_possible_path) + 1);
133 throw new \InvalidArgumentException(
"Invalid path supplied. Path must start with the web, storage, temp, customizing or libs storage location. Path given: '{$absolute_path}'");
146 $real_possible_path = realpath($possible_path);
149 case $possible_path === $absolute_path:
151 case $real_possible_path === $absolute_path:
153 case strpos($absolute_path, $possible_path) === 0:
155 case strpos($absolute_path, $real_possible_path) === 0:
168 $web = CLIENT_WEB_DIR;
169 $webRelativeWithLeadingDot =
'./' . ILIAS_WEB_DIR .
'/' . CLIENT_ID;
170 $webRelativeWithoutLeadingDot = ILIAS_WEB_DIR .
'/' . CLIENT_ID;
171 $storage = CLIENT_DATA_DIR;
172 $customizing = ILIAS_ABSOLUTE_PATH .
'/Customizing';
173 $customizingRelativeWithLeadingDot =
'./Customizing';
174 $libs = ILIAS_ABSOLUTE_PATH .
'/libs';
175 $libsRelativeWithLeadingDot =
"./libs";
176 $temp = CLIENT_DATA_DIR .
"/temp";
178 return array($web, $webRelativeWithLeadingDot, $webRelativeWithoutLeadingDot, $storage, $customizing, $customizingRelativeWithLeadingDot, $libs, $libsRelativeWithLeadingDot, $temp);
static resolveRelativePath($possible_path, $absolute_path)
static createRelativePath($absolute_path)
Creates a relative path from an absolute path which starts with a valid storage location.
trait FilesystemsAware
Trait FilesystemsAware.
static filesystems()
Returns the loaded filesystems.
static deriveFilesystemFrom($absolute_path)
Tries to fetch the filesystem responsible for the absolute path.
Create styles array
The data for the language used.
static checkPossiblePath($possible_path, $absolute_path)