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

Inject configuration reader.

parent 726e3a0c
No related merge requests found
......@@ -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')
......
......@@ -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:
......
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