From d85bca2d7d07ff12157b901c264646e88e1c9333 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Fri, 1 Mar 2013 13:11:18 -0500 Subject: [PATCH] Use plugin manager instead of Config\Reader. --- module/VuFind/src/VuFind/Search/Base/Params.php | 7 +++---- module/VuFind/src/VuFind/Search/Solr/Results.php | 5 ++--- module/VuFind/src/VuFind/Search/SolrAuthor/Params.php | 5 +++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/module/VuFind/src/VuFind/Search/Base/Params.php b/module/VuFind/src/VuFind/Search/Base/Params.php index 41f82afff90..3d369a8cddd 100644 --- a/module/VuFind/src/VuFind/Search/Base/Params.php +++ b/module/VuFind/src/VuFind/Search/Base/Params.php @@ -26,8 +26,7 @@ * @link http://www.vufind.org Main Page */ namespace VuFind\Search\Base; -use VuFind\Config\Reader as ConfigReader, - Zend\ServiceManager\ServiceLocatorAwareInterface, +use Zend\ServiceManager\ServiceLocatorAwareInterface, Zend\ServiceManager\ServiceLocatorInterface; /** @@ -727,8 +726,8 @@ class Params implements ServiceLocatorAwareInterface // Load the necessary settings to determine the appropriate recommendations // module: - $searchSettings - = ConfigReader::getConfig($this->getOptions()->getSearchIni()); + $searchSettings = $this->getServiceLocator()->get('VuFind\Config') + ->get($this->getOptions()->getSearchIni()); // If we have a search type set, save it so we can try to load a // type-specific recommendations module: diff --git a/module/VuFind/src/VuFind/Search/Solr/Results.php b/module/VuFind/src/VuFind/Search/Solr/Results.php index d8cd2aecf89..3d53bbd5234 100644 --- a/module/VuFind/src/VuFind/Search/Solr/Results.php +++ b/module/VuFind/src/VuFind/Search/Solr/Results.php @@ -26,8 +26,7 @@ * @link http://www.vufind.org Main Page */ namespace VuFind\Search\Solr; -use VuFind\Config\Reader as ConfigReader, - VuFind\Connection\Manager as ConnectionManager, +use VuFind\Connection\Manager as ConnectionManager, VuFind\Exception\RecordMissing as RecordMissingException, VuFind\Search\Base\Results as BaseResults; @@ -339,7 +338,7 @@ class Results extends BaseResults protected function doSpellingReplace($term, $targetTerm, $inToken, $details, $returnArray ) { - $config = ConfigReader::getConfig(); + $config = $this->getServiceLocator()->get('VuFind\Config')->get('config'); $returnArray[$targetTerm]['freq'] = $details['freq']; foreach ($details['suggestions'] as $word => $freq) { diff --git a/module/VuFind/src/VuFind/Search/SolrAuthor/Params.php b/module/VuFind/src/VuFind/Search/SolrAuthor/Params.php index fb5f9f4af16..f84e5806f99 100644 --- a/module/VuFind/src/VuFind/Search/SolrAuthor/Params.php +++ b/module/VuFind/src/VuFind/Search/SolrAuthor/Params.php @@ -26,7 +26,7 @@ * @link http://vufind.org Main Site */ namespace VuFind\Search\SolrAuthor; -use VuFind\Config\Reader as ConfigReader, VuFind\Search\Solr\Params as SolrParams; +use VuFind\Search\Solr\Params as SolrParams; /** * Author Search Options @@ -89,7 +89,8 @@ class Params extends SolrParams { // Load the necessary settings to determine the appropriate recommendations // module: - $ss = ConfigReader::getConfig($this->getOptions()->getSearchIni()); + $ss = $this->getServiceLocator()->get('VuFind\Config') + ->get($this->getOptions()->getSearchIni()); // Load the AuthorModuleRecommendations configuration if available, use // standard defaults otherwise: -- GitLab