ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
DelegatingFilesystemFactory.php
Go to the documentation of this file.
1 <?php
3 
10 
22 {
23  private $implementation;
27  private $sanitizer;
28 
29 
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  }
48 
49 
53  public function getLocal(LocalConfig $config, $read_only = false)
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  }
61 }
__construct(FilenameSanitizer $sanitizer)
DelegatingFilesystemFactory constructor.