36 if (!$directory_root) {
67 if (($mode ===
'read') && (!file_exists($fullname))) {
72 if ($mode ==
'write' || $mode ==
'append') {
75 }
catch (\Exception $e) {
95 return fopen($fullname, $mode);
107 return fwrite($f,
$data);
124 return fread($f, $length);
146 public function delete(
\ElggFile $file,
bool $follow_symlinks =
true):
bool {
169 return fseek($f, $position);
179 public function tell($f): int|false {
190 public function eof($f): bool {
218 if (!empty($file->guid) && $file->
getSubtype() ===
'file') {
270 return file_exists($real_filename);
282 if (file_exists($dirroot)) {
287 if (!@mkdir($dirroot, 0755,
true)) {
288 $last_error = error_get_last();
295 throw new IOException(
"Couldn't create directory: {$dirroot}{$message}");
319 if (isset($parameters[
'dir_root'])) {
getSubtype()
Get the entity subtype.
close($f)
Close a file pointer.
Exception thrown if an argument is not of the expected type.
seek($f, int $position)
Seek to the specified position.
$mode
Configure site maintenance mode.
An IO Exception, throw when an IO Exception occurs.
if(!$item instanceof\ElggEntity) $length
read($f, int $length, int $offset=0)
Read data from a file.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
Exception thrown if a value does not adhere to a defined valid data domain.
grabFile(\ElggFile $file)
Returns the contents of the file.
__construct($directory_root= '')
Construct a disk filestore using the given directory root.
A filestore that uses disk as storage.
setParameters(array $parameters)
Sets parameters that should be saved to database.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
getFilenameOnFilestore()
Return the filename of this file as it is/will be stored on the filestore, which may be different to ...
if(!$entity instanceof\ElggUser) $data
const BUCKET_SIZE
Number of entries per matrix dir.
getFilename()
Return the filename.
makeDirectoryRoot($dirroot)
Create a directory $dirroot.
This class defines the interface for all elgg data repositories.
tell($f)
Return the current location of the internal pointer.
exists(\ElggFile $file)
Tests if an file exists.
getFileSize(\ElggFile $file)
Returns the file size of an file.
getFilenameOnFilestore(\ElggFile $file)
Get the filename as saved on disk for an object.
write($f, $data)
Write data to a file.
static sanitize($path, $append_slash=true)
Sanitize file paths ensuring that they begin and end with slashes etc.
_elgg_services()
Get the global service provider.
getParameters()
Returns a list of attributes to save to the database when saving the object using this file store...
eof($f)
Tests for end of file on a file pointer.
open(\ElggFile $file, string $mode)
Open a file for reading, writing, or both.