\PrivateBin\PersistenceDataStore

DataStore

Handles data storage for Data\Filesystem.

Summary

Methods
Properties
Constants
setPath()
getPath()
store()
get()
prependRename()
No public properties found
PROTECTION_LINE
_exists()
_initialize()
_store()
No protected properties found
N/A
No private methods found
$_path
N/A

Constants

PROTECTION_LINE

PROTECTION_LINE

first line in file, to protect its contents

Properties

$_path

$_path : string

path in which to persist something

Type

string

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

store()

store(string  $filename, array  $data) : boolean

store the data

Parameters

string $filename
array $data

Returns

boolean

get()

get(string  $filename) : \PrivateBin\Persistence\stdClass|false

get the data

Parameters

string $filename

Returns

\PrivateBin\Persistence\stdClass|false —

$data

prependRename()

prependRename(string  $srcFile, string  $destFile, string  $prefix = '') : void

rename a file, prepending the protection line at the beginning

Parameters

string $srcFile
string $destFile
string $prefix

(optional)

_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