\Horde_Core_Factory_Prefs

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.

Summary

Methods
Properties
Constants
__construct()
create()
clearCache()
sizeCallback()
$storage
No constants found
_getDriverName()
_notifyError()
_getCache()
$_injector
N/A
No private methods found
$_instances
N/A

Properties

$storage

$storage : \Horde_Prefs_Storage

Storage driver.

Type

\Horde_Prefs_Storage

$_injector

$_injector : \Horde_Injector

The injector.

Type

\Horde_Injector

$_instances

$_instances : array

Instances.

Type

array

Methods

__construct()

__construct(\Horde_Injector  $injector) 

Constructor.

Parameters

\Horde_Injector $injector

The injector to use.

create()

create(string  $scope = 'horde', array  $opts = array()) : \Horde_Prefs

Return the Horde_Prefs:: instance.

Parameters

string $scope

The scope for this set of preferences.

array $opts

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.

Returns

\Horde_Prefs —

The singleton instance.

clearCache()

clearCache() 

Clears the instances cache.

sizeCallback()

sizeCallback(string  $pref, integer  $size) : boolean

Max size callback.

Parameters

string $pref

Preference name.

integer $size

Size (in bytes).

Returns

boolean —

True if oversized.

_getDriverName()

_getDriverName(string  $driver, string  $base) : string

Return the classname of the driver to load.

Parameters

string $driver

Driver name.

string $base

The base classname.

Throws

\Horde_Exception

Returns

string —

Classname.

_notifyError()

_notifyError(mixed  $e) 

Notifies (once) if one of the preference backends is not available and logs details for the administrator.

Parameters

mixed $e

Error to log.

_getCache()

_getCache(string  $user, boolean  $fallback) : \Horde_Cache

Return the cache object to use for the prefs driver.

Parameters

string $user

Username.

boolean $fallback

Return the fallback cache driver?

Returns

\Horde_Cache —

Cache object.