From 2e8763cce4f4160de1a21d61f8016f558ae4be19 Mon Sep 17 00:00:00 2001 From: edelm Date: Wed, 7 Feb 2018 18:25:56 +0100 Subject: [PATCH] reverts changes in targetproxy --- module/Swissbib/src/Swissbib/TargetsProxy/Factory.php | 4 ++-- module/Swissbib/src/Swissbib/TargetsProxy/TargetsProxy.php | 6 +++--- .../SwissbibTest/TargetsProxy/TargetsProxyTestCase.php | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/module/Swissbib/src/Swissbib/TargetsProxy/Factory.php b/module/Swissbib/src/Swissbib/TargetsProxy/Factory.php index 181088d0c78..0b5b03f87ad 100644 --- a/module/Swissbib/src/Swissbib/TargetsProxy/Factory.php +++ b/module/Swissbib/src/Swissbib/TargetsProxy/Factory.php @@ -50,10 +50,10 @@ class Factory */ public static function getTargetsProxy(ServiceManager $sm) { - $config = $sm->get('VuFind\Config')->get('TargetsProxy'); + $configPluginManager = $sm->get('VuFind\Config'); return new TargetsProxy( - $config, + $configPluginManager, $sm->get('Swissbib\Logger'), $sm->get('Request') ); diff --git a/module/Swissbib/src/Swissbib/TargetsProxy/TargetsProxy.php b/module/Swissbib/src/Swissbib/TargetsProxy/TargetsProxy.php index db8aa05edb6..dadd128bace 100644 --- a/module/Swissbib/src/Swissbib/TargetsProxy/TargetsProxy.php +++ b/module/Swissbib/src/Swissbib/TargetsProxy/TargetsProxy.php @@ -114,7 +114,7 @@ public function __construct(Config $config, $this->logger = $logger; $trustedProxies = explode( ',', - $this->config->get('TrustedProxy')->get('loadbalancer') + $this->config->get('TargetsProxy')->get('TrustedProxy')->get('loadbalancer') ); // Populate client info properties from request @@ -224,7 +224,7 @@ public function detectTarget($overrideIP = '', $overrideHost = '') $targetKeys = explode( ',', - $this->config->get('TargetsProxy') + $this->config->get('TargetsProxy')->get('TargetsProxy') ->get('targetKeys' . $this->searchClass) ); @@ -251,7 +251,7 @@ public function detectTarget($overrideIP = '', $overrideHost = '') * * @var \Zend\Config\Config $targetConfig */ - $targetConfig = $this->config->get($targetKey); + $targetConfig = $this->config->get('TargetsProxy')->get($targetKey); $patternsIP = ''; $patternsURL = ''; diff --git a/module/Swissbib/tests/SwissbibTest/TargetsProxy/TargetsProxyTestCase.php b/module/Swissbib/tests/SwissbibTest/TargetsProxy/TargetsProxyTestCase.php index e4c83b0a02e..b3248cfc31a 100644 --- a/module/Swissbib/tests/SwissbibTest/TargetsProxy/TargetsProxyTestCase.php +++ b/module/Swissbib/tests/SwissbibTest/TargetsProxy/TargetsProxyTestCase.php @@ -71,8 +71,6 @@ public function initialize($configFile) $config = new Config($iniReader->fromFile($configFile)); $serviceLocator = new ServiceManager(); $serviceLocator->setService('VuFind\Config', $config); - //$configPluginManager = $serviceLocator->get('VuFind\Config'); - $this->targetsProxy = new TargetsProxy($config, new Logger(), new Request()); $this->targetsProxy->setSearchClass('Summon'); $this->targetsProxy->setServiceLocator($serviceLocator);