ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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, $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 21 of file DelegatingFilesystemFactory.php.

Constructor & Destructor Documentation

◆ __construct()

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

DelegatingFilesystemFactory constructor.

Parameters
FilenameSanitizer$sanitizer

Definition at line 35 of file DelegatingFilesystemFactory.php.

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

Member Function Documentation

◆ getLocal()

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

Implements ILIAS\Filesystem\Provider\FilesystemFactory.

Definition at line 53 of file DelegatingFilesystemFactory.php.

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

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  }

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: