ILIAS  release_8 Revision v8.24
ILIAS\Filesystem\Provider\DelegatingFilesystemFactory Class Reference

Class DelegatingFilesystemFactory. More...

+ Inheritance diagram for ILIAS\Filesystem\Provider\DelegatingFilesystemFactory:
+ Collaboration diagram for ILIAS\Filesystem\Provider\DelegatingFilesystemFactory:

Public Member Functions

 __construct (FilenameSanitizer $sanitizer)
 DelegatingFilesystemFactory constructor. More...
 
 getLocal (LocalConfig $config, bool $read_only=false)
 @inheritDoc More...
 
 getLocal (LocalConfig $config, bool $read_only=false)
 Creates a local filesystem instance with the given configuration. More...
 

Private Attributes

FlySystemFilesystemFactory $implementation
 
FilenameSanitizer $sanitizer
 

Detailed Description

Class DelegatingFilesystemFactory.

The delegating filesystem factory delegates the instance creation to the factory of the concrete implementation and applies all necessary decorators.

Author
Nicolas Schäfli ns@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Since
5.3
Version
1.1.0

Definition at line 37 of file DelegatingFilesystemFactory.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Filesystem\Provider\DelegatingFilesystemFactory::__construct ( FilenameSanitizer  $sanitizer)

DelegatingFilesystemFactory constructor.

Parameters
FilenameSanitizer$sanitizer

Definition at line 48 of file DelegatingFilesystemFactory.php.

49 {
50
51 /*
52 * ---------- ABSTRACTION SWITCH -------------
53 * Change the factory to switch to another filesystem abstraction!
54 * current: FlySystem from the php league
55 * -------------------------------------------
56 */
57 $this->implementation = new FlySystemFilesystemFactory();
58
59 $this->sanitizer = $sanitizer;
60 }

References ILIAS\Filesystem\Provider\DelegatingFilesystemFactory\$sanitizer.

Member Function Documentation

◆ getLocal()

ILIAS\Filesystem\Provider\DelegatingFilesystemFactory::getLocal ( LocalConfig  $config,
bool  $read_only = false 
)

@inheritDoc

Implements ILIAS\Filesystem\Provider\FilesystemFactory.

Definition at line 66 of file DelegatingFilesystemFactory.php.

67 {
68 if ($read_only) {
69 return new ReadOnlyDecorator(new FilesystemWhitelistDecorator($this->implementation->getLocal($config), $this->sanitizer));
70 } else {
71 return new FilesystemWhitelistDecorator($this->implementation->getLocal($config), $this->sanitizer);
72 }
73 }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85
Class FlySystemFileAccessTest \Provider\FlySystem @runTestsInSeparateProcesses @preserveGlobalState d...

References $config.

Field Documentation

◆ $implementation

FlySystemFilesystemFactory ILIAS\Filesystem\Provider\DelegatingFilesystemFactory::$implementation
private

Definition at line 39 of file DelegatingFilesystemFactory.php.

◆ $sanitizer

FilenameSanitizer ILIAS\Filesystem\Provider\DelegatingFilesystemFactory::$sanitizer
private

The documentation for this class was generated from the following file: