diff --git a/module/VuFind/src/VuFind/Config/Reader.php b/module/VuFind/src/VuFind/Config/Reader.php index 7caead0cd0085f9d2d1c83140319703cc71478c7..9b2427b454ff8192f7a8022e4956f23939ccdb85 100644 --- a/module/VuFind/src/VuFind/Config/Reader.php +++ b/module/VuFind/src/VuFind/Config/Reader.php @@ -237,7 +237,7 @@ class Reader } } if ($cache) { - $cache->setItem($results, $key); + $cache->setItem($key, $results); } } self::$searchSpecs[$filename] = $results; diff --git a/module/VuFind/src/VuFind/Controller/SearchController.php b/module/VuFind/src/VuFind/Controller/SearchController.php index 566d3b906ab0ae19eba64f4d2bcf217aed9e2545..38897ea7352d8cdff838f8eac4d52cda5d4234d1 100644 --- a/module/VuFind/src/VuFind/Controller/SearchController.php +++ b/module/VuFind/src/VuFind/Controller/SearchController.php @@ -507,9 +507,8 @@ class SearchController extends AbstractSearch $params->setLimit(0); $results = new Results($params); - /* TODO: fix caching: - $cache->setItem($results, 'solrSearchHomeFacets'); - */ + $results->getResults(); // force processing for cache + $cache->setItem('solrSearchHomeFacets', $results); } return $results; } diff --git a/module/VuFind/src/VuFind/Controller/SummonController.php b/module/VuFind/src/VuFind/Controller/SummonController.php index 2c81ede96d8738e54bc2c9efd3bb9323c178e729..e50665647cec0476028ba248b5e8725fc67808cb 100644 --- a/module/VuFind/src/VuFind/Controller/SummonController.php +++ b/module/VuFind/src/VuFind/Controller/SummonController.php @@ -137,10 +137,8 @@ class SummonController extends AbstractSearch $params->setLimit(0); $results = new SummonResults($params); - $results->getResults(); - /* TODO: fix caching - $cache->setItem($results, 'summonSearchHomeFacets'); - */ + $results->getResults(); // force processing for cache + $cache->setItem('summonSearchHomeFacets', $results); } return $results; } diff --git a/module/VuFind/src/VuFind/ILS/Driver/Aleph.php b/module/VuFind/src/VuFind/ILS/Driver/Aleph.php index 2c472669935e3d5b6ff55baf715db593d23af1f5..9667400c69e27c2185359f6e6fad0a7d6f95bd93 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/Aleph.php +++ b/module/VuFind/src/VuFind/ILS/Driver/Aleph.php @@ -320,19 +320,15 @@ class Aleph implements DriverInterface && isset($configArray['util']['tab_sub_library']) ) { if (isset($configArray['Cache']['type'])) { - /* TODO $manager = CacheManager::getInstance(); $cache = $manager->getCache($configArray['Cache']['type']); - $this->translator = $cache->load('alephTranslator'); - */ + $this->translator = $cache->getItem('alephTranslator'); } if ($this->translator == false) { $this->translator = new AlephTranslator($configArray); - /* TODO if (isset($cache)) { - $cache->save($this->translator, 'alephTranslator'); + $cache->setItem('alephTranslator', $this->translator); } - */ } } } diff --git a/module/VuFind/src/VuFind/Translator/Translator.php b/module/VuFind/src/VuFind/Translator/Translator.php index c399967902813ac71e0852e4efccd6cc257d9190..0136c9d34aa3f5bf9ba298f3b6b7420e552685ce 100644 --- a/module/VuFind/src/VuFind/Translator/Translator.php +++ b/module/VuFind/src/VuFind/Translator/Translator.php @@ -26,7 +26,8 @@ * @link http://www.vufind.org Main Page */ namespace VuFind\Translator; -use VuFind\Translator\Loader\ExtendedIni as ExtendedIniLoader, +use VuFind\Cache\Manager as CacheManager, + VuFind\Translator\Loader\ExtendedIni as ExtendedIniLoader, Zend\I18n\Translator\TranslatorServiceFactory; /** @@ -92,9 +93,11 @@ class Translator $pluginManager = $translator->getPluginManager(); $pluginManager->setService('extendedini', new ExtendedIniLoader()); - // Set up language caching for better performance (TODO): - //$translator - // ->setCache(CacheManager::getInstance()->getCache('language')); + /* TODO -- uncomment this when Zend translator bug is fixed (RC5?): + // Set up language caching for better performance: + $translator + ->setCache(CacheManager::getInstance()->getCache('language')); + */ // Store the translator object in the VuFind Translator wrapper: self::setTranslator($translator);