Horde_Prefs_Storage_File
extends Horde_Prefs_Storage_Base
in package
Preferences storage implementation using files in a directory
Tags
Table of Contents
- VERSION = 2
- $_fileCache : array<string|int, mixed>
- Cached unserialized data of all scopes.
- $_fullpath : string
- Full path to the current preference file.
- $_params : string
- Configuration parameters.
- __construct() : mixed
- Constructor.
- get() : Horde_Prefs_Scope
- Retrieves the requested preferences scope from the storage backend.
- getParams() : array<string|int, mixed>
- Get the list of driver parameters.
- listScopes() : array<string|int, mixed>
- Lists all available scopes.
- onChange() : mixed
- Called whenever a preference value is changed.
- remove() : mixed
- Removes preferences from the backend.
- store() : mixed
- Stores changed preferences in the storage backend.
- updateFileFormat() : mixed
- Updates format of file.
- _loadFileCache() : bool
- Load the preferences from the files.
Constants
VERSION
public
mixed
VERSION
= 2
Properties
$_fileCache
Cached unserialized data of all scopes.
protected
array<string|int, mixed>
$_fileCache
= \null
$_fullpath
Full path to the current preference file.
protected
string
$_fullpath
$_params
Configuration parameters.
protected
string
$_params
= array()
'user' is always available as an entry.
Methods
__construct()
Constructor.
public
__construct(string $user[, array<string|int, mixed> $params = array() ]) : mixed
Parameters
- $user : string
-
The username.
- $params : array<string|int, mixed> = array()
-
Configuration parameters:
'directory' - (string) [REQUIRED] Preference storage directory.
Tags
Return values
mixed —get()
Retrieves the requested preferences scope from the storage backend.
public
get(Horde_Prefs_Scope $scope_ob) : Horde_Prefs_Scope
Parameters
- $scope_ob : Horde_Prefs_Scope
-
The scope object.
Tags
Return values
Horde_Prefs_Scope —The modified scope object.
getParams()
Get the list of driver parameters.
public
getParams() : array<string|int, mixed>
Return values
array<string|int, mixed> —Driver parameters.
listScopes()
Lists all available scopes.
public
listScopes() : array<string|int, mixed>
Return values
array<string|int, mixed> —The list of scopes stored in the backend.
onChange()
Called whenever a preference value is changed.
public
onChange(string $scope, string $pref) : mixed
Parameters
- $scope : string
-
Scope specifier.
- $pref : string
-
The preference name.
Return values
mixed —remove()
Removes preferences from the backend.
public
remove([string $scope = null ][, string $pref = null ]) : mixed
Parameters
- $scope : string = null
-
The scope of the prefs to clear. If null, clears all scopes.
- $pref : string = null
-
The pref to clear. If null, clears the entire scope.
Tags
Return values
mixed —store()
Stores changed preferences in the storage backend.
public
store(Horde_Prefs_Scope $scope_ob) : mixed
Parameters
- $scope_ob : Horde_Prefs_Scope
-
The scope object.
Tags
Return values
mixed —updateFileFormat()
Updates format of file.
public
updateFileFormat() : mixed
Return values
mixed —_loadFileCache()
Load the preferences from the files.
protected
_loadFileCache() : bool
Tags
Return values
bool —True on success.