Methods |
public
|
__construct(string|null $storagePath = null, string|null $systemSecret = null)
FileStorage constructor.
Parameters
$storagePath |
filesystem path to storage (without trailing slash)
|
$systemSecret |
prefix unique to this system
|
|
#
|
protected
|
fileName(string $name): string
Fetch key data by name
|
#
|
protected
|
generateSystemSecret(): string
Construct a string related to the system to make name less predictable
Construct a string related to the system to make name less predictable
|
#
|
public
|
save(string $name, string $data): boolean
Save key data by name
Parameters
$name |
key name
|
$data |
key data, serialized to string if required
|
Returns
true if key saved, otherwise false
Implements
|
#
|
public
|
fetch(string $name): string|false
Fetch key data by name
Parameters
Returns
key data (possibly serialized) or false on error
Implements
|
#
|
public
|
exists(string $name): boolean
Check if key data exists
Parameters
Returns
true if key exists, otherwise false
Implements
|
#
|
public
|
delete(string $name): boolean
Delete a key
Parameters
Returns
true if key deleted, otherwise false
Implements
|
#
|