19 declare(strict_types=1);
29 class Handler implements FileHandlerInterface
36 FileNamespaceFactoryInterface $namespace
38 $this->
namespace = $namespace;
39 $this->namespaces = $namespace->collection();
45 $clone->namespaces = $clone->namespaces->withElement($namespace_handler);
57 $clone->spl_file_info = $file_info;
63 return $this->spl_file_info->getFilename();
69 ? $this->spl_file_info->getRealPath()
70 : $this->spl_file_info->getPath() . DIRECTORY_SEPARATOR . $this->spl_file_info->getFilename();
77 for ($i = count(
$parts) - 1; $i >= 0; $i--) {
78 $trimmed_str = $i < count(
$parts) - 1
79 ?
$parts[$i] . DIRECTORY_SEPARATOR . $trimmed_str
81 if (
$parts[$i] === $dir_name) {
86 $clone->spl_file_info =
new SplFileInfo($trimmed_str);
94 for ($i = 0; $i < count(
$parts); $i++) {
95 $trimmed_str .= $i > 0
96 ? DIRECTORY_SEPARATOR .
$parts[$i]
98 if (
$parts[$i] === $dir_name) {
102 $clone = clone $this;
103 $clone->spl_file_info =
new SplFileInfo($trimmed_str);
109 return $this->spl_file_info->getPath();
114 return $this->spl_file_info->getRealPath() !==
false;
119 $path_parts = explode(DIRECTORY_SEPARATOR, $this->
getFilePath());
120 foreach ($path_parts as $path_part) {
121 if (preg_match($pattern, $path_part) === 1) {
130 $path_parts = explode(DIRECTORY_SEPARATOR, $this->
getFilePath());
131 if (in_array($folder_name, $path_parts,
true)) {
FileNamespaceCollectionInterface $namespaces
getPathPart(string $pattern)
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
__construct(FileNamespaceFactoryInterface $namespace)
withFileInfo(SplFileInfo $file_info)
SplFileInfo $spl_file_info
getSubPathToDirBeginningAtPathEnd(string $dir_name)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
pathContainsFolderName(string $folder_name)
FileNamespaceFactoryInterface $namespace
withAdditionalNamespace(FileNamespaceHandlerInterface $namespace_handler)
getSubPathToDirBeginningAtPathStart(string $dir_name)