Horde_Core_Factory_Prefs
extends Horde_Core_Factory_Base
in package
A Horde_Injector:: based Horde_Prefs:: factory.
Copyright 2010-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Tags
Table of Contents
Properties
- $storage : Horde_Prefs_Storage
- Storage driver.
- $_injector : Horde_Injector
- The injector.
- $_instances : array<string|int, mixed>
- Instances.
Methods
- __construct() : mixed
- Constructor.
- clearCache() : mixed
- Clears the instances cache.
- create() : Horde_Prefs
- Return the Horde_Prefs:: instance.
- sizeCallback() : bool
- Max size callback.
- _getCache() : Horde_Prefs_Cache_HordeCache
- Return the cache object to use for the prefs driver.
- _getDriverName() : string
- Return the classname of the driver to load.
- _notifyError() : mixed
- Notifies (once) if one of the preference backends is not available and logs details for the administrator.
Properties
$storage
Storage driver.
public
Horde_Prefs_Storage
$storage
Tags
$_injector
The injector.
protected
Horde_Injector
$_injector
$_instances
Instances.
private
array<string|int, mixed>
$_instances
= array()
Methods
__construct()
Constructor.
public
__construct(Horde_Injector $injector) : mixed
Parameters
- $injector : Horde_Injector
-
The injector to use.
clearCache()
Clears the instances cache.
public
clearCache() : mixed
create()
Return the Horde_Prefs:: instance.
public
create([string $scope = 'horde' ][, array<string|int, mixed> $opts = array() ]) : Horde_Prefs
Parameters
- $scope : string = 'horde'
-
The scope for this set of preferences.
- $opts : array<string|int, mixed> = array()
-
See Horde_Prefs::__construct(). Additional parameters:
- driver: (boolean) Use this driver instead of the value in the Horde config.
- driver_params: (array) Use these driver parameters instead of the values in the Horde config.
Return values
Horde_Prefs —The singleton instance.
sizeCallback()
Max size callback.
public
sizeCallback(string $pref, int $size) : bool
Parameters
- $pref : string
-
Preference name.
- $size : int
-
Size (in bytes).
Return values
bool —True if oversized.
_getCache()
Return the cache object to use for the prefs driver.
protected
_getCache(string $user, bool $fallback) : Horde_Prefs_Cache_HordeCache
Parameters
- $user : string
-
Username.
- $fallback : bool
-
Return the fallback cache driver?
Return values
Horde_Prefs_Cache_HordeCache —Cache object.
_getDriverName()
Return the classname of the driver to load.
protected
_getDriverName(string $driver, string $base) : string
Parameters
- $driver : string
-
Driver name.
- $base : string
-
The base classname.
Tags
Return values
string —Classname.
_notifyError()
Notifies (once) if one of the preference backends is not available and logs details for the administrator.
protected
_notifyError(mixed $e) : mixed
Parameters
- $e : mixed
-
Error to log.