ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
DelegatingFilesystemFactory.php
Go to the documentation of this file.
1
<?
php
2
declare(strict_types=1);
3
4
namespace
ILIAS\Filesystem\Provider
;
5
6
use
ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator
;
7
use
ILIAS\Filesystem\Decorator\ReadOnlyDecorator
;
8
use
ILIAS\Filesystem\Filesystem
;
9
use
ILIAS\Filesystem\Provider\Configuration\LocalConfig
;
10
use
ILIAS\Filesystem\Provider\FlySystem\FlySystemFilesystemFactory
;
11
use
ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizer
;
12
23
final
class
DelegatingFilesystemFactory
implements
FilesystemFactory
24
{
25
private
$implementation
;
29
private
$sanitizer
;
30
31
37
public
function
__construct
(
FilenameSanitizer
$sanitizer
)
38
{
39
40
/*
41
* ---------- ABSTRACTION SWITCH -------------
42
* Change the factory to switch to another filesystem abstraction!
43
* current: FlySystem from the php league
44
* -------------------------------------------
45
*/
46
$this->implementation =
new
FlySystemFilesystemFactory
();
47
48
$this->sanitizer =
$sanitizer
;
49
}
50
51
55
public
function
getLocal
(
LocalConfig
$config
,
bool
$read_only =
false
) :
Filesystem
56
{
57
if
($read_only) {
58
return
new
ReadOnlyDecorator
(
new
FilesystemWhitelistDecorator
($this->implementation->getLocal(
$config
), $this->sanitizer));
59
}
else
{
60
return
new
FilesystemWhitelistDecorator
($this->implementation->getLocal(
$config
), $this->sanitizer);
61
}
62
}
63
}
php
An exception for terminatinating execution or to throw for unit testing.
ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator
Definition:
FilesystemWhitelistDecorator.php:30
ILIAS\Filesystem\Decorator\ReadOnlyDecorator
Definition:
ReadOnlyDecorator.php:29
ILIAS\Filesystem\Provider\Configuration\LocalConfig
Class LocalConfig.
Definition:
LocalConfig.php:16
ILIAS\Filesystem\Provider\DelegatingFilesystemFactory
Class DelegatingFilesystemFactory.
Definition:
DelegatingFilesystemFactory.php:24
ILIAS\Filesystem\Provider\DelegatingFilesystemFactory\__construct
__construct(FilenameSanitizer $sanitizer)
DelegatingFilesystemFactory constructor.
Definition:
DelegatingFilesystemFactory.php:37
ILIAS\Filesystem\Provider\DelegatingFilesystemFactory\getLocal
getLocal(LocalConfig $config, bool $read_only=false)
@inheritDoc
Definition:
DelegatingFilesystemFactory.php:55
ILIAS\Filesystem\Provider\DelegatingFilesystemFactory\$implementation
$implementation
Definition:
DelegatingFilesystemFactory.php:25
ILIAS\Filesystem\Provider\DelegatingFilesystemFactory\$sanitizer
$sanitizer
Definition:
DelegatingFilesystemFactory.php:29
ILIAS\Filesystem\Provider\FlySystem\FlySystemFilesystemFactory
Class FlySystemFilesystemFactory.
Definition:
FlySystemFilesystemFactory.php:18
ILIAS\Filesystem\Filesystem
Interface Filesystem.
Definition:
Filesystem.php:26
ILIAS\Filesystem\Provider\FilesystemFactory
Interface FilesystemFactory.
Definition:
FilesystemFactory.php:19
ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizer
Definition:
FilenameSanitizer.php:19
$config
$config
Definition:
bootstrap.php:15
Filesystem
Class FlySystemFileAccessTest.
ILIAS\Filesystem\Provider
src
Filesystem
Provider
DelegatingFilesystemFactory.php
Generated on Thu Oct 2 2025 19:02:05 for ILIAS by
1.9.4 (using
Doxyfile
)