\PrivateBin\PersistencePurgeLimiter

PurgeLimiter

Handles purge limiting, so purging is not triggered too frequently.

Summary

Methods
Properties
Constants
setPath()
getPath()
setLimit()
setConfiguration()
canPurge()
No public properties found
No constants found
_exists()
_initialize()
_store()
No protected properties found
N/A
No private methods found
$_path
$_limit
N/A

Properties

$_path

$_path : string

path in which to persist something

Type

string

$_limit

$_limit : integer

time limit in seconds, defaults to 300s

Type

integer

Methods

setPath()

setPath(string  $path) 

set the path

Parameters

string $path

getPath()

getPath(string  $filename = null) : string

get the path

Parameters

string $filename

Returns

string

setLimit()

setLimit(integer  $limit) 

set the time limit in seconds

Parameters

integer $limit

setConfiguration()

setConfiguration(\PrivateBin\Configuration  $conf) 

set configuration options of the traffic limiter

Parameters

\PrivateBin\Configuration $conf

canPurge()

canPurge() : boolean

check if the purge can be performed

Throws

\PrivateBin\Persistence\Exception

Returns

boolean

_exists()

_exists(string  $filename) : boolean

checks if the file exists

Parameters

string $filename

Returns

boolean

_initialize()

_initialize() 

prepares path for storage

Throws

\Exception

_store()

_store(string  $filename, string  $data) : string

store the data

Parameters

string $filename
string $data

Throws

\Exception

Returns

string