32 if (!$directory_root) {
36 $this->dir_root = Paths::sanitize($directory_root);
63 if ((
$mode ===
'read') && (!file_exists($fullname))) {
72 _elgg_services()->logger->warning(
"Couldn't create directory: {$path}");
91 return fopen($fullname,
$mode);
103 return fwrite($f,
$data);
142 public function delete(
\ElggFile $file, $follow_symlinks =
true) {
227 return Paths::sanitize($this->dir_root . $dir . $file->
getFilename(),
false);
260 return file_exists($real_filename);
275 return get_dir_size(Paths::sanitize($this->dir_root . $dir . $prefix));
290 if (!file_exists($dirroot)) {
291 if (!@mkdir($dirroot, 0755,
true)) {
292 throw new IOException(
"Could not make {$dirroot}");
319 if (isset($parameters[
'dir_root'])) {
320 $this->dir_root = Paths::sanitize($parameters[
'dir_root']);
eof($f)
Tests for end of file on a file pointer.
close($f)
Close a file pointer.
const BUCKET_SIZE
Number of entries per matrix dir.
$mode
Configure site maintenance mode.
An IO Exception, throw when an IO Exception occurs.
getFilenameOnFilestore(\ElggFile $file)
Get the filename as saved on disk for an object.
read($f, $length, $offset=0)
Read data from a file.
if(!$item instanceof ElggEntity) $length
open(\ElggFile $file, $mode)
Open a file for reading, writing, or both.
A filestore that uses disk as storage.
getFileSize(\ElggFile $file)
Returns the file size of an file.
get_dir_size($dir, $total_size=0)
Get the size of the specified directory.
if(elgg_trigger_plugin_hook('usersettings:save', 'user', $hooks_params, true)) foreach($request->validation() ->all() as $item) $data
__construct($directory_root= '')
Construct a disk filestore using the given directory root.
getFilenameOnFilestore()
Return the filename of this file as it is/will be stored on the filestore, which may be different to ...
makeDirectoryRoot($dirroot)
Create a directory $dirroot.
write($f, $data)
Write data to a file.
getFilename()
Return the filename.
getSize($prefix, $container_guid)
Returns the size of all data stored under a directory in the disk store.
grabFile(\ElggFile $file)
Returns the contents of the file.
setParameters(array $parameters)
Sets parameters that should be saved to database.
This class defines the interface for all elgg data repositories.
exists(\ElggFile $file)
Tests if an file exists.
_elgg_services()
Get the global service provider.
tell($f)
Return the current location of the internal pointer.
seek($f, $position)
Seek to the specified position.
getParameters()
Returns a list of attributes to save to the database when saving the object using this file store...