Elgg  Version 6.1
Filestore.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Filesystem;
4 
8 abstract class Filestore {
9 
18  abstract public function open(\ElggFile $file, string $mode);
19 
28  abstract public function write($f, string $data): int;
29 
39  abstract public function read($f, int $length, int $offset = 0);
40 
49  abstract public function seek($f, int $position): int;
50 
58  abstract public function eof($f): bool;
59 
67  abstract public function tell($f): int|false;
68 
76  abstract public function close($f): bool;
77 
85  abstract public function delete(\ElggFile $file, bool $follow_symlinks = true): bool;
86 
94  abstract public function getFileSize(\ElggFile $file): int;
95 
103  abstract public function getFilenameOnFilestore(\ElggFile $file): string;
104 
111  abstract public function getParameters(): array;
112 
120  abstract public function setParameters(array $parameters): bool;
121 
129  abstract public function grabFile(\ElggFile $file);
130 
138  abstract public function exists(\ElggFile $file);
139 }
$mode
Configure site maintenance mode.
$position
Definition: add.php:11
seek($f, int $position)
Seek a given position within a file handle.
setParameters(array $parameters)
Set the parameters from the associative array produced by $this->getParameters(). ...
getParameters()
Get the filestore&#39;s creation parameters as an associative array.
getFilenameOnFilestore(\ElggFile $file)
Return the filename of a given file as stored on the filestore.
if(!$item instanceof\ElggEntity) $length
Definition: excerpt.php:16
if(empty($count)) $offset
Definition: pagination.php:26
read($f, int $length, int $offset=0)
Read data from a filestore.
grabFile(\ElggFile $file)
Get the contents of the whole file.
if(!$entity instanceof\ElggUser) $data
Definition: attributes.php:13
write($f, string $data)
Write data to a given file handle.
getFileSize(\ElggFile $file)
Return the size in bytes for a given file.
eof($f)
Return a whether the end of a file has been reached.
This class defines the interface for all elgg data repositories.
Definition: Filestore.php:8
exists(\ElggFile $file)
Return whether a file physically exists or not.
tell($f)
Return the current position in an open file.
close($f)
Close a given file handle.
open(\ElggFile $file, string $mode)
Attempt to open the file $file for storage or writing.