ILIAS  release_7 Revision v7.30-3-g800a261c036
ILIAS\Filesystem\Provider\DelegatingFilesystemFactory Class Reference

Class DelegatingFilesystemFactory The delegating filesystem factory delegates the instance creation to the factory of the concrete implementation and applies all necessary decorators. 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

 $implementation
 
 $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 21 of file DelegatingFilesystemFactory.php.

Constructor & Destructor Documentation

◆ __construct()

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

DelegatingFilesystemFactory constructor.

Parameters
FilenameSanitizer$sanitizer

Definition at line 33 of file DelegatingFilesystemFactory.php.

34 {
35
36 /*
37 * ---------- ABSTRACTION SWITCH -------------
38 * Change the factory to switch to another filesystem abstraction!
39 * current: FlySystem from the php league
40 * -------------------------------------------
41 */
42 $this->implementation = new FlySystemFilesystemFactory();
43
44 $this->sanitizer = $sanitizer;
45 }

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 50 of file DelegatingFilesystemFactory.php.

51 {
52 if ($read_only) {
53 return new ReadOnlyDecorator(new FilesystemWhitelistDecorator($this->implementation->getLocal($config),
54 $this->sanitizer));
55 } else {
56 return new FilesystemWhitelistDecorator($this->implementation->getLocal($config), $this->sanitizer);
57 }
58 }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
Class FlySystemFileAccessTest \Provider\FlySystem @runTestsInSeparateProcesses @preserveGlobalState d...

References $config.

Field Documentation

◆ $implementation

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

Definition at line 23 of file DelegatingFilesystemFactory.php.

◆ $sanitizer

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

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