ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Filesystem\Provider\DelegatingFilesystemFactory Class Reference

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 (private 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
 

Detailed Description

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
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 37 of file DelegatingFilesystemFactory.php.

Constructor & Destructor Documentation

◆ __construct()

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

DelegatingFilesystemFactory constructor.

Definition at line 44 of file DelegatingFilesystemFactory.php.

45 {
46 /*
47 * ---------- ABSTRACTION SWITCH -------------
48 * Change the factory to switch to another filesystem abstraction!
49 * current: FlySystem from the php league
50 * -------------------------------------------
51 */
52 $this->implementation = new FlySystemFilesystemFactory();
53 }

Member Function Documentation

◆ getLocal()

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

@inheritDoc

Implements ILIAS\Filesystem\Provider\FilesystemFactory.

Definition at line 58 of file DelegatingFilesystemFactory.php.

58 : Filesystem
59 {
60 if ($read_only) {
61 return new ReadOnlyDecorator(
62 new FilesystemWhitelistDecorator($this->implementation->getLocal($config), $this->sanitizer)
63 );
64 }
65 return new FilesystemWhitelistDecorator($this->implementation->getLocal($config), $this->sanitizer);
66 }

Field Documentation

◆ $implementation

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

Definition at line 39 of file DelegatingFilesystemFactory.php.


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