|
Elgg
Version 2.3
|
Public Member Functions | |
| __construct ($directory_root="") | |
| Construct a disk filestore using the given directory root. More... | |
| open (\ElggFile $file, $mode) | |
| Open a file for reading, writing, or both. More... | |
| write ($f, $data) | |
| Write data to a file. More... | |
| read ($f, $length, $offset=0) | |
| Read data from a file. More... | |
| close ($f) | |
| Close a file pointer. More... | |
| delete (\ElggFile $file, $follow_symlinks=true) | |
| Delete an \ElggFile file. More... | |
| seek ($f, $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... | |
| getSize ($prefix, $container_guid) | |
| Returns the size of all data stored under a directory in the disk store. 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 Attributes | |
| const | BUCKET_SIZE = 5000 |
| Number of entries per matrix dir. More... | |
Protected Member Functions | |
| makeDirectoryRoot ($dirroot) | |
| Create a directory $dirroot. More... | |
| makeFileMatrix ($guid) | |
| Deprecated methods. More... | |
Definition at line 11 of file ElggDiskFilestore.php.
| ElggDiskFilestore::__construct | ( | $directory_root = "" | ) |
Construct a disk filestore using the given directory root.
| string | $directory_root | Root directory, must end in "/" |
Definition at line 28 of file ElggDiskFilestore.php.
| ElggDiskFilestore::close | ( | $f | ) |
Close a file pointer.
| resource | $f | A file pointer resource |
Reimplemented from ElggFilestore.
Definition at line 130 of file ElggDiskFilestore.php.
| ElggDiskFilestore::delete | ( | \ElggFile | $file, |
$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 ElggFilestore.
Definition at line 141 of file ElggDiskFilestore.php.
| ElggDiskFilestore::eof | ( | $f | ) |
Tests for end of file on a file pointer.
| resource | $f | File pointer resource |
Reimplemented from ElggFilestore.
Definition at line 184 of file ElggDiskFilestore.php.
| ElggDiskFilestore::exists | ( | \ElggFile | $file | ) |
Tests if an \ElggFile file exists.
| \ElggFile | $file | File object |
Reimplemented from ElggFilestore.
Definition at line 248 of file ElggDiskFilestore.php.
| ElggDiskFilestore::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 |
| InvalidParameterException |
Reimplemented from ElggFilestore.
Definition at line 209 of file ElggDiskFilestore.php.
| ElggDiskFilestore::getFileSize | ( | \ElggFile | $file | ) |
Returns the file size of an \ElggFile file.
| \ElggFile | $file | File object |
Reimplemented from ElggFilestore.
Definition at line 195 of file ElggDiskFilestore.php.
| ElggDiskFilestore::getParameters | ( | ) |
Returns a list of attributes to save to the database when saving the \ElggFile object using this file store.
Reimplemented from ElggFilestore.
Definition at line 296 of file ElggDiskFilestore.php.
| ElggDiskFilestore::getSize | ( | $prefix, | |
| $container_guid | |||
| ) |
Returns the size of all data stored under a directory in the disk store.
| string | $prefix | The prefix to check under. |
| string | $container_guid | The guid of the entity whose data you want to check. |
Definition at line 263 of file ElggDiskFilestore.php.
| ElggDiskFilestore::grabFile | ( | \ElggFile | $file | ) |
Returns the contents of the \ElggFile file.
| \ElggFile | $file | File object |
Reimplemented from ElggFilestore.
Definition at line 237 of file ElggDiskFilestore.php.
|
protected |
Create a directory $dirroot.
| string | $dirroot | The full path of the directory to create |
| IOException |
Definition at line 280 of file ElggDiskFilestore.php.
|
protected |
Deprecated methods.
Construct a file path matrix for an entity.
| int | $guid | The guid of the entity to store the data under. |
Definition at line 330 of file ElggDiskFilestore.php.
| ElggDiskFilestore::open | ( | \ElggFile | $file, |
| $mode | |||
| ) |
Open a file for reading, writing, or both.
| \ElggFile | $file | The file to open |
| string | $mode | read, write, or append. |
| InvalidParameterException |
Reimplemented from ElggFilestore.
Definition at line 50 of file ElggDiskFilestore.php.
| ElggDiskFilestore::read | ( | $f, | |
| $length, | |||
$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 ElggFilestore.
Definition at line 115 of file ElggDiskFilestore.php.
| ElggDiskFilestore::seek | ( | $f, | |
| $position | |||
| ) |
Seek to the specified position.
| resource | $f | File resource |
| int | $position | Position in bytes |
Reimplemented from ElggFilestore.
Definition at line 162 of file ElggDiskFilestore.php.
| ElggDiskFilestore::setParameters | ( | array | $parameters | ) |
Sets parameters that should be saved to database.
| array | $parameters | Set parameters to save to DB for this filestore. |
Reimplemented from ElggFilestore.
Definition at line 307 of file ElggDiskFilestore.php.
| ElggDiskFilestore::tell | ( | $f | ) |
Return the current location of the internal pointer.
| resource | $f | File pointer resource |
Reimplemented from ElggFilestore.
Definition at line 173 of file ElggDiskFilestore.php.
| ElggDiskFilestore::write | ( | $f, | |
| $data | |||
| ) |
Write data to a file.
| resource | $f | File pointer resource |
| mixed | $data | The data to write. |
Reimplemented from ElggFilestore.
Definition at line 102 of file ElggDiskFilestore.php.
| const ElggDiskFilestore::BUCKET_SIZE = 5000 |
Number of entries per matrix dir.
You almost certainly don't want to change this.
Definition at line 21 of file ElggDiskFilestore.php.