diff --git a/module/VuFind/src/VuFind/Connection/Summon/Query.php b/module/VuFind/src/VuFind/Connection/Summon/Query.php index c0326788a96221a9621841be7832bc036fb23098..b7f490ebf5542512995a4091169c53d2ecbc7b43 100644 --- a/module/VuFind/src/VuFind/Connection/Summon/Query.php +++ b/module/VuFind/src/VuFind/Connection/Summon/Query.php @@ -27,7 +27,7 @@ * @link http://api.summon.serialssolutions.com/help/api/ API Documentation */ namespace VuFind\Connection\Summon; -use VuFind\Config\Reader as ConfigReader, VuFind\Solr\Utils as SolrUtils; +use VuFind\Solr\Utils as SolrUtils; /** * Summon REST API Interface (query model - VuFind implementation) @@ -41,6 +41,11 @@ use VuFind\Config\Reader as ConfigReader, VuFind\Solr\Utils as SolrUtils; */ class Query extends \SerialsSolutions_Summon_Query { + /** + * Summon configuration object + * + * @var \Zend\Config\Config + */ protected $config; /** @@ -48,13 +53,14 @@ class Query extends \SerialsSolutions_Summon_Query * * Sets up the Summon API Client * - * @param string $query Search query - * @param array $options Other options to set (associative array) + * @param string $query Search query + * @param array $options Other options to set (associative array) + * @param \Zend\Config\Config $config Summon configuration object (optional) */ - public function __construct($query = null, $options = array()) + public function __construct($query = null, $options = array(), $config = null) { parent::__construct($query, $options); - $this->config = ConfigReader::getConfig('Summon'); + $this->config = $config; } /** diff --git a/module/VuFind/src/VuFind/Search/Summon/Results.php b/module/VuFind/src/VuFind/Search/Summon/Results.php index 0573eacdce7494cc1e48a5ea94a2027acf21953a..e00221b5d71c76a81eaa093e5aa5c68761c14a28 100644 --- a/module/VuFind/src/VuFind/Search/Summon/Results.php +++ b/module/VuFind/src/VuFind/Search/Summon/Results.php @@ -93,7 +93,8 @@ class Results extends BaseResults 'pageNumber' => $this->getParams()->getPage(), 'pageSize' => $this->getParams()->getLimit(), 'didYouMean' => $this->getOptions()->spellcheckEnabled() - ) + ), + $this->getServiceLocator()->get('VuFind\Config')->get('Summon') ); if ($this->getOptions()->highlightEnabled()) { $query->setHighlight(true);