|
Elgg
Version 6.3
|
A filestore that uses disk as storage. More...
Public Member Functions | |
| __construct ($directory_root='') | |
| Construct a disk filestore using the given directory root. More... | |
| open (\ElggFile $file, string $mode) | |
| Open a file for reading, writing, or both. More... | |
| write ($f, $data) | |
| Write data to a file. More... | |
| read ($f, int $length, int $offset=0) | |
| Read data from a file. More... | |
| close ($f) | |
| Close a file pointer. More... | |
| delete (\ElggFile $file, bool $follow_symlinks=true) | |
| Delete an \ElggFile file. More... | |
| seek ($f, int $position) | |
| Seek to the specified position. More... | |
| tell ($f) | |
| Return the current location of the internal pointer. More... | |
| eof ($f) | |
| Tests for end of file on a file pointer. More... | |
| getFileSize (\ElggFile $file) | |
| Returns the file size of an \ElggFile file. More... | |
| getFilenameOnFilestore (\ElggFile $file) | |
| Get the filename as saved on disk for an \ElggFile object. More... | |
| grabFile (\ElggFile $file) | |
| Returns the contents of the \ElggFile file. More... | |
| exists (\ElggFile $file) | |
| Tests if an \ElggFile file exists. More... | |
| getParameters () | |
| Returns a list of attributes to save to the database when saving the \ElggFile object using this file store. More... | |
| setParameters (array $parameters) | |
| Sets parameters that should be saved to database. More... | |
Public Member Functions inherited from Elgg\Filesystem\Filestore | |
| write ($f, string $data) | |
| Write data to a given file handle. More... | |
Public Attributes | |
| const | BUCKET_SIZE = 5000 |
| Number of entries per matrix dir. More... | |
Protected Member Functions | |
| makeDirectoryRoot ($dirroot) | |
| Create a directory $dirroot. More... | |
Protected Attributes | |
| $dir_root | |
A filestore that uses disk as storage.
Definition at line 17 of file DiskFilestore.php.
| Elgg\Filesystem\Filestore\DiskFilestore::__construct | ( | $directory_root = '' | ) |
Construct a disk filestore using the given directory root.
| string | $directory_root | Root directory, must end in "/" |
Reimplemented in Elgg\Filesystem\Filestore\TempDiskFilestore.
Definition at line 35 of file DiskFilestore.php.
| Elgg\Filesystem\Filestore\DiskFilestore::close | ( | $f | ) |
Close a file pointer.
| resource | $f | A file pointer resource |
Reimplemented from Elgg\Filesystem\Filestore.
Definition at line 134 of file DiskFilestore.php.
| Elgg\Filesystem\Filestore\DiskFilestore::delete | ( | \ElggFile | $file, |
| bool | $follow_symlinks = true |
||
| ) |
Delete an \ElggFile file.
| \ElggFile | $file | File to delete |
| bool | $follow_symlinks | If true, will also delete the target file if the current file is a symlink |
Reimplemented from Elgg\Filesystem\Filestore.
Definition at line 146 of file DiskFilestore.php.
| Elgg\Filesystem\Filestore\DiskFilestore::eof | ( | $f | ) |
Tests for end of file on a file pointer.
| resource | $f | File pointer resource |
Reimplemented from Elgg\Filesystem\Filestore.
Definition at line 190 of file DiskFilestore.php.
| Elgg\Filesystem\Filestore\DiskFilestore::exists | ( | \ElggFile | $file | ) |
Tests if an \ElggFile file exists.
| \ElggFile | $file | File object |
Reimplemented from Elgg\Filesystem\Filestore.
Definition at line 258 of file DiskFilestore.php.
| Elgg\Filesystem\Filestore\DiskFilestore::getFilenameOnFilestore | ( | \ElggFile | $file | ) |
Get the filename as saved on disk for an \ElggFile object.
Returns an empty string if no filename set
| \ElggFile | $file | File object |
| InvalidArgumentException |
Reimplemented from Elgg\Filesystem\Filestore.
Reimplemented in Elgg\Filesystem\Filestore\TempDiskFilestore.
Definition at line 215 of file DiskFilestore.php.
| Elgg\Filesystem\Filestore\DiskFilestore::getFileSize | ( | \ElggFile | $file | ) |
Returns the file size of an \ElggFile file.
| \ElggFile | $file | File object |
Reimplemented from Elgg\Filesystem\Filestore.
Definition at line 201 of file DiskFilestore.php.
| Elgg\Filesystem\Filestore\DiskFilestore::getParameters | ( | ) |
Returns a list of attributes to save to the database when saving the \ElggFile object using this file store.
Reimplemented from Elgg\Filesystem\Filestore.
Reimplemented in Elgg\Filesystem\Filestore\TempDiskFilestore.
Definition at line 305 of file DiskFilestore.php.
| Elgg\Filesystem\Filestore\DiskFilestore::grabFile | ( | \ElggFile | $file | ) |
Returns the contents of the \ElggFile file.
| \ElggFile | $file | File object |
Reimplemented from Elgg\Filesystem\Filestore.
Definition at line 247 of file DiskFilestore.php.
|
protected |
Create a directory $dirroot.
| string | $dirroot | The full path of the directory to create |
Definition at line 281 of file DiskFilestore.php.
| Elgg\Filesystem\Filestore\DiskFilestore::open | ( | \ElggFile | $file, |
| string | $mode | ||
| ) |
Open a file for reading, writing, or both.
| \ElggFile | $file | The file to open |
| string | $mode | read, write, or append. |
Reimplemented from Elgg\Filesystem\Filestore.
Definition at line 56 of file DiskFilestore.php.
| Elgg\Filesystem\Filestore\DiskFilestore::read | ( | $f, | |
| int | $length, | ||
| int | $offset = 0 |
||
| ) |
Read data from a file.
| resource | $f | File pointer resource |
| int | $length | The number of bytes to read |
| int | $offset | The number of bytes to start after |
Reimplemented from Elgg\Filesystem\Filestore.
Definition at line 119 of file DiskFilestore.php.
| Elgg\Filesystem\Filestore\DiskFilestore::seek | ( | $f, | |
| int | $position | ||
| ) |
Seek to the specified position.
| resource | $f | File resource |
| int | $position | Position in bytes |
Reimplemented from Elgg\Filesystem\Filestore.
Definition at line 168 of file DiskFilestore.php.
| Elgg\Filesystem\Filestore\DiskFilestore::setParameters | ( | array | $parameters | ) |
Sets parameters that should be saved to database.
| array | $parameters | Set parameters to save to DB for this filestore. |
Reimplemented from Elgg\Filesystem\Filestore.
Reimplemented in Elgg\Filesystem\Filestore\TempDiskFilestore.
Definition at line 318 of file DiskFilestore.php.
| Elgg\Filesystem\Filestore\DiskFilestore::tell | ( | $f | ) |
Return the current location of the internal pointer.
| resource | $f | File pointer resource |
Reimplemented from Elgg\Filesystem\Filestore.
Definition at line 179 of file DiskFilestore.php.
| Elgg\Filesystem\Filestore\DiskFilestore::write | ( | $f, | |
| $data | |||
| ) |
Write data to a file.
| resource | $f | File pointer resource |
| mixed | $data | The data to write. |
Definition at line 106 of file DiskFilestore.php.
|
protected |
Definition at line 22 of file DiskFilestore.php.
| const Elgg\Filesystem\Filestore\DiskFilestore::BUCKET_SIZE = 5000 |
Number of entries per matrix dir.
You almost certainly don't want to change this.
Definition at line 28 of file DiskFilestore.php.