ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Filesystem\FilesystemFacade Class Reference

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. More...

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

Public Member Functions

 __construct (private FileStreamAccess $fileStreamAccess, private FileAccess $fileAccess, private 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 $unit)
 
 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 $new_content)
 
 put (string $path, string $content)
 
 delete (string $path)
 
 readAndDelete (string $path)
 
 rename (string $path, string $new_path)
 
 copy (string $path, string $copy_path)
 
 finder ()
 
- Public Member Functions inherited from ILIAS\Filesystem\Provider\FileStreamWriteAccess
 writeStream (string $path, FileStream $stream)
 Writes the stream to a new file. More...
 
 putStream (string $path, FileStream $stream)
 Creates a new file or updates an existing one. More...
 
 updateStream (string $path, FileStream $stream)
 Updates an existing file. More...
 

Detailed Description

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
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 39 of file FilesystemFacade.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Filesystem\FilesystemFacade::__construct ( private FileStreamAccess  $fileStreamAccess,
private FileAccess  $fileAccess,
private 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.

54  {
55  }

Member Function Documentation

◆ copy()

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

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 236 of file FilesystemFacade.php.

236  : void
237  {
238  $this->fileAccess->copy($path, $copy_path);
239  }
$path
Definition: ltiservices.php:29

◆ copyDir()

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

Implements ILIAS\Filesystem\Provider\DirectoryWriteAccess.

Definition at line 84 of file FilesystemFacade.php.

84  : void
85  {
86  $this->directoryAccess->copyDir($source, $destination);
87  }

◆ createDir()

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

Implements ILIAS\Filesystem\Provider\DirectoryWriteAccess.

Definition at line 76 of file FilesystemFacade.php.

76  : void
77  {
78  $this->directoryAccess->createDir($path, $visibility);
79  }
$path
Definition: ltiservices.php:29

◆ delete()

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

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 212 of file FilesystemFacade.php.

References $path.

212  : void
213  {
214  $this->fileAccess->delete($path);
215  }
$path
Definition: ltiservices.php:29

◆ deleteDir()

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

Implements ILIAS\Filesystem\Provider\DirectoryWriteAccess.

Definition at line 92 of file FilesystemFacade.php.

92  : void
93  {
94  $this->directoryAccess->deleteDir($path);
95  }
$path
Definition: ltiservices.php:29

◆ finder()

ILIAS\Filesystem\FilesystemFacade::finder ( )

Implements ILIAS\Filesystem\Filesystem.

Definition at line 244 of file FilesystemFacade.php.

244  : Finder
245  {
246  return new Finder($this);
247  }

◆ getMimeType()

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

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 116 of file FilesystemFacade.php.

116  : string
117  {
118  return $this->fileAccess->getMimeType($path);
119  }
$path
Definition: ltiservices.php:29

◆ getSize()

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

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 132 of file FilesystemFacade.php.

References ILIAS\Data\DataSize\getSize().

132  : DataSize
133  {
134  return $this->fileAccess->getSize($path, $unit);
135  }
$path
Definition: ltiservices.php:29
+ Here is the call graph for this function:

◆ getTimestamp()

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

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 124 of file FilesystemFacade.php.

124  : \DateTimeImmutable
125  {
126  return $this->fileAccess->getTimestamp($path);
127  }
$path
Definition: ltiservices.php:29

◆ getVisibility()

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

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 148 of file FilesystemFacade.php.

148  : string
149  {
150  return $this->fileAccess->getVisibility($path);
151  }
$path
Definition: ltiservices.php:29

◆ has()

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

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 108 of file FilesystemFacade.php.

108  : bool
109  {
110  return $this->fileAccess->has($path);
111  }
$path
Definition: ltiservices.php:29

◆ hasDir()

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

Implements ILIAS\Filesystem\Provider\DirectoryReadAccess.

Definition at line 60 of file FilesystemFacade.php.

60  : bool
61  {
62  return $this->directoryAccess->hasDir($path);
63  }
$path
Definition: ltiservices.php:29

◆ listContents()

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

Implements ILIAS\Filesystem\Provider\DirectoryReadAccess.

Definition at line 68 of file FilesystemFacade.php.

References $path.

68  : array
69  {
70  return $this->directoryAccess->listContents($path, $recursive);
71  }
$path
Definition: ltiservices.php:29

◆ put()

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

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 204 of file FilesystemFacade.php.

204  : void
205  {
206  $this->fileAccess->put($path, $content);
207  }
$path
Definition: ltiservices.php:29

◆ putStream()

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

Definition at line 172 of file FilesystemFacade.php.

172  : void
173  {
174  $this->fileStreamAccess->putStream($path, $stream);
175  }
$path
Definition: ltiservices.php:29

◆ read()

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

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 100 of file FilesystemFacade.php.

100  : string
101  {
102  return $this->fileAccess->read($path);
103  }
$path
Definition: ltiservices.php:29

◆ readAndDelete()

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

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 220 of file FilesystemFacade.php.

220  : string
221  {
222  return $this->fileAccess->readAndDelete($path);
223  }
$path
Definition: ltiservices.php:29

◆ readStream()

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

Implements ILIAS\Filesystem\Provider\FileStreamReadAccess.

Definition at line 156 of file FilesystemFacade.php.

156  : FileStream
157  {
158  return $this->fileStreamAccess->readStream($path);
159  }
$path
Definition: ltiservices.php:29

◆ rename()

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

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 228 of file FilesystemFacade.php.

228  : void
229  {
230  $this->fileAccess->rename($path, $new_path);
231  }
$path
Definition: ltiservices.php:29

◆ setVisibility()

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

Implements ILIAS\Filesystem\Provider\FileReadAccess.

Definition at line 140 of file FilesystemFacade.php.

140  : bool
141  {
142  return $this->fileAccess->setVisibility($path, $visibility);
143  }
$path
Definition: ltiservices.php:29

◆ update()

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

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 196 of file FilesystemFacade.php.

196  : void
197  {
198  $this->fileAccess->update($path, $new_content);
199  }
$path
Definition: ltiservices.php:29

◆ updateStream()

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

Definition at line 180 of file FilesystemFacade.php.

180  : void
181  {
182  $this->fileStreamAccess->updateStream($path, $stream);
183  }
$path
Definition: ltiservices.php:29

◆ write()

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

Implements ILIAS\Filesystem\Provider\FileWriteAccess.

Definition at line 188 of file FilesystemFacade.php.

188  : void
189  {
190  $this->fileAccess->write($path, $content);
191  }
$path
Definition: ltiservices.php:29

◆ writeStream()

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

Definition at line 164 of file FilesystemFacade.php.

164  : void
165  {
166  $this->fileStreamAccess->writeStream($path, $stream);
167  }
$path
Definition: ltiservices.php:29

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