ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 (string $path)
 
 listContents (string $path='', bool $recursive=false)
 
 createDir (string $path, string $visibility=Visibility::PUBLIC_ACCESS)
 
 copyDir (string $source, string $destination)
 
 deleteDir (string $path)
 
 read (string $path)
 
 has (string $path)
 
 getMimeType (string $path)
 
 getTimestamp (string $path)
 
 getSize (string $path, int $fileSizeUnit)
 
 setVisibility (string $path, string $visibility)
 
 getVisibility (string $path)
 
 readStream (string $path)
 
 writeStream (string $path, FileStream $stream)
 
 putStream (string $path, FileStream $stream)
 
 updateStream (string $path, FileStream $stream)
 
 write (string $path, string $content)
 
 update (string $path, string $newContent)
 
 put (string $path, string $content)
 
 delete (string $path)
 
 readAndDelete (string $path)
 
 rename (string $path, string $newPath)
 
 copy (string $path, string $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 26 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 52 of file FilesystemFacade.php.

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

53  {
54  $this->fileStreamAccess = $fileStreamAccess;
55  $this->fileAccess = $fileAccess;
56  $this->directoryAccess = $directoryAccess;
57  }

Member Function Documentation

◆ copy()

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

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 261 of file FilesystemFacade.php.

262  {
263  $this->fileAccess->copy($path, $copyPath);
264  }
$path
Definition: aliased.php:25

◆ copyDir()

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

Implements ILIAS\Filesystem\Provider\DirectoryWriteAccess.

Definition at line 90 of file FilesystemFacade.php.

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

◆ createDir()

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

Implements ILIAS\Filesystem\Provider\DirectoryWriteAccess.

Definition at line 81 of file FilesystemFacade.php.

82  {
83  $this->directoryAccess->createDir($path, $visibility);
84  }
$path
Definition: aliased.php:25

◆ delete()

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

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 234 of file FilesystemFacade.php.

References $path.

235  {
236  $this->fileAccess->delete($path);
237  }
$path
Definition: aliased.php:25

◆ deleteDir()

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

Implements ILIAS\Filesystem\Provider\DirectoryWriteAccess.

Definition at line 99 of file FilesystemFacade.php.

100  {
101  $this->directoryAccess->deleteDir($path);
102  }
$path
Definition: aliased.php:25

◆ getMimeType()

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

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 126 of file FilesystemFacade.php.

126  : string
127  {
128  return $this->fileAccess->getMimeType($path);
129  }
$path
Definition: aliased.php:25

◆ getSize()

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

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 144 of file FilesystemFacade.php.

References ILIAS\Data\DataSize\getSize().

144  : DataSize
145  {
146  return $this->fileAccess->getSize($path, $fileSizeUnit);
147  }
$path
Definition: aliased.php:25
+ Here is the call graph for this function:

◆ getTimestamp()

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

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 135 of file FilesystemFacade.php.

135  : \DateTimeImmutable
136  {
137  return $this->fileAccess->getTimestamp($path);
138  }
$path
Definition: aliased.php:25

◆ getVisibility()

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

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 162 of file FilesystemFacade.php.

162  : string
163  {
164  return $this->fileAccess->getVisibility($path);
165  }
$path
Definition: aliased.php:25

◆ has()

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

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 117 of file FilesystemFacade.php.

117  : bool
118  {
119  return $this->fileAccess->has($path);
120  }
$path
Definition: aliased.php:25

◆ hasDir()

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

Implements ILIAS\Filesystem\Provider\DirectoryReadAccess.

Definition at line 63 of file FilesystemFacade.php.

63  : bool
64  {
65  return $this->directoryAccess->hasDir($path);
66  }
$path
Definition: aliased.php:25

◆ listContents()

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

Implements ILIAS\Filesystem\Provider\DirectoryReadAccess.

Definition at line 72 of file FilesystemFacade.php.

References $path.

72  : array
73  {
74  return $this->directoryAccess->listContents($path, $recursive);
75  }
$path
Definition: aliased.php:25

◆ put()

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

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 225 of file FilesystemFacade.php.

226  {
227  $this->fileAccess->put($path, $content);
228  }
$path
Definition: aliased.php:25

◆ putStream()

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

Implements ILIAS\Filesystem\Provider\FileStreamWriteAccess.

Definition at line 189 of file FilesystemFacade.php.

190  {
191  $this->fileStreamAccess->putStream($path, $stream);
192  }
$path
Definition: aliased.php:25
$stream
PHP stream implementation.

◆ read()

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

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 108 of file FilesystemFacade.php.

108  : string
109  {
110  return $this->fileAccess->read($path);
111  }
$path
Definition: aliased.php:25

◆ readAndDelete()

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

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 243 of file FilesystemFacade.php.

243  : string
244  {
245  return $this->fileAccess->readAndDelete($path);
246  }
$path
Definition: aliased.php:25

◆ readStream()

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

Implements ILIAS\Filesystem\Provider\FileStreamReadAccess.

Definition at line 171 of file FilesystemFacade.php.

171  : FileStream
172  {
173  return $this->fileStreamAccess->readStream($path);
174  }
$path
Definition: aliased.php:25

◆ rename()

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

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 252 of file FilesystemFacade.php.

253  {
254  $this->fileAccess->rename($path, $newPath);
255  }
$path
Definition: aliased.php:25

◆ setVisibility()

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

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 153 of file FilesystemFacade.php.

153  : bool
154  {
155  return $this->fileAccess->setVisibility($path, $visibility);
156  }
$path
Definition: aliased.php:25

◆ update()

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

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 216 of file FilesystemFacade.php.

217  {
218  $this->fileAccess->update($path, $newContent);
219  }
$path
Definition: aliased.php:25

◆ updateStream()

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

Implements ILIAS\Filesystem\Provider\FileStreamWriteAccess.

Definition at line 198 of file FilesystemFacade.php.

199  {
200  $this->fileStreamAccess->updateStream($path, $stream);
201  }
$path
Definition: aliased.php:25
$stream
PHP stream implementation.

◆ write()

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

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 207 of file FilesystemFacade.php.

208  {
209  $this->fileAccess->write($path, $content);
210  }
$path
Definition: aliased.php:25

◆ writeStream()

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

Implements ILIAS\Filesystem\Provider\FileStreamWriteAccess.

Definition at line 180 of file FilesystemFacade.php.

181  {
182  $this->fileStreamAccess->writeStream($path, $stream);
183  }
$path
Definition: aliased.php:25
$stream
PHP stream implementation.

Field Documentation

◆ $directoryAccess

DirectoryAccess ILIAS\Filesystem\FilesystemFacade::$directoryAccess
private

Definition at line 40 of file FilesystemFacade.php.

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

◆ $fileAccess

FileAccess ILIAS\Filesystem\FilesystemFacade::$fileAccess
private

Definition at line 36 of file FilesystemFacade.php.

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

◆ $fileStreamAccess

FileStreamAccess ILIAS\Filesystem\FilesystemFacade::$fileStreamAccess
private

Definition at line 32 of file FilesystemFacade.php.

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


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