IMP_Compose_Attachment_Storage_VfsLinked
extends IMP_Compose_Attachment_Storage
in package
implements
IMP_Compose_Attachment_Linked
VFS implementation for attachment data storage that will be stored/served from the VFS backend (i.e. linked attachment).
Tags
Table of Contents
Interfaces
- IMP_Compose_Attachment_Linked
- Interface for storage backends that support linked attachments.
Constants
- METADATA_NAME = 'metadata'
- VFS_LINK_ATTACH_PATH = '.horde/imp/attachments'
Properties
- $link_url : Horde_Url
- $linked : bool
- $_id : string
- Attachment identifier.
- $_md : array<string|int, mixed>
- Cached metadata information.
- $_tmpfile : string
- Temporary file location.
- $_user : string
- Attachment owner.
- $_vfs : Horde_Core_HashTable_Vfs
- VFS storage object.
- $_vfspath : string
- VFS link attach path.
Methods
- __construct() : mixed
- Constructor.
- __get() : mixed
- delete() : mixed
- Delete data from storage.
- exists() : bool
- Does the attachment exist in the storage backend?
- gc() : mixed
- Garbage collection.
- getMetadata() : IMP_Compose_Linked_Metadata
- Return metadata about attachment.
- getTempFile() : string
- Writes attachment data to a temporary file.
- read() : Horde_Stream
- Read attachment data from storage.
- saveMetadata() : mixed
- Save attachment metadata.
- write() : mixed
- Write attachment to storage.
- _getMetadata() : mixed
- Load metadata into cache.
- _read() : mixed
- _saveMetadata() : mixed
- Saves metadata.
- _write() : mixed
Constants
METADATA_NAME
public
mixed
METADATA_NAME
= 'metadata'
VFS_LINK_ATTACH_PATH
public
mixed
VFS_LINK_ATTACH_PATH
= '.horde/imp/attachments'
Properties
$link_url read-only
public
Horde_Url
$link_url
The URL, if the attachment is linked.
$linked read-only
public
bool
$linked
Can this attachment be linked?
$_id
Attachment identifier.
protected
string
$_id
$_md
Cached metadata information.
protected
array<string|int, mixed>
$_md
$_tmpfile
Temporary file location.
protected
string
$_tmpfile
$_user
Attachment owner.
protected
string
$_user
$_vfs
VFS storage object.
protected
Horde_Core_HashTable_Vfs
$_vfs
$_vfspath
VFS link attach path.
protected
string
$_vfspath
Methods
__construct()
Constructor.
public
__construct(mixed $user[, mixed $id = null ]) : mixed
Parameters
- $user : mixed
-
Attachment owner.
- $id : mixed = null
-
Attachment identifier.
__get()
public
__get(mixed $name) : mixed
Parameters
- $name : mixed
delete()
Delete data from storage.
public
delete() : mixed
exists()
Does the attachment exist in the storage backend?
public
exists() : bool
Return values
bool —True if the file exists.
gc()
Garbage collection.
public
gc() : mixed
getMetadata()
Return metadata about attachment.
public
getMetadata() : IMP_Compose_Linked_Metadata
Return values
IMP_Compose_Linked_Metadata —Metadata object.
getTempFile()
Writes attachment data to a temporary file.
public
getTempFile() : string
Tags
Return values
string —Temporary file path.
read()
Read attachment data from storage.
public
read() : Horde_Stream
Tags
Return values
Horde_Stream —Stream object containing data.
saveMetadata()
Save attachment metadata.
public
saveMetadata([mixed $md = null ]) : mixed
Parameters
- $md : mixed = null
-
Metadata object. Null will clear all metadata.
write()
Write attachment to storage.
public
write(string $filename, Horde_Mime_Part $part) : mixed
Parameters
- $filename : string
-
Filename containing attachment data.
- $part : Horde_Mime_Part
-
Mime part object containing attachment metadata.
Tags
_getMetadata()
Load metadata into cache.
protected
_getMetadata() : mixed
_read()
protected
_read() : mixed
_saveMetadata()
Saves metadata.
protected
_saveMetadata() : mixed
_write()
protected
_write(mixed $filename, Horde_Mime_Part $part) : mixed
Parameters
- $filename : mixed
- $part : Horde_Mime_Part