ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ILIAS\Filesystem\FilesystemFacade Class Reference

Class FilesystemFacade. More...

+ Inheritance diagram for ILIAS\Filesystem\FilesystemFacade:
+ Collaboration diagram for ILIAS\Filesystem\FilesystemFacade:

Public Member Functions

 __construct (FileStreamAccess $fileStreamAccess, FileAccess $fileAccess, DirectoryAccess $directoryAccess)
 FilesystemFacade constructor. More...
 
 hasDir ($path)
 
 listContents ($path='', $recursive=false)
 
 createDir ($path, $visibility=Visibility::PUBLIC_ACCESS)
 
 copyDir ($source, $destination)
 
 deleteDir ($path)
 
 read ($path)
 
 has ($path)
 
 getMimeType ($path)
 
 getTimestamp ($path)
 
 getSize ($path, $fileSizeUnit)
 
 setVisibility ($path, $visibility)
 
 getVisibility ($path)
 
 readStream ($path)
 
 writeStream ($path, FileStream $stream)
 
 putStream ($path, FileStream $stream)
 
 updateStream ($path, FileStream $stream)
 
 write ($path, $content)
 
 update ($path, $newContent)
 
 put ($path, $content)
 
 delete ($path)
 
 readAndDelete ($path)
 
 rename ($path, $newPath)
 
 copy ($path, $copyPath)
 

Private Attributes

 $fileStreamAccess
 
 $fileAccess
 
 $directoryAccess
 

Detailed Description

Class FilesystemFacade.

The filesystem facade is used internally to satisfy the Filesystem interface because the implementations are split into different classes to reduce the size and responsibility of each class.

This class simply delegates the work to the classes which are responsible for the task.

Author
Nicolas Schäfli ns@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Since
5.3
Version
1.0.0

Definition at line 24 of file FilesystemFacade.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Filesystem\FilesystemFacade::__construct ( FileStreamAccess  $fileStreamAccess,
FileAccess  $fileAccess,
DirectoryAccess  $directoryAccess 
)

FilesystemFacade constructor.

Creates a new instance of the facade with the provided access classes.

Parameters
FileStreamAccess$fileStreamAccess
FileAccess$fileAccess
DirectoryAccess$directoryAccess

Definition at line 50 of file FilesystemFacade.php.

References ILIAS\Filesystem\FilesystemFacade\$directoryAccess, ILIAS\Filesystem\FilesystemFacade\$fileAccess, and ILIAS\Filesystem\FilesystemFacade\$fileStreamAccess.

51  {
52  $this->fileStreamAccess = $fileStreamAccess;
53  $this->fileAccess = $fileAccess;
54  $this->directoryAccess = $directoryAccess;
55  }

Member Function Documentation

◆ copy()

ILIAS\Filesystem\FilesystemFacade::copy (   $path,
  $copyPath 
)

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 259 of file FilesystemFacade.php.

References $path.

260  {
261  $this->fileAccess->copy($path, $copyPath);
262  }

◆ copyDir()

ILIAS\Filesystem\FilesystemFacade::copyDir (   $source,
  $destination 
)

Implements ILIAS\Filesystem\Provider\DirectoryWriteAccess.

Definition at line 88 of file FilesystemFacade.php.

References $destination, and $source.

89  {
90  $this->directoryAccess->copyDir($source, $destination);
91  }
$destination
$source
Definition: linkback.php:22

◆ createDir()

ILIAS\Filesystem\FilesystemFacade::createDir (   $path,
  $visibility = Visibility::PUBLIC_ACCESS 
)

Implements ILIAS\Filesystem\Provider\DirectoryWriteAccess.

Definition at line 79 of file FilesystemFacade.php.

References $path.

80  {
81  $this->directoryAccess->createDir($path, $visibility);
82  }

◆ delete()

ILIAS\Filesystem\FilesystemFacade::delete (   $path)

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 232 of file FilesystemFacade.php.

References $path.

233  {
234  $this->fileAccess->delete($path);
235  }

◆ deleteDir()

ILIAS\Filesystem\FilesystemFacade::deleteDir (   $path)

Implements ILIAS\Filesystem\Provider\DirectoryWriteAccess.

Definition at line 97 of file FilesystemFacade.php.

References $path.

98  {
99  $this->directoryAccess->deleteDir($path);
100  }

◆ getMimeType()

ILIAS\Filesystem\FilesystemFacade::getMimeType (   $path)

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 124 of file FilesystemFacade.php.

References $path.

125  {
126  return $this->fileAccess->getMimeType($path);
127  }

◆ getSize()

ILIAS\Filesystem\FilesystemFacade::getSize (   $path,
  $fileSizeUnit 
)

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 142 of file FilesystemFacade.php.

References $path.

143  {
144  return $this->fileAccess->getSize($path, $fileSizeUnit);
145  }

◆ getTimestamp()

ILIAS\Filesystem\FilesystemFacade::getTimestamp (   $path)

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 133 of file FilesystemFacade.php.

References $path.

134  {
135  return $this->fileAccess->getTimestamp($path);
136  }

◆ getVisibility()

ILIAS\Filesystem\FilesystemFacade::getVisibility (   $path)

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 160 of file FilesystemFacade.php.

References $path.

161  {
162  return $this->fileAccess->getVisibility($path);
163  }

◆ has()

ILIAS\Filesystem\FilesystemFacade::has (   $path)

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 115 of file FilesystemFacade.php.

References $path.

116  {
117  return $this->fileAccess->has($path);
118  }

◆ hasDir()

ILIAS\Filesystem\FilesystemFacade::hasDir (   $path)

Implements ILIAS\Filesystem\Provider\DirectoryReadAccess.

Definition at line 61 of file FilesystemFacade.php.

References $path.

62  {
63  return $this->directoryAccess->hasDir($path);
64  }

◆ listContents()

ILIAS\Filesystem\FilesystemFacade::listContents (   $path = '',
  $recursive = false 
)

Implements ILIAS\Filesystem\Provider\DirectoryReadAccess.

Definition at line 70 of file FilesystemFacade.php.

References $path.

71  {
72  return $this->directoryAccess->listContents($path, $recursive);
73  }

◆ put()

ILIAS\Filesystem\FilesystemFacade::put (   $path,
  $content 
)

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 223 of file FilesystemFacade.php.

References $path.

224  {
225  $this->fileAccess->put($path, $content);
226  }

◆ putStream()

ILIAS\Filesystem\FilesystemFacade::putStream (   $path,
FileStream  $stream 
)

Implements ILIAS\Filesystem\Provider\FileStreamWriteAccess.

Definition at line 187 of file FilesystemFacade.php.

References $path.

188  {
189  $this->fileStreamAccess->putStream($path, $stream);
190  }
$stream
PHP stream implementation.

◆ read()

ILIAS\Filesystem\FilesystemFacade::read (   $path)

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 106 of file FilesystemFacade.php.

References $path.

107  {
108  return $this->fileAccess->read($path);
109  }

◆ readAndDelete()

ILIAS\Filesystem\FilesystemFacade::readAndDelete (   $path)

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 241 of file FilesystemFacade.php.

References $path.

242  {
243  return $this->fileAccess->readAndDelete($path);
244  }

◆ readStream()

ILIAS\Filesystem\FilesystemFacade::readStream (   $path)

Implements ILIAS\Filesystem\Provider\FileStreamReadAccess.

Definition at line 169 of file FilesystemFacade.php.

References $path.

170  {
171  return $this->fileStreamAccess->readStream($path);
172  }

◆ rename()

ILIAS\Filesystem\FilesystemFacade::rename (   $path,
  $newPath 
)

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 250 of file FilesystemFacade.php.

References $path.

251  {
252  $this->fileAccess->rename($path, $newPath);
253  }

◆ setVisibility()

ILIAS\Filesystem\FilesystemFacade::setVisibility (   $path,
  $visibility 
)

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 151 of file FilesystemFacade.php.

References $path.

152  {
153  return $this->fileAccess->setVisibility($path, $visibility);
154  }

◆ update()

ILIAS\Filesystem\FilesystemFacade::update (   $path,
  $newContent 
)

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 214 of file FilesystemFacade.php.

References $path.

215  {
216  $this->fileAccess->update($path, $newContent);
217  }

◆ updateStream()

ILIAS\Filesystem\FilesystemFacade::updateStream (   $path,
FileStream  $stream 
)

Implements ILIAS\Filesystem\Provider\FileStreamWriteAccess.

Definition at line 196 of file FilesystemFacade.php.

References $path.

197  {
198  $this->fileStreamAccess->updateStream($path, $stream);
199  }
$stream
PHP stream implementation.

◆ write()

ILIAS\Filesystem\FilesystemFacade::write (   $path,
  $content 
)

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 205 of file FilesystemFacade.php.

References $path.

206  {
207  $this->fileAccess->write($path, $content);
208  }

◆ writeStream()

ILIAS\Filesystem\FilesystemFacade::writeStream (   $path,
FileStream  $stream 
)

Implements ILIAS\Filesystem\Provider\FileStreamWriteAccess.

Definition at line 178 of file FilesystemFacade.php.

References $path.

179  {
180  $this->fileStreamAccess->writeStream($path, $stream);
181  }
$stream
PHP stream implementation.

Field Documentation

◆ $directoryAccess

DirectoryAccess ILIAS\Filesystem\FilesystemFacade::$directoryAccess
private

Definition at line 38 of file FilesystemFacade.php.

Referenced by ILIAS\Filesystem\FilesystemFacade\__construct().

◆ $fileAccess

FileAccess ILIAS\Filesystem\FilesystemFacade::$fileAccess
private

Definition at line 34 of file FilesystemFacade.php.

Referenced by ILIAS\Filesystem\FilesystemFacade\__construct().

◆ $fileStreamAccess

FileStreamAccess ILIAS\Filesystem\FilesystemFacade::$fileStreamAccess
private

Definition at line 30 of file FilesystemFacade.php.

Referenced by ILIAS\Filesystem\FilesystemFacade\__construct().


The documentation for this class was generated from the following file: