\Horde_Prefs_Storage_File

Preferences storage implementation using files in a directory

Summary

Methods
Properties
Constants
__construct()
getParams()
get()
store()
onChange()
remove()
listScopes()
updateFileFormat()
No public properties found
VERSION
_loadFileCache()
$_params
$_fileCache
$_fullpath
N/A
No private methods found
No private properties found
N/A

Constants

VERSION

VERSION

Properties

$_params

$_params : string

Configuration parameters.

'user' is always available as an entry.

Type

string

$_fileCache

$_fileCache : array

Cached unserialized data of all scopes.

Type

array

$_fullpath

$_fullpath : string

Full path to the current preference file.

Type

string

Methods

__construct()

__construct(string  $user, array  $params = array()) 

Constructor.

Parameters

string $user

The username.

array $params

Configuration parameters:

'directory' - (string) [REQUIRED] Preference storage directory.

Throws

\InvalidArgumentException

getParams()

getParams() : array

Get the list of driver parameters.

Returns

array —

Driver parameters.

get()

get(\Horde_Prefs_Scope  $scope_ob) : \Horde_Prefs_Scope

Retrieves the requested preferences scope from the storage backend.

Parameters

\Horde_Prefs_Scope $scope_ob

The scope object.

Throws

\Horde_Prefs_Exception

Returns

\Horde_Prefs_Scope

The modified scope object.

store()

store(\Horde_Prefs_Scope  $scope_ob) 

Stores changed preferences in the storage backend.

Parameters

\Horde_Prefs_Scope $scope_ob

The scope object.

Throws

\Horde_Prefs_Exception

onChange()

onChange(string  $scope, string  $pref) 

Called whenever a preference value is changed.

Parameters

string $scope

Scope specifier.

string $pref

The preference name.

remove()

remove(string  $scope = null, string  $pref = null) 

Removes preferences from the backend.

Parameters

string $scope

The scope of the prefs to clear. If null, clears all scopes.

string $pref

The pref to clear. If null, clears the entire scope.

Throws

\Horde_Db_Exception

listScopes()

listScopes() : array

Lists all available scopes.

Returns

array —

The list of scopes stored in the backend.

updateFileFormat()

updateFileFormat() 

Updates format of file.

_loadFileCache()

_loadFileCache() : boolean

Load the preferences from the files.

Throws

\Horde_Prefs_Exception

Returns

boolean —

True on success.