2declare(strict_types=1);
40 $web, $webRelativeWithLeadingDot, $webRelativeWithoutLeadingDot, $storage, $customizing, $customizingRelativeWithLeadingDot, $libs, $libsRelativeWithLeadingDot, $temp
64 throw new \InvalidArgumentException(
"Invalid path supplied. Path must start with the web, storage, temp, customizing or libs storage location. Path given: '{$absolute_path}'");
84 $web, $webRelativeWithLeadingDot, $webRelativeWithoutLeadingDot, $storage, $customizing, $customizingRelativeWithLeadingDot, $libs, $libsRelativeWithLeadingDot, $temp
116 throw new \InvalidArgumentException(
"Invalid path supplied. Path must start with the web, storage, temp, customizing or libs storage location. Path given: '{$absolute_path}'");
123 $real_possible_path = realpath($possible_path);
126 case $possible_path === $absolute_path:
127 case $real_possible_path === $absolute_path:
129 case strpos($absolute_path, $possible_path) === 0:
130 return substr($absolute_path, strlen($possible_path) + 1);
131 case strpos($absolute_path, $real_possible_path) === 0:
132 return substr($absolute_path, strlen($real_possible_path) + 1);
134 throw new \InvalidArgumentException(
"Invalid path supplied. Path must start with the web, storage, temp, customizing or libs storage location. Path given: '{$absolute_path}'");
147 $real_possible_path = realpath($possible_path);
150 case $possible_path === $absolute_path:
152 case $real_possible_path === $absolute_path:
154 case is_string($possible_path) && strpos($absolute_path, $possible_path) === 0:
156 case is_string($real_possible_path) && strpos($absolute_path, $real_possible_path) === 0:
169 $web = CLIENT_WEB_DIR;
170 $webRelativeWithLeadingDot =
'./' . ILIAS_WEB_DIR .
'/' . CLIENT_ID;
171 $webRelativeWithoutLeadingDot = ILIAS_WEB_DIR .
'/' . CLIENT_ID;
172 $storage = CLIENT_DATA_DIR;
173 $customizing = ILIAS_ABSOLUTE_PATH .
'/Customizing';
174 $customizingRelativeWithLeadingDot =
'./Customizing';
175 $libs = ILIAS_ABSOLUTE_PATH .
'/libs';
176 $libsRelativeWithLeadingDot =
"./libs";
177 $temp = CLIENT_DATA_DIR .
"/temp";
179 return array($web, $webRelativeWithLeadingDot, $webRelativeWithoutLeadingDot, $storage, $customizing, $customizingRelativeWithLeadingDot, $libs, $libsRelativeWithLeadingDot, $temp);
An exception for terminatinating execution or to throw for unit testing.
static createRelativePath(string $absolute_path)
Creates a relative path from an absolute path which starts with a valid storage location.
static deriveFilesystemFrom(string $absolute_path)
Tries to fetch the filesystem responsible for the absolute path.
static checkPossiblePath(string $possible_path, string $absolute_path)
static resolveRelativePath(string $possible_path, string $absolute_path)
Class FlySystemFileAccessTest.
trait FilesystemsAware
Trait FilesystemsAware.
static filesystems()
Returns the loaded filesystems.