ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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)
 

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

Constructor & Destructor Documentation

◆ __construct()

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

DelegatingFilesystemFactory constructor.

Parameters
FilenameSanitizer$sanitizer

Definition at line 37 of file DelegatingFilesystemFactory.php.

References ILIAS\Filesystem\Provider\DelegatingFilesystemFactory\$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  }

Member Function Documentation

◆ getLocal()

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

Implements ILIAS\Filesystem\Provider\FilesystemFactory.

Definition at line 55 of file DelegatingFilesystemFactory.php.

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

55  : 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  }
$config
Definition: bootstrap.php:15
Class FlySystemFileAccessTest.

Field Documentation

◆ $implementation

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

Definition at line 25 of file DelegatingFilesystemFactory.php.

◆ $sanitizer

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

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