Documentation

Storage
in package
implements EphemeralStorageInterface

FinalYes

Legacy cache and remote loading facade.

Included for historical compatibility only. This API is out of support and should not be used in new code.

Tags
author

Daniel Schulz

since
2014-07-25

Table of Contents

Interfaces

EphemeralStorageInterface
Storage backend for named payloads that expire by modification time.

Properties

$cleanseTime  : int
$dbmsTable  : Table|null
$dbName  : string
$dom  : DOMHelper
$now  : int
$storageList  : array<string|int, mixed>
$tableName  : string
$touchList  : array<string|int, mixed>

Methods

__construct()  : mixed
__destruct()  : void
_getStorageNameFromURI()  : string
cleanse()  : void
clearExternalDocument()  : bool
cron()  : bool
delete()  : bool
exists()  : bool
getLogDirectory()  : string
getLogEnabled()  : bool
getTouchOnExit()  : bool
install()  : void
loadExternalDocument()  : DOMDocument|null
loadExternalFile()  : string|null
loadExternalHeader()  : array<string|int, mixed>|null
loadExternalJSON()  : mixed|null
loadExternalXPath()  : DOMXPath|null
loadStorage()  : EphemeralStorageInterface
retrieve()  : mixed|null
retrieveDocument()  : DOMDocument|null
retrieveJSON()  : mixed
retrieveXML()  : DOMNode|null
sendTouch()  : void
setLogDirectory()  : void
setLogEnabled()  : void
setTouchOnExit()  : void
store()  : bool
storeDocument()  : bool
storeJSON()  : bool
storeXML()  : bool
_createLog()  : void
_DOMHelper()  : DOMHelper
_getHostFromURI()  : mixed
_getSchemeFromURI()  : mixed
_getStorageByURI()  : EphemeralStorageInterface
_hash()  : string
_httpOAuth()  : string
_httpOptions()  : void
_httpRequest()  : XMLHttpRequest
_name()  : string
_randomCheck()  : bool
randomly force-download an already existing resource
getDBMSTable()  : Table
touch()  : void

Properties

$cleanseTime

protected int $cleanseTime

$dbName

protected string $dbName = 'storage'

$storageList

protected static array<string|int, mixed> $storageList = []

$tableName

protected string $tableName = 'default'

$touchList

protected array<string|int, mixed> $touchList

Methods

__construct()

public __construct([mixed $storageName = null ]) : mixed
Parameters
$storageName : mixed = null

__destruct()

public __destruct() : void

_getStorageNameFromURI()

public static _getStorageNameFromURI(mixed $uri) : string
Parameters
$uri : mixed
Tags
throws
Exception
Return values
string

clearExternalDocument()

public static clearExternalDocument(string $uri[, int $cacheTime = null ][, mixed $data = null ][, mixed $options = null ]) : bool
Parameters
$uri : string
$cacheTime : int = null
$data : mixed = null
$options : mixed = null
Tags
throws
Exception
Return values
bool

cron()

public cron() : bool
Return values
bool

delete()

public delete(string $name) : bool
Parameters
$name : string
Return values
bool

exists()

public exists(string $name, int $modifyTime) : bool
Parameters
$name : string
$modifyTime : int
Return values
bool

getLogDirectory()

public static getLogDirectory() : string
Return values
string

getLogEnabled()

public static getLogEnabled() : bool
Return values
bool

getTouchOnExit()

public static getTouchOnExit() : bool
Return values
bool

loadExternalDocument()

public static loadExternalDocument(string $uri[, int $cacheTime = null ][, mixed $data = null ][, mixed $options = null ]) : DOMDocument|null
Parameters
$uri : string
$cacheTime : int = null
$data : mixed = null
$options : mixed = null
Tags
throws
Exception
Return values
DOMDocument|null

loadExternalFile()

public static loadExternalFile(string $uri[, int $cacheTime = null ][, mixed $data = null ][, mixed $options = null ]) : string|null
Parameters
$uri : string
$cacheTime : int = null
$data : mixed = null
$options : mixed = null
Tags
throws
Exception
Return values
string|null

loadExternalHeader()

public static loadExternalHeader(string $uri[, int $cacheTime = null ][, mixed $data = null ][, mixed $options = null ]) : array<string|int, mixed>|null
Parameters
$uri : string
$cacheTime : int = null
$data : mixed = null
$options : mixed = null
Tags
throws
Exception
Return values
array<string|int, mixed>|null

loadExternalJSON()

public static loadExternalJSON(string $uri[, int $cacheTime = null ][, mixed $data = null ][, mixed $options = null ]) : mixed|null
Parameters
$uri : string
$cacheTime : int = null
$data : mixed = null
$options : mixed = null
Tags
throws
Exception
Return values
mixed|null

loadExternalXPath()

public static loadExternalXPath(string $uri[, int $cacheTime = null ][, mixed $data = null ][, mixed $options = null ]) : DOMXPath|null
Parameters
$uri : string
$cacheTime : int = null
$data : mixed = null
$options : mixed = null
Tags
throws
Exception
Return values
DOMXPath|null

retrieve()

public retrieve(string $name, int $modifyTime) : mixed|null
Parameters
$name : string
$modifyTime : int
Return values
mixed|null

retrieveDocument()

public retrieveDocument(string $name, int $modifyTime) : DOMDocument|null
Parameters
$name : string
$modifyTime : int
Return values
DOMDocument|null

retrieveJSON()

public retrieveJSON(string $name, int $modifyTime) : mixed
Parameters
$name : string
$modifyTime : int
Tags
throws
Exception

retrieveXML()

public retrieveXML(string $name, int $modifyTime[, DOMDocument|null $targetDoc = null ]) : DOMNode|null
Parameters
$name : string
$modifyTime : int
$targetDoc : DOMDocument|null = null
Return values
DOMNode|null

sendTouch()

public sendTouch() : void

setLogDirectory()

public static setLogDirectory(string $directory) : void
Parameters
$directory : string

setLogEnabled()

public static setLogEnabled(bool $value) : void
Parameters
$value : bool

setTouchOnExit()

public static setTouchOnExit(bool $value) : void
Parameters
$value : bool

store()

public store(string $name, string $payload, int $modifyTime) : bool
Parameters
$name : string
$payload : string
$modifyTime : int
Return values
bool

storeDocument()

public storeDocument(string $name, DOMDocument $dataDoc, int $modifyTime) : bool
Parameters
$name : string
$dataDoc : DOMDocument
$modifyTime : int
Return values
bool

storeJSON()

public storeJSON(string $name, mixed $dataObject, int $modifyTime) : bool
Parameters
$name : string
$dataObject : mixed
$modifyTime : int
Return values
bool

storeXML()

public storeXML(string $name, DOMNode $dataNode, int $modifyTime) : bool
Parameters
$name : string
$dataNode : DOMNode
$modifyTime : int
Return values
bool

_createLog()

protected _createLog(mixed $method, mixed $name, mixed $ret) : void
Parameters
$method : mixed
$name : mixed
$ret : mixed

_getHostFromURI()

protected static _getHostFromURI(mixed $uri) : mixed
Parameters
$uri : mixed

_getSchemeFromURI()

protected static _getSchemeFromURI(mixed $uri) : mixed
Parameters
$uri : mixed

_hash()

protected static _hash(string $name) : string
Parameters
$name : string
Return values
string

_httpOAuth()

protected static _httpOAuth(array<string|int, mixed> $options, string $uri) : string
Parameters
$options : array<string|int, mixed>
$uri : string
Return values
string

_httpOptions()

protected static _httpOptions(mixed &$options) : void
Parameters
$options : mixed

_httpRequest()

protected static _httpRequest(array<string|int, mixed> $options, mixed $uri, mixed $data) : XMLHttpRequest
Parameters
$options : array<string|int, mixed>
$uri : mixed
$data : mixed
Tags
throws
Exception
Return values
XMLHttpRequest

_name()

protected static _name(array<string|int, mixed> $options, mixed $uri, mixed $data) : string
Parameters
$options : array<string|int, mixed>
$uri : mixed
$data : mixed
Return values
string

_randomCheck()

randomly force-download an already existing resource

protected static _randomCheck() : bool
Return values
bool

touch()

protected touch(int $id) : void
Parameters
$id : int
On this page

Search results