ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ReadOnlyDecorator.php
Go to the documentation of this file.
1 <?php
3 
4 use DateTime;
5 use ilFileUtils;
13 
26 final class ReadOnlyDecorator implements Filesystem
27 {
28 
32  private $filesystem;
33 
34 
41  {
42  $this->filesystem = $filesystem;
43  }
44 
45 
49  public function hasDir($path)
50  {
51  return $this->filesystem->hasDir($path);
52  }
53 
54 
58  public function listContents($path = '', $recursive = false)
59  {
60  return $this->filesystem->listContents($path, $recursive);
61  }
62 
63 
67  public function createDir($path, $visibility = Visibility::PUBLIC_ACCESS)
68  {
69  throw new IOException("FS has ready access only");
70  }
71 
72 
76  public function copyDir($source, $destination)
77  {
78  throw new IOException("FS has ready access only");
79  }
80 
81 
85  public function deleteDir($path)
86  {
87  throw new IOException("FS has ready access only");
88  }
89 
90 
94  public function read($path)
95  {
96  return $this->filesystem->read($path);
97  }
98 
99 
103  public function has($path)
104  {
105  return $this->filesystem->has($path);
106  }
107 
108 
112  public function getMimeType($path)
113  {
114  return $this->filesystem->getMimeType($path);
115  }
116 
117 
121  public function getTimestamp($path)
122  {
123  return $this->filesystem->getTimestamp($path);
124  }
125 
126 
130  public function getSize($path, $fileSizeUnit)
131  {
132  return $this->filesystem->getSize(
133  $path,
134  $fileSizeUnit
135  );
136  }
137 
138 
142  public function setVisibility($path, $visibility)
143  {
144  throw new IOException("FS has ready access only");
145  }
146 
147 
151  public function getVisibility($path)
152  {
153  return $this->filesystem->getVisibility($path);
154  }
155 
156 
160  public function readStream($path)
161  {
162  return $this->filesystem->readStream($path);
163  }
164 
165 
170  {
171  throw new IOException("FS has ready access only");
172  }
173 
174 
178  public function putStream($path, FileStream $stream)
179  {
180  throw new IOException("FS has ready access only");
181  }
182 
183 
188  {
189  throw new IOException("FS has ready access only");
190  }
191 
192 
196  public function write($path, $content)
197  {
198  throw new IOException("FS has ready access only");
199  }
200 
201 
205  public function update($path, $newContent)
206  {
207  throw new IOException("FS has ready access only");
208  }
209 
210 
214  public function put($path, $content)
215  {
216  throw new IOException("FS has ready access only");
217  }
218 
219 
223  public function delete($path)
224  {
225  throw new IOException("FS has ready access only");
226  }
227 
228 
232  public function readAndDelete($path)
233  {
234  throw new IOException("FS has ready access only");
235  }
236 
237 
241  public function rename($path, $newPath)
242  {
243  throw new IOException("FS has ready access only");
244  }
245 
246 
250  public function copy($path, $copyPath)
251  {
252  throw new IOException("FS has ready access only");
253  }
254 }
$destination
createDir($path, $visibility=Visibility::PUBLIC_ACCESS)
$stream
PHP stream implementation.
__construct(Filesystem $filesystem)
ReadOnlyDecorator constructor.
$source
Definition: linkback.php:22
const PUBLIC_ACCESS
Public file visibility.
Definition: Visibility.php:25
Interface FileStream.
Definition: FileStream.php:20
Class FlySystemFileAccessTest.