diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index e75eb35462f8cd6f72ca50ec830da3c0cb956a36..f55838eda94e7e29d90149e845300c7b9c58e654 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -455,6 +455,11 @@ $config = array( $sm->getServiceLocator()->get('VuFind\DateConverter') ); }, + 'multibackend' => function ($sm) { + return new \VuFind\ILS\Driver\MultiBackend( + $sm->getServiceLocator()->get('VuFind\Config') + ); + }, 'unicorn' => function ($sm) { return new \VuFind\ILS\Driver\Unicorn( $sm->getServiceLocator()->get('VuFind\DateConverter') diff --git a/module/VuFind/src/VuFind/ILS/Driver/MultiBackend.php b/module/VuFind/src/VuFind/ILS/Driver/MultiBackend.php index 16b112273194d27c0f86ce05af85e47a96de6b14..faad56af6d3acc818247f6ddac02698a1f81c58d 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/MultiBackend.php +++ b/module/VuFind/src/VuFind/ILS/Driver/MultiBackend.php @@ -28,8 +28,7 @@ */ namespace VuFind\ILS\Driver; -use VuFind\Config\Reader as ConfigReader, - VuFind\Exception\ILS as ILSException, +use VuFind\Exception\ILS as ILSException, Zend\ServiceManager\ServiceLocatorAwareInterface, Zend\ServiceManager\ServiceLocatorInterface; @@ -90,7 +89,6 @@ class MultiBackend extends AbstractBase implements ServiceLocatorAwareInterface */ protected $config = array(); - /** * The seperating values to be used for each ILS. * Not yet implemented @@ -98,6 +96,22 @@ class MultiBackend extends AbstractBase implements ServiceLocatorAwareInterface */ protected $delimiters = array(); + /** + * Configuration loader + * + * @var \VuFind\Config\PluginManager + */ + protected $configLoader; + + /** + * Constructor + * + * @param \VuFind\Config\PluginManager $configLoader Configuration loader + */ + public function __construct(\VuFind\Config\PluginManager $configLoader) + { + $this->configLoader = $configLoader; + } /** * Set the driver configuration. @@ -314,7 +328,7 @@ class MultiBackend extends AbstractBase implements ServiceLocatorAwareInterface { // Determine config file name based on class name: try { - $config = ConfigReader::getConfig($source); + $config = $this->configLoader->get($source); } catch (\Zend\Config\Exception\RuntimeException $e) { // Configuration loading failed; probably means file does not // exist -- just return an empty array in that case: