ILIAS  release_7 Revision v7.30-3-g800a261c036
DelegatingFilesystemFactory.php
Go to the documentation of this file.
1<?php
2declare(strict_types=1);
3
5
12
22{
27 private $sanitizer;
28
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 }
46
50 public function getLocal(LocalConfig $config, bool $read_only = false) : Filesystem
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 }
59}
An exception for terminatinating execution or to throw for unit testing.
Class LocalConfig This class is used to configure the local filesystem adapter.
Definition: LocalConfig.php:14
Class DelegatingFilesystemFactory The delegating filesystem factory delegates the instance creation t...
__construct(FilenameSanitizer $sanitizer)
DelegatingFilesystemFactory constructor.
getLocal(LocalConfig $config, bool $read_only=false)
@inheritDoc
Interface Filesystem The filesystem interface provides the public interface for the Filesystem servic...
Definition: Filesystem.php:22
Interface FilesystemFactory The filesystem factory produces different filesystem types.
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
Class FlySystemFileAccessTest \Provider\FlySystem @runTestsInSeparateProcesses @preserveGlobalState d...