ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
FilesystemFacade.php
Go to the documentation of this file.
1 <?php
2 
3 namespace ILIAS\Filesystem;
4 
9 
24 class FilesystemFacade implements Filesystem
25 {
26 
34  private $fileAccess;
39 
40 
51  {
52  $this->fileStreamAccess = $fileStreamAccess;
53  $this->fileAccess = $fileAccess;
54  $this->directoryAccess = $directoryAccess;
55  }
56 
57 
61  public function hasDir($path)
62  {
63  return $this->directoryAccess->hasDir($path);
64  }
65 
66 
70  public function listContents($path = '', $recursive = false)
71  {
72  return $this->directoryAccess->listContents($path, $recursive);
73  }
74 
75 
79  public function createDir($path, $visibility = Visibility::PUBLIC_ACCESS)
80  {
81  $this->directoryAccess->createDir($path, $visibility);
82  }
83 
84 
88  public function copyDir($source, $destination)
89  {
90  $this->directoryAccess->copyDir($source, $destination);
91  }
92 
93 
97  public function deleteDir($path)
98  {
99  $this->directoryAccess->deleteDir($path);
100  }
101 
102 
106  public function read($path)
107  {
108  return $this->fileAccess->read($path);
109  }
110 
111 
115  public function has($path)
116  {
117  return $this->fileAccess->has($path);
118  }
119 
120 
124  public function getMimeType($path)
125  {
126  return $this->fileAccess->getMimeType($path);
127  }
128 
129 
133  public function getTimestamp($path)
134  {
135  return $this->fileAccess->getTimestamp($path);
136  }
137 
138 
142  public function getSize($path, $fileSizeUnit)
143  {
144  return $this->fileAccess->getSize($path, $fileSizeUnit);
145  }
146 
147 
151  public function setVisibility($path, $visibility)
152  {
153  return $this->fileAccess->setVisibility($path, $visibility);
154  }
155 
156 
160  public function getVisibility($path)
161  {
162  return $this->fileAccess->getVisibility($path);
163  }
164 
165 
169  public function readStream($path)
170  {
171  return $this->fileStreamAccess->readStream($path);
172  }
173 
174 
179  {
180  $this->fileStreamAccess->writeStream($path, $stream);
181  }
182 
183 
187  public function putStream($path, FileStream $stream)
188  {
189  $this->fileStreamAccess->putStream($path, $stream);
190  }
191 
192 
197  {
198  $this->fileStreamAccess->updateStream($path, $stream);
199  }
200 
201 
205  public function write($path, $content)
206  {
207  $this->fileAccess->write($path, $content);
208  }
209 
210 
214  public function update($path, $newContent)
215  {
216  $this->fileAccess->update($path, $newContent);
217  }
218 
219 
223  public function put($path, $content)
224  {
225  $this->fileAccess->put($path, $content);
226  }
227 
228 
232  public function delete($path)
233  {
234  $this->fileAccess->delete($path);
235  }
236 
237 
241  public function readAndDelete($path)
242  {
243  return $this->fileAccess->readAndDelete($path);
244  }
245 
246 
250  public function rename($path, $newPath)
251  {
252  $this->fileAccess->rename($path, $newPath);
253  }
254 
255 
259  public function copy($path, $copyPath)
260  {
261  $this->fileAccess->copy($path, $copyPath);
262  }
263 }
putStream($path, FileStream $stream)
$destination
writeStream($path, FileStream $stream)
createDir($path, $visibility=Visibility::PUBLIC_ACCESS)
$stream
PHP stream implementation.
listContents($path='', $recursive=false)
updateStream($path, FileStream $stream)
__construct(FileStreamAccess $fileStreamAccess, FileAccess $fileAccess, DirectoryAccess $directoryAccess)
FilesystemFacade constructor.
$source
Definition: linkback.php:22
const PUBLIC_ACCESS
Public file visibility.
Definition: Visibility.php:25
Interface FileStream.
Definition: FileStream.php:20
Class FlySystemFileAccessTest.