ILIAS  release_8 Revision v8.24
DelegatingFilesystemFactory.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
6
13
14/******************************************************************************
15 *
16 * This file is part of ILIAS, a powerful learning management system.
17 *
18 * ILIAS is licensed with the GPL-3.0, you should have received a copy
19 * of said license along with the source code.
20 *
21 * If this is not the case or you just want to try ILIAS, you'll find
22 * us at:
23 * https://www.ilias.de
24 * https://github.com/ILIAS-eLearning
25 *
26 *****************************************************************************/
38{
41
42
49 {
50
51 /*
52 * ---------- ABSTRACTION SWITCH -------------
53 * Change the factory to switch to another filesystem abstraction!
54 * current: FlySystem from the php league
55 * -------------------------------------------
56 */
57 $this->implementation = new FlySystemFilesystemFactory();
58
59 $this->sanitizer = $sanitizer;
60 }
61
62
66 public function getLocal(LocalConfig $config, bool $read_only = false): Filesystem
67 {
68 if ($read_only) {
69 return new ReadOnlyDecorator(new FilesystemWhitelistDecorator($this->implementation->getLocal($config), $this->sanitizer));
70 } else {
71 return new FilesystemWhitelistDecorator($this->implementation->getLocal($config), $this->sanitizer);
72 }
73 }
74}
__construct(FilenameSanitizer $sanitizer)
DelegatingFilesystemFactory constructor.
getLocal(LocalConfig $config, bool $read_only=false)
@inheritDoc
Interface Filesystem.
Definition: Filesystem.php:40
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85
Class FlySystemFileAccessTest \Provider\FlySystem @runTestsInSeparateProcesses @preserveGlobalState d...