API - XOOPS 2.5.11 Beta 2
By monxoops.fr
FileStorage Class Reference
Inheritance diagram for FileStorage:
Collaboration diagram for FileStorage:

Public Member Functions

 __construct ($storagePath=null, $systemSecret=null)
 
 save ($name, $data)
 
 fetch ($name)
 
 exists ($name)
 
 delete ($name)
 
 save ($name, $data)
 
 fetch ($name)
 
 exists ($name)
 
 delete ($name)
 

Protected Member Functions

 fileName ($name)
 
 generateSystemSecret ()
 

Protected Attributes

 $storagePath
 
 $systemSecret
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $storagePath = null,
  $systemSecret = null 
)

FileStorage constructor.

Parameters
string | null$storagePathfilesystem path to storage (without trailing slash)
string | null$systemSecretprefix unique to this system
Here is the call graph for this function:

Member Function Documentation

◆ delete()

delete (   $name)

Delete a key

Parameters
string$namekey name
Returns
boolean true if key deleted, otherwise false

Implements StorageInterface.

Here is the call graph for this function:

◆ exists()

exists (   $name)

Check if key data exists

Parameters
string$namekey name
Returns
boolean true if key exists, otherwise false

Implements StorageInterface.

Here is the call graph for this function:

◆ fetch()

fetch (   $name)

Fetch key data by name

Parameters
string$namekey name
Returns
string|false key data (possibly serialized) or false on error

Implements StorageInterface.

Here is the call graph for this function:

◆ fileName()

fileName (   $name)
protected

Fetch key data by name

Parameters
string$namekey name
Returns
string file name
Here is the caller graph for this function:

◆ generateSystemSecret()

generateSystemSecret ( )
protected

Construct a string related to the system to make name less predictable

Returns
string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ save()

save (   $name,
  $data 
)

Save key data by name

Parameters
string$namekey name
string$datakey data, serialized to string if required
Returns
boolean true if key saved, otherwise false

Implements StorageInterface.

Field Documentation

◆ $storagePath

$storagePath
protected

◆ $systemSecret

$systemSecret
protected

The documentation for this class was generated from the following file: