ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
DelegatingFilesystemFactory.php
Go to the documentation of this file.
1<?php
2declare(strict_types=1);
3
5
12
24{
29 private $sanitizer;
30
31
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 }
50
51
55 public function getLocal(LocalConfig $config, bool $read_only = false) : 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 }
63}
An exception for terminatinating execution or to throw for unit testing.
__construct(FilenameSanitizer $sanitizer)
DelegatingFilesystemFactory constructor.
getLocal(LocalConfig $config, bool $read_only=false)
@inheritDoc
Interface Filesystem.
Definition: Filesystem.php:27
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
Class FlySystemFileAccessTest.