ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
DelegatingFilesystemFactory.php
Go to the documentation of this file.
1
<?php
2
namespace
ILIAS\Filesystem\Provider
;
3
4
use
ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator
;
5
use
ILIAS\Filesystem\Decorator\ReadOnlyDecorator
;
6
use
ILIAS\Filesystem\Filesystem
;
7
use
ILIAS\Filesystem\Provider\Configuration\LocalConfig
;
8
use
ILIAS\Filesystem\Provider\FlySystem\FlySystemFilesystemFactory
;
9
use
ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizer
;
10
21
final
class
DelegatingFilesystemFactory
implements
FilesystemFactory
22
{
23
private
$implementation
;
27
private
$sanitizer
;
28
29
35
public
function
__construct
(
FilenameSanitizer
$sanitizer
)
36
{
37
38
/*
39
* ---------- ABSTRACTION SWITCH -------------
40
* Change the factory to switch to another filesystem abstraction!
41
* current: FlySystem from the php league
42
* -------------------------------------------
43
*/
44
$this->implementation =
new
FlySystemFilesystemFactory
();
45
46
$this->sanitizer =
$sanitizer
;
47
}
48
49
53
public
function
getLocal
(
LocalConfig
$config
, $read_only =
false
)
54
{
55
if
($read_only) {
56
return
new
ReadOnlyDecorator
(
new
FilesystemWhitelistDecorator
($this->implementation->getLocal($config),
$this->sanitizer
));
57
}
else
{
58
return
new
FilesystemWhitelistDecorator
($this->implementation->getLocal($config),
$this->sanitizer
);
59
}
60
}
61
}
FilesystemWhitelistDecorator
ILIAS\Filesystem\Decorator\ReadOnlyDecorator
Definition:
ReadOnlyDecorator.php:26
$config
$config
Definition:
flush-definition-cache.php:23
Filesystem
FlySystemFilesystemFactory
ILIAS\Filesystem\Provider
ILIAS\Filesystem\Provider\DelegatingFilesystemFactory\__construct
__construct(FilenameSanitizer $sanitizer)
DelegatingFilesystemFactory constructor.
Definition:
DelegatingFilesystemFactory.php:35
ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator
Definition:
FilesystemWhitelistDecorator.php:26
ReadOnlyDecorator
ILIAS\Filesystem\Provider\DelegatingFilesystemFactory\$implementation
$implementation
Definition:
DelegatingFilesystemFactory.php:23
ILIAS\Filesystem\Provider\DelegatingFilesystemFactory
Class DelegatingFilesystemFactory.
Definition:
DelegatingFilesystemFactory.php:21
ILIAS\Filesystem\Provider\DelegatingFilesystemFactory\getLocal
getLocal(LocalConfig $config, $read_only=false)
Definition:
DelegatingFilesystemFactory.php:53
ILIAS\Filesystem\Provider\FlySystem\FlySystemFilesystemFactory
Class FlySystemFilesystemFactory.
Definition:
FlySystemFilesystemFactory.php:16
FilenameSanitizer
ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizer
Definition:
FilenameSanitizer.php:20
ILIAS\Filesystem\Provider\FilesystemFactory
Interface FilesystemFactory.
Definition:
FilesystemFactory.php:18
ILIAS\Filesystem\Provider\DelegatingFilesystemFactory\$sanitizer
$sanitizer
Definition:
DelegatingFilesystemFactory.php:27
ILIAS\Filesystem\Provider\Configuration\LocalConfig
Class LocalConfig.
Definition:
LocalConfig.php:14
LocalConfig
src
Filesystem
Provider
DelegatingFilesystemFactory.php
Generated on Sat Jan 18 2025 19:01:42 for ILIAS by
1.8.13 (using
Doxyfile
)