diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index 228d6116212a18a342a605021eae18f70f3a0e07..7e7114d2bd7a342dbbe5f44c80d8a8e69389de43 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -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. diff --git a/module/VuFind/src/VuFind/Session/PluginManager.php b/module/VuFind/src/VuFind/Session/PluginManager.php index 65c603da1ca6a3182f1ddca3cfa6c0e843bf3f11..ec5c485296a628ff0d6f138cc84844f2c09076d7 100644 --- a/module/VuFind/src/VuFind/Session/PluginManager.php +++ b/module/VuFind/src/VuFind/Session/PluginManager.php @@ -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.