File storage and archiving.
More...
|
| | name ($type, $id) |
| | Filename for a file. More...
|
| |
| | exists ($type, $id) |
| | Check if a file exists. More...
|
| |
| | save ($type, $id, $data) |
| | Save date into a file (archive existing file first). More...
|
| |
| | delete ($type, $id) |
| | Delete a file (archive first). More...
|
| |
| | archives ($type, $id, $time=null) |
| | Find archive files. More...
|
| |
| | purge ($type, $time) |
| | Purge the archive. More...
|
| |
| | purgeAll () |
| | Purge archive for all types with an optional "purge" parameter. More...
|
| |
| | __construct ($fred, $config=null) |
| |
| | __destruct () |
| |
| | clientConfig () |
| | Public configuration. More...
|
| |
| | config ($key, $default=null) |
| | Retrieve a config value. More...
|
| |
| | ping () |
| | Ping function. More...
|
| |
| | filemtime ($filename) |
| | Filemtime with session cache. More...
|
| |
| | component ($name) |
| | Get a component (local or default). More...
|
| |
| | components (... $names) |
| | Get multiple components in an array. More...
|
| |
| | propertyExists ($property) |
| | Check if a property exists (public or published). More...
|
| |
| | constants ($prefix=null) |
| | Return all constants. More...
|
| |
| | get ($key) |
| | Get one or more properties. More...
|
| |
| | set ($key, $value=null) |
| | Set one or more properties. More...
|
| |
| | __get ($key) |
| |
| | __set ($key, $value) |
| |
|
| | format ($format, $id, $index=null, $time=null) |
| |
| | archive ($type, $id, &$filename=null) |
| | Archive a file (if it exists). More...
|
| |
| | find ($dir, $dirs, $time=null) |
| | Find archive files in a directory. More...
|
| |
| | init () |
| |
| | done () |
| |
| | getSession () |
| |
| | publish ($property, $visibility=self::READABLE) |
| | Publish a property (or hide it again). More...
|
| |
| | alias ($alias, $property, $object=null) |
| | Define an alias for a property (of another object). More...
|
| |
| | configure ($config) |
| | Configure the object. More...
|
| |
| | _get ($key) |
| | Default getter if no specific setter is defined, and the property is also not published (readable). More...
|
| |
| | _set ($key, $value) |
| | Default setter if no specific setter is defined, and the property is also not published (writeable). More...
|
| |
File storage and archiving.
Definition at line 8 of file File.php.
◆ archive()
| archive |
( |
|
$type, |
|
|
|
$id, |
|
|
& |
$filename = null |
|
) |
| |
|
protected |
Archive a file (if it exists).
- Parameters
-
| string | $type | File type. |
| string | $id | File ID. |
| string | $filename | Filename for the current file. |
- Returns
- string Archive filename (null if archive not set; false if no current file or error).
Definition at line 53 of file File.php.
◆ archives()
| archives |
( |
|
$type, |
|
|
|
$id, |
|
|
|
$time = null |
|
) |
| |
Find archive files.
- Parameters
-
| string | $type | File type. |
| string | $id | File ID. |
| int | $time | Only select files older than this timestamp (empty = no filter). |
- Returns
- array Archive files found (null if archive not set).
Definition at line 120 of file File.php.
◆ delete()
Delete a file (archive first).
- Parameters
-
- Returns
- bool True if file does not exist afterwards.
Definition at line 87 of file File.php.
◆ exists()
Check if a file exists.
- Parameters
-
- Returns
- bool True if the file exists.
Definition at line 43 of file File.php.
◆ find()
| find |
( |
|
$dir, |
|
|
|
$dirs, |
|
|
|
$time = null |
|
) |
| |
|
protected |
Find archive files in a directory.
- Parameters
-
| string | $dir | Directory to scan. |
| array | $dirs | Directory filters for sub-directories. |
| int | $time | Only select files older than this timestamp (empty = no filter). |
- Returns
- array Key = full name, value = info
Definition at line 99 of file File.php.
◆ format()
| format |
( |
|
$format, |
|
|
|
$id, |
|
|
|
$index = null, |
|
|
|
$time = null |
|
) |
| |
|
protected |
◆ name()
Filename for a file.
- Parameters
-
- Returns
- string Filename.
Definition at line 34 of file File.php.
◆ purge()
Purge the archive.
- Parameters
-
| string | $type | File type. |
| int | $time | Purge files older than this timestamp. |
- Returns
- int Number if files purged (null if archive not set).
Definition at line 143 of file File.php.
◆ purgeAll()
Purge archive for all types with an optional "purge" parameter.
- Returns
- int Number if files purged.
Definition at line 153 of file File.php.
◆ save()
| save |
( |
|
$type, |
|
|
|
$id, |
|
|
|
$data |
|
) |
| |
Save date into a file (archive existing file first).
- Parameters
-
| string | $type | File type. |
| string | $id | File ID. |
| string | $data | Data to save. |
- Returns
- int Number of bytes written or false on error.
Definition at line 74 of file File.php.
◆ $_indexBase
Index starting value.
Definition at line 16 of file File.php.
◆ $_indexSize
Minimum index length (prefixed with zeros when smaller).
Definition at line 17 of file File.php.
◆ $_types
Key = type name, value = array with 'format' and optional 'archive' format. An asterisk is.
Definition at line 18 of file File.php.
◆ $mode
◆ EVENT_ARCHIVE
| const EVENT_ARCHIVE = 'file:archive' |
◆ EVENT_DELETE
| const EVENT_DELETE = 'file:delete' |
◆ EVENT_SAVE
| const EVENT_SAVE = 'file:save' |
The documentation for this class was generated from the following file:
- /var/www/fred.local/vendor/rsi/fred/src/Rsi/Fred/File.php