Skip to content
Snippets Groups Projects
Commit 7d0373aa authored by Demian Katz's avatar Demian Katz
Browse files

Session plugin modernization.

- Renamed services.
- Moved configuration to plugin manager.
parent 15dc3248
No related merge requests found
......@@ -665,20 +665,7 @@ $config = [
'tags' => 'VuFind\Search\Results\Factory::getTags',
],
],
'session' => [
'abstract_factories' => ['VuFind\Session\PluginFactory'],
'invokables' => [
'database' => 'VuFind\Session\Database',
'file' => 'VuFind\Session\File',
'memcache' => 'VuFind\Session\Memcache',
],
'aliases' => [
// for legacy 1.x compatibility
'filesession' => 'File',
'memcachesession' => 'Memcache',
'mysqlsession' => 'Database',
],
]
'session' => [ /* see VuFind\Session\PluginManager for defaults */ ],
],
// This section behaves just like recorddriver_tabs below, but is used for
// the collection module instead of the standard record view.
......
......@@ -38,6 +38,48 @@ namespace VuFind\Session;
*/
class PluginManager extends \VuFind\ServiceManager\AbstractPluginManager
{
/**
* Default plugin aliases.
*
* @var array
*/
protected $aliases = [
'database' => 'VuFind\Session\Database',
'file' => 'VuFind\Session\File',
'memcache' => 'VuFind\Session\Memcache',
// for legacy 1.x compatibility
'filesession' => 'VuFind\Session\File',
'memcachesession' => 'VuFind\Session\Memcache',
'mysqlsession' => 'VuFind\Session\Database',
];
/**
* Default plugin factories.
*
* @var array
*/
protected $factories = [
'VuFind\Session\Database' => 'Zend\ServiceManager\Factory\InvokableFactory',
'VuFind\Session\File' => 'Zend\ServiceManager\Factory\InvokableFactory',
'VuFind\Session\Memcache' => 'Zend\ServiceManager\Factory\InvokableFactory',
];
/**
* Constructor
*
* Make sure plugins are properly initialized.
*
* @param mixed $configOrContainerInstance Configuration or container instance
* @param array $v3config If $configOrContainerInstance is a
* container, this value will be passed to the parent constructor.
*/
public function __construct($configOrContainerInstance = null,
array $v3config = []
) {
$this->addAbstractFactory('VuFind\Session\PluginFactory');
parent::__construct($configOrContainerInstance, $v3config);
}
/**
* Return the name of the base class or interface that plug-ins must conform
* to.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment