From f9ebfb798ec3f8ec447f10c72d31cc14a7ac5970 Mon Sep 17 00:00:00 2001 From: Sebastian Kehr <kehr@ub.uni-leipzig.de> Date: Tue, 15 Jan 2019 13:37:58 +0100 Subject: [PATCH] refs #12975 - update finc master branch to vf v5.0.1 * replacing of ServiceLocator by ContainerInterface at several Factories * adjusts finc theme.config.php to zf3 conventions * replaces docker php 5.6 image by v7.2 --- composer.lock | 66 +++++++++ docker-compose.yml | 8 +- module/finc/config/module.config.php | 9 +- module/finc/src/finc/ILS/Driver/Factory.php | 66 +++++---- module/finc/src/finc/RecordDriver/Factory.php | 129 +++++++++--------- module/finc/src/finc/RecordTab/Factory.php | 9 +- module/finc/src/finc/Rewrite/Factory.php | 16 ++- .../finc/Role/PermissionProvider/Factory.php | 25 ++-- .../src/finc/View/Helper/Root/Factory.php | 69 +++++----- .../finc/src/finc/View/Helper/Root/Record.php | 1 + themes/finc/templates/layout/layout.phtml | 4 +- themes/finc/templates/search/searchbox.phtml | 8 +- themes/finc/theme.config.php | 54 +++++--- 13 files changed, 279 insertions(+), 185 deletions(-) diff --git a/composer.lock b/composer.lock index a8c7b8b9809..92cce88996e 100644 --- a/composer.lock +++ b/composer.lock @@ -7778,6 +7778,72 @@ "validate" ], "time": "2018-01-29T19:49:41+00:00" + }, + { + "name": "sabre/vobject", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/sabre-io/vobject.git", + "reference": "20c72ddf7ae3e037ad348bbc83b477af56b9484e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sabre-io/vobject/zipball/20c72ddf7ae3e037ad348bbc83b477af56b9484e", + "reference": "20c72ddf7ae3e037ad348bbc83b477af56b9484e", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=5.3.1" + }, + "require-dev": { + "phpunit/phpunit": "*", + "squizlabs/php_codesniffer": "*" + }, + "bin": [ + "bin/vobject", + "bin/generate_vcards" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Sabre\\VObject\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Evert Pot", + "email": "me@evertpot.com", + "homepage": "http://evertpot.com/", + "role": "Developer" + }, + { + "name": "Dominik Tobschall", + "email": "dominik@fruux.com", + "homepage": "http://tobschall.de/", + "role": "Developer" + } + ], + "description": "The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects", + "homepage": "http://sabre.io/vobject/", + "keywords": [ + "VObject", + "iCalendar", + "jCal", + "jCard", + "vCard" + ], + "time": "2015-02-23T21:12:17+00:00" } ], "aliases": [], diff --git a/docker-compose.yml b/docker-compose.yml index 5cf54391018..236adf64268 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '2' services: php: - image: ubleipzig/vufind-php:5.6-7-debug + image: ubleipzig/vufind-php:7.2-8-debug volumes: - ./:/usr/local/vufind environment: @@ -42,7 +42,7 @@ services: - mail-data:/home/dev/Maildir:z grunt: - image: ubleipzig/vufind-php:5.6-7-debug + image: ubleipzig/vufind-php:7.2-8-debug volumes: - ./:/usr/local/vufind:z - npm-cache:/home/www-data/.npm @@ -51,7 +51,7 @@ services: command: npm install && node_modules/.bin/grunt watch composer: - image: ubleipzig/vufind-php:7.2-7-debug + image: ubleipzig/vufind-php:7.2-8-debug volumes: - ./:/usr/local/vufind:z - composer-cache:/home/www-data/.composer @@ -61,7 +61,7 @@ services: command: phing composer -Dcomposer_extra_params=--no-scripts autoconfig: - image: ubleipzig/vufind-php:5.6-7-debug + image: ubleipzig/vufind-php:7.2-8-debug volumes: - ./:/usr/local/vufind:z environment: diff --git a/module/finc/config/module.config.php b/module/finc/config/module.config.php index b6b91aa270e..9437fab9c57 100644 --- a/module/finc/config/module.config.php +++ b/module/finc/config/module.config.php @@ -5,10 +5,10 @@ $config = [ 'service_manager' => [ 'factories' => [ 'VuFind\Mailer' => 'finc\Mailer\Factory', - 'VuFind\CacheManager' => 'finc\Service\Factory::getCacheManager', + 'VuFind\Cache\Manager' => 'finc\Service\Factory::getCacheManager', 'VuFind\BranchesReader' => 'finc\Service\Factory::getBranchesReader', - 'VuFind\ILSConnection' => 'finc\Service\Factory::getILSConnection', - 'VuFind\ILSHoldLogic' => 'finc\Service\Factory::getILSHoldLogic', + 'VuFind\ILS\Connection' => 'finc\Service\Factory::getILSConnection', + 'VuFind\ILS\Logic\Hold' => 'finc\Service\Factory::getILSHoldLogic', 'finc\Rewrite' => 'finc\Rewrite\Factory', 'VuFind\Export' => 'finc\Service\Factory::getExport', 'VuFind\SessionManager' => 'finc\Session\ManagerFactory', @@ -61,7 +61,8 @@ $config = [ ], 'recordtab' => [ 'factories' => [ - 'hierarchytree' => 'finc\RecordTab\Factory::getHierarchyTree', + 'VuFind\RecordTab\HierarchyTree' => + 'finc\RecordTab\Factory::getHierarchyTree', ], 'invokables' => [ 'staffviewai' => 'finc\RecordTab\StaffViewAI', diff --git a/module/finc/src/finc/ILS/Driver/Factory.php b/module/finc/src/finc/ILS/Driver/Factory.php index 5d05e83ef7d..ea2c7a5faa6 100644 --- a/module/finc/src/finc/ILS/Driver/Factory.php +++ b/module/finc/src/finc/ILS/Driver/Factory.php @@ -26,7 +26,8 @@ * @link https://vufind.org/wiki/development:plugins:hierarchy_components Wiki */ namespace finc\ILS\Driver; -use Zend\ServiceManager\ServiceManager; + +use Interop\Container\ContainerInterface; /** * ILS Driver Factory Class @@ -44,31 +45,33 @@ class Factory /** * Factory for FincILS driver. * - * @param ServiceManager $sm Service manager. + * @params ServiceManager $container Service manager. * * @return FincILS */ - public static function getFincILS(ServiceManager $sm) + public static function getFincILS(ContainerInterface $container) { - $factory = new \ProxyManager\Factory\LazyLoadingValueHolderFactory($sm->getServiceLocator()->get('VuFind\ProxyConfig')); + $factory = new \ProxyManager\Factory\LazyLoadingValueHolderFactory( + $container->get('VuFind\ProxyConfig') + ); - $callback = function (& $wrapped, $proxy) use ($sm) { - $wrapped = $sm->getServiceLocator()->get('ZfcRbac\Service\AuthorizationService'); + $callback = function (& $wrapped, $proxy) use ($container) { + $wrapped = $container->get('ZfcRbac\Service\AuthorizationService'); $proxy->setProxyInitializer(null); }; $fl = new FincILS( - $sm->getServiceLocator()->get('VuFind\DateConverter'), - $sm->getServiceLocator()->get('VuFind\SessionManager'), - $sm->getServiceLocator()->get('VuFind\RecordLoader'), - $sm->getServiceLocator()->get('VuFind\Search'), - $sm->getServiceLocator()->get('VuFind\Config')->get('config'), + $container->get('VuFind\DateConverter'), + $container->get('VuFind\SessionManager'), + $container->get('VuFind\RecordLoader'), + $container->get('VuFind\Search'), + $container->get('VuFind\Config')->get('config'), $factory->createProxy('ZfcRbac\Service\AuthorizationService', $callback) ); $fl->setCacheStorage( - $sm->getServiceLocator()->get('VuFind\CacheManager')->getCache('object') + $container->get('VuFind\CacheManager')->getCache('object') ); return $fl; @@ -77,50 +80,55 @@ class Factory /** * Factory for PAIA driver. * - * @param ServiceManager $sm Service manager. + * @params ServiceManager $container Service manager. * * @return PAIA */ - public static function getPAIA(ServiceManager $sm) + public static function getPAIA(ContainerInterface $container) { $paia = new PAIA( - $sm->getServiceLocator()->get('VuFind\DateConverter'), - $sm->getServiceLocator()->get('VuFind\SessionManager') + $container->get('VuFind\DateConverter'), + $container->get('VuFind\SessionManager') ); $paia->setCacheStorage( - $sm->getServiceLocator()->get('VuFind\CacheManager')->getCache('object') + $container->get('VuFind\CacheManager')->getCache('object') ); return $paia; } /** - * @deprecated Remove when Bibliotheca support ends - * @param ServiceManager $sm + * Factory for FincTheca driver. + * + * @params ServiceManager $container + * * @return FincTheca + * @deprecated Remove when Bibliotheca support ends */ - public static function getFincTheca(ServiceManager $sm) + public static function getFincTheca(ContainerInterface $container) { - $factory = new \ProxyManager\Factory\LazyLoadingValueHolderFactory($sm->getServiceLocator()->get('VuFind\ProxyConfig')); + $factory = new \ProxyManager\Factory\LazyLoadingValueHolderFactory( + $container->get('VuFind\ProxyConfig') + ); - $callback = function (& $wrapped, $proxy) use ($sm) { - $wrapped = $sm->getServiceLocator()->get('ZfcRbac\Service\AuthorizationService'); + $callback = function (& $wrapped, $proxy) use ($container) { + $wrapped = $container->get('ZfcRbac\Service\AuthorizationService'); $proxy->setProxyInitializer(null); }; $fl = new FincTheca( - $sm->getServiceLocator()->get('VuFind\DateConverter'), - $sm->getServiceLocator()->get('VuFind\SessionManager'), - $sm->getServiceLocator()->get('VuFind\RecordLoader'), - $sm->getServiceLocator()->get('VuFind\Search'), - $sm->getServiceLocator()->get('VuFind\Config')->get('config'), + $container->get('VuFind\DateConverter'), + $container->get('VuFind\SessionManager'), + $container->get('VuFind\RecordLoader'), + $container->get('VuFind\Search'), + $container->get('VuFind\Config')->get('config'), $factory->createProxy('ZfcRbac\Service\AuthorizationService', $callback) ); $fl->setCacheStorage( - $sm->getServiceLocator()->get('VuFind\CacheManager')->getCache('object') + $container->get('VuFind\CacheManager')->getCache('object') ); return $fl; diff --git a/module/finc/src/finc/RecordDriver/Factory.php b/module/finc/src/finc/RecordDriver/Factory.php index 7c39f4abc3f..96aea9fd2aa 100644 --- a/module/finc/src/finc/RecordDriver/Factory.php +++ b/module/finc/src/finc/RecordDriver/Factory.php @@ -26,7 +26,8 @@ * @link https://vufind.org/wiki/development:plugins:hierarchy_components Wiki */ namespace finc\RecordDriver; -use Zend\ServiceManager\ServiceManager; + +use Interop\Container\ContainerInterface; /** * Record Driver Factory Class @@ -44,119 +45,119 @@ class Factory /** * Factory for SolrDefault record driver. * - * @param ServiceManager $sm Service manager. + * @param ServiceManager $container Service manager. * * @return SolrDefault */ - public static function getSolrDefault(ServiceManager $sm) + public static function getSolrDefault(ContainerInterface $container) { $driver = new SolrDefault( - $sm->getServiceLocator()->get('VuFind\Config')->get('config'), + $container->get('VuFind\Config')->get('config'), null, - $sm->getServiceLocator()->get('VuFind\Config')->get('searches') + $container->get('VuFind\Config')->get('searches') ); - $driver->attachSearchService($sm->getServiceLocator()->get('VuFind\Search')); + $driver->attachSearchService($container->get('VuFind\Search')); return $driver; } /** * Factory for SolrMarc record driver. * - * @param ServiceManager $sm Service manager. + * @param ServiceManager $container Service manager. * * @return SolrMarc */ - public static function getSolrMarc(ServiceManager $sm) + public static function getSolrMarc(ContainerInterface $container) { $driver = new SolrMarc( - $sm->getServiceLocator()->get('VuFind\Config')->get('config'), + $container->get('VuFind\Config')->get('config'), null, - $sm->getServiceLocator()->get('VuFind\Config')->get('searches') + $container->get('VuFind\Config')->get('searches') ); $driver->attachILS( - $sm->getServiceLocator()->get('VuFind\ILSConnection'), - $sm->getServiceLocator()->get('VuFind\ILSHoldLogic'), - $sm->getServiceLocator()->get('VuFind\ILSTitleHoldLogic') + $container->get('VuFind\ILSConnection'), + $container->get('VuFind\ILSHoldLogic'), + $container->get('VuFind\ILSTitleHoldLogic') ); - $driver->attachSearchService($sm->getServiceLocator()->get('VuFind\Search')); + $driver->attachSearchService($container->get('VuFind\Search')); return $driver; } /** * Factory for SolrMarcPDA record driver. * - * @param ServiceManager $sm Service manager. + * @param ServiceManager $container Service manager. * * @return SolrMarcFincPDA */ - public static function getSolrMarcFincPDA(ServiceManager $sm) + public static function getSolrMarcFincPDA(ContainerInterface $container) { $driver = new SolrMarcFincPDA( - $sm->getServiceLocator()->get('VuFind\Config')->get('config'), + $container->get('VuFind\Config')->get('config'), null, - $sm->getServiceLocator()->get('VuFind\Config')->get('searches') + $container->get('VuFind\Config')->get('searches') ); //$driver->attachILS( - // $sm->getServiceLocator()->get('VuFind\ILSConnection'), - // $sm->getServiceLocator()->get('VuFind\ILSHoldLogic'), - // $sm->getServiceLocator()->get('VuFind\ILSTitleHoldLogic') + // $container->get('VuFind\ILSConnection'), + // $container->get('VuFind\ILSHoldLogic'), + // $container->get('VuFind\ILSTitleHoldLogic') //); - $driver->attachSearchService($sm->getServiceLocator()->get('VuFind\Search')); + $driver->attachSearchService($container->get('VuFind\Search')); return $driver; } /** * Factory for SolrMarcRemote record driver. * - * @param ServiceManager $sm Service manager. + * @param ServiceManager $container Service manager. * * @return SolrMarcRemote */ - public static function getSolrMarcRemote(ServiceManager $sm) + public static function getSolrMarcRemote(ContainerInterface $container) { $driver = new SolrMarcRemote( - $sm->getServiceLocator()->get('VuFind\Config')->get('config'), + $container->get('VuFind\Config')->get('config'), null, - $sm->getServiceLocator()->get('VuFind\Config')->get('searches') + $container->get('VuFind\Config')->get('searches') ); $driver->attachILS( - $sm->getServiceLocator()->get('VuFind\ILSConnection'), - $sm->getServiceLocator()->get('VuFind\ILSHoldLogic'), - $sm->getServiceLocator()->get('VuFind\ILSTitleHoldLogic') + $container->get('VuFind\ILSConnection'), + $container->get('VuFind\ILSHoldLogic'), + $container->get('VuFind\ILSTitleHoldLogic') ); - $driver->attachSearchService($sm->getServiceLocator()->get('VuFind\Search')); + $driver->attachSearchService($container->get('VuFind\Search')); return $driver; } /** * Factory for SolrAI record driver. * - * @param ServiceManager $sm Service manager. + * @param ServiceManager $container Service manager. * * @return SolrAI */ - public static function getSolrAI(ServiceManager $sm) + public static function getSolrAI(ContainerInterface $container) { return new SolrAI( - $sm->getServiceLocator()->get('VuFind\Config')->get('config'), - $sm->getServiceLocator()->get('VuFind\Config')->get('SolrAI'), - $sm->getServiceLocator()->get('VuFind\Config')->get('searches') + $container->get('VuFind\Config')->get('config'), + $container->get('VuFind\Config')->get('SolrAI'), + $container->get('VuFind\Config')->get('searches') ); } /** * Factory for SolrIS record driver. * - * @param ServiceManager $sm Service manager. + * @param ServiceManager $container Service manager. * * @return SolrIS */ - public static function getSolrIS(ServiceManager $sm) + public static function getSolrIS(ContainerInterface $container) { // Despite providing recordConfig to AI RecordDriver RecordDriver IS does not // need a recordConfig, thus null is provided return new SolrIS( - $sm->getServiceLocator()->get('VuFind\Config')->get('config'), + $container->get('VuFind\Config')->get('config'), null, null ); @@ -165,80 +166,80 @@ class Factory /** * Factory for SolrMarcRemoteFinc record driver. * - * @param ServiceManager $sm Service manager. + * @param ServiceManager $container Service manager. * * @return SolrMarcRemoteFinc */ - public static function getSolrMarcRemoteFinc(ServiceManager $sm) + public static function getSolrMarcRemoteFinc(ContainerInterface $container) { $driver = new SolrMarcRemoteFinc( - $sm->getServiceLocator()->get('VuFind\Config')->get('config'), + $container->get('VuFind\Config')->get('config'), null, - $sm->getServiceLocator()->get('VuFind\Config')->get('searches') + $container->get('VuFind\Config')->get('searches') ); $driver->attachILS( - $sm->getServiceLocator()->get('VuFind\ILSConnection'), - $sm->getServiceLocator()->get('VuFind\ILSHoldLogic'), - $sm->getServiceLocator()->get('VuFind\ILSTitleHoldLogic') + $container->get('VuFind\ILSConnection'), + $container->get('VuFind\ILSHoldLogic'), + $container->get('VuFind\ILSTitleHoldLogic') ); - $driver->attachSearchService($sm->getServiceLocator()->get('VuFind\Search')); + $driver->attachSearchService($container->get('VuFind\Search')); return $driver; } /** * Factory for SolrMarcFinc record driver. * - * @param ServiceManager $sm Service manager. + * @param ServiceManager $container Service manager. * * @return SolrMarcFinc */ - public static function getSolrMarcFinc(ServiceManager $sm) + public static function getSolrMarcFinc(ContainerInterface $container) { $driver = new SolrMarcFinc( - $sm->getServiceLocator()->get('VuFind\Config')->get('config'), + $container->get('VuFind\Config')->get('config'), null, - $sm->getServiceLocator()->get('VuFind\Config')->get('searches') + $container->get('VuFind\Config')->get('searches') ); $driver->attachILS( - $sm->getServiceLocator()->get('VuFind\ILSConnection'), - $sm->getServiceLocator()->get('VuFind\ILSHoldLogic'), - $sm->getServiceLocator()->get('VuFind\ILSTitleHoldLogic') + $container->get('VuFind\ILSConnection'), + $container->get('VuFind\ILSHoldLogic'), + $container->get('VuFind\ILSTitleHoldLogic') ); - $driver->attachSearchService($sm->getServiceLocator()->get('VuFind\Search')); + $driver->attachSearchService($container->get('VuFind\Search')); return $driver; } /** * Factory for SolrLido record driver. * - * @param ServiceManager $sm Service manager. + * @param ServiceManager $container Service manager. * * @return SolrLido */ - public static function getSolrLidoNdl(ServiceManager $sm) + public static function getSolrLidoNdl(ContainerInterface $container) { return new SolrLidoNdl( - $sm->getServiceLocator()->get('VuFind\Config')->get('config'), + $container->get('VuFind\Config')->get('config'), null, - $sm->getServiceLocator()->get('VuFind\Config')->get('searches'), - $sm->getServiceLocator()->get('VuFind\DateConverter') + $container->get('VuFind\Config')->get('searches'), + $container->get('VuFind\DateConverter') ); } /** * Factory for SolrLidoFinc record driver. * - * @param ServiceManager $sm Service manager. + * @param ServiceManager $container Service manager. * * @return SolrLido */ - public static function getSolrLido(ServiceManager $sm) + public static function getSolrLido(ContainerInterface $container) { return new SolrLido( - $sm->getServiceLocator()->get('VuFind\Config')->get('config'), + $container->get('VuFind\Config')->get('config'), null, - $sm->getServiceLocator()->get('VuFind\Config')->get('searches'), - $sm->getServiceLocator()->get('VuFind\DateConverter') + $container->get('VuFind\Config')->get('searches'), + $container->get('VuFind\DateConverter') ); } } diff --git a/module/finc/src/finc/RecordTab/Factory.php b/module/finc/src/finc/RecordTab/Factory.php index c041ed4268b..6f10997f1ec 100644 --- a/module/finc/src/finc/RecordTab/Factory.php +++ b/module/finc/src/finc/RecordTab/Factory.php @@ -26,7 +26,8 @@ * @link https://vufind.org/wiki/development:plugins:hierarchy_components Wiki */ namespace finc\RecordTab; -use Zend\ServiceManager\ServiceManager; + +use Interop\Container\ContainerInterface; /** * Record Tab Factory Class @@ -44,14 +45,14 @@ class Factory /** * Factory for HierarchyTree tab plugin. * - * @param ServiceManager $sm Service manager. + * @param ContainerInterface $container Service manager. * * @return HierarchyTree */ - public static function getHierarchyTree(ServiceManager $sm) + public static function getHierarchyTree(ContainerInterface $container) { return new HierarchyTree( - $sm->getServiceLocator()->get('VuFind\Config')->get('config') + $container->get('VuFind\Config')->get('config') ); } } diff --git a/module/finc/src/finc/Rewrite/Factory.php b/module/finc/src/finc/Rewrite/Factory.php index b11399b5421..076a042fc41 100644 --- a/module/finc/src/finc/Rewrite/Factory.php +++ b/module/finc/src/finc/Rewrite/Factory.php @@ -28,7 +28,11 @@ */ namespace finc\Rewrite; -use Zend\ServiceManager\ServiceLocatorInterface; +use Interop\Container\ContainerInterface; +use Interop\Container\Exception\ContainerException; +use Zend\ServiceManager\Exception\ServiceNotCreatedException; +use Zend\ServiceManager\Exception\ServiceNotFoundException; +use Zend\ServiceManager\Factory\FactoryInterface; /** * Factory for instantiating Rewrite objects @@ -42,22 +46,22 @@ use Zend\ServiceManager\ServiceLocatorInterface; * * @codeCoverageIgnore */ -class Factory implements \Zend\ServiceManager\FactoryInterface +class Factory implements FactoryInterface { /** * Create service * - * @param ServiceLocatorInterface $sm Service manager + * @param ContainerInterface $container Service manager * * @return mixed */ - public function createService(ServiceLocatorInterface $sm) + public function createService(ContainerInterface $container) { // Load configurations: - $config = $sm->get('VuFind\Config')->get('config'); + $config = $container->get('VuFind\Config')->get('config'); $eblHandler = new EblRewrite($config); $eblHandler->setAuthorizationService( - $sm->get('ZfcRbac\Service\AuthorizationService') + $container->get('ZfcRbac\Service\AuthorizationService') ); return $eblHandler; } diff --git a/module/finc/src/finc/Role/PermissionProvider/Factory.php b/module/finc/src/finc/Role/PermissionProvider/Factory.php index 53c209190a2..e16a5ebaf1f 100644 --- a/module/finc/src/finc/Role/PermissionProvider/Factory.php +++ b/module/finc/src/finc/Role/PermissionProvider/Factory.php @@ -26,7 +26,8 @@ * @link https://vufind.org/wiki/development:plugins:hierarchy_components Wiki */ namespace finc\Role\PermissionProvider; -use Zend\ServiceManager\ServiceManager; + +use Interop\Container\ContainerInterface; /** * Permission Provider Factory Class @@ -44,43 +45,43 @@ class Factory /** * Factory for Username * - * @param ServiceManager $sm Service manager. + * @param ContainerInterface $container Service manager. * * @return CatUserType */ - public static function getCatUserType(ServiceManager $sm) + public static function getCatUserType(ContainerInterface $container) { return new CatUserType( - $sm->getServiceLocator()->get('ZfcRbac\Service\AuthorizationService'), - $sm->getServiceLocator()->get('VuFind\ILSAuthenticator') + $container->get('ZfcRbac\Service\AuthorizationService'), + $container->get('VuFind\ILSAuthenticator') ); } /** * Factory for IpRangeFoFor * - * @param ServiceManager $sm Service manager. + * @param ContainerInterface $container Service manager. * * @return IpRangeFoFor */ - public static function getIpRangeFoFor(ServiceManager $sm) + public static function getIpRangeFoFor(ContainerInterface $container) { return new IpRangeFoFor( - $sm->getServiceLocator()->get('Request'), - $sm->getServiceLocator()->get('VuFind\IpAddressUtils') + $container->get('Request'), + $container->get('VuFind\IpAddressUtils') ); } /** * Factory for IpRegExFoFor * - * @param ServiceManager $sm Service manager. + * @param ContainerInterface $container Service manager. * * @return IpRegExFoFor */ - public static function getIpRegExFoFor(ServiceManager $sm) + public static function getIpRegExFoFor(ContainerInterface $container) { return new IpRegExFoFor( - $sm->getServiceLocator()->get('Request')); + $container->get('Request')); } } diff --git a/module/finc/src/finc/View/Helper/Root/Factory.php b/module/finc/src/finc/View/Helper/Root/Factory.php index e34aa96f46e..76937f65d16 100644 --- a/module/finc/src/finc/View/Helper/Root/Factory.php +++ b/module/finc/src/finc/View/Helper/Root/Factory.php @@ -26,7 +26,8 @@ * @link https://vufind.org/wiki/development Wiki */ namespace finc\View\Helper\Root; -use Zend\ServiceManager\ServiceManager; + +use Interop\Container\ContainerInterface; /** * Factory for Root view helpers. @@ -44,38 +45,38 @@ class Factory /** * Construct the Permission helper. * - * @param ServiceManager $sm Service manager. + * @param ContainerInterface $container Service manager. * * @return Permission */ - public static function getPermission(ServiceManager $sm) + public static function getPermission(ContainerInterface $container) { return new Permission( - $sm->getServiceLocator()->get('VuFind\AuthManager'), - $sm->getServiceLocator()->get('ZfcRbac\Service\AuthorizationService') + $container->get('VuFind\AuthManager'), + $container->get('ZfcRbac\Service\AuthorizationService') ); } /** * Construct the Record helper. * - * @param ServiceManager $sm Service manager. + * @param ContainerInterface $container Service manager. * * @return Record */ - public static function getRecord(ServiceManager $sm) + public static function getRecord(ContainerInterface $container) { $return = new Record( - $sm->getServiceLocator()->get('VuFind\Config')->get('config'), - $sm->get('url'), - $sm->getServiceLocator()->get('VuFind\AuthManager'), - $sm->getServiceLocator()->get('finc\Rewrite'), - $sm->getServiceLocator()->get('VuFind\Config')->get('Resolver') + $container->get('VuFind\Config')->get('config'), + $container->get('ViewHelperManager')->get('url'), + $container->get('VuFind\AuthManager'), + $container->get('finc\Rewrite'), + $container->get('VuFind\Config')->get('Resolver') ); //due to https://github.com/vufind-org/vufind/pull/718 //we have to explicitly add the cover router (cf. # - $return->setCoverRouter($sm->getServiceLocator()->get('VuFind\Cover\Router')); + $return->setCoverRouter($container->get('VuFind\Cover\Router')); return $return; } @@ -83,16 +84,16 @@ class Factory /** * Construct the RecordLink helper. * - * @param ServiceManager $sm Service manager. + * @param ContainerInterface $container Service manager. * * @return RecordLink */ - public static function getRecordLink(ServiceManager $sm) + public static function getRecordLink(ContainerInterface $container) { return new RecordLink( - $sm->getServiceLocator()->get('VuFind\RecordRouter'), - $sm->getServiceLocator()->get('VuFind\RecordLoader'), - $sm->getServiceLocator()->get('VuFind\Search') + $container->get('VuFind\RecordRouter'), + $container->get('VuFind\RecordLoader'), + $container->get('VuFind\Search') ); } @@ -109,39 +110,39 @@ class Factory /** * Construct the Citation helper. * - * @param ServiceManager $sm Service manager. + * @param ContainerInterface $container Service manager. * * @return Citation */ - public static function getCitation(ServiceManager $sm) + public static function getCitation(ContainerInterface $container) { - return new Citation($sm->getServiceLocator()->get('VuFind\DateConverter')); + return new Citation($container->get('VuFind\DateConverter')); } /** * Construct the Branches.yaml helper. * - * @param ServiceManager $sm Service manager. + * @param ContainerInterface $container Service manager. * * @return BranchInfo */ - public static function getBranchInfo(ServiceManager $sm) + public static function getBranchInfo(ContainerInterface $container) { return new BranchInfo( - $sm->getServiceLocator() + $container ); } /** * Construct the OpenUrl helper. * - * @param ServiceManager $sm Service manager. + * @param ContainerInterface $container Service manager. * * @return OpenUrl */ - public static function getOpenUrl(ServiceManager $sm) + public static function getOpenUrl(ContainerInterface $container) { - $config = $sm->getServiceLocator()->get('VuFind\Config')->get('Resolver'); + $config = $container->get('VuFind\Config')->get('Resolver'); // check if config json exists, as fallback empty array is passed to // constructor @@ -157,7 +158,7 @@ class Factory } return new OpenUrl( - $sm->get('context'), + $container->get('ViewHelperManager')->get('context'), empty($openUrlRules) ? [] : $openUrlRules, isset($config->General) ? $config : null ); @@ -166,25 +167,25 @@ class Factory /** * Construct the SideFacet helper. * - * @param ServiceManager $sm Service manager. + * @param ContainerInterface $container Service manager. * * @return SideFacet */ - public static function getSideFacet(ServiceManager $sm) + public static function getSideFacet(ContainerInterface $container) { return new SideFacet( - $sm->getServiceLocator()->get('VuFind\Config')->get('facets') + $container->get('VuFind\Config')->get('facets') ); } /** * Construct the External Catalogue Link Record helper. * - * @param ServiceManager $sm Service manager + * @param ContainerInterface $container Service manager * * @return ExternalCatalogueLink */ - public static function getExternalCatalogueLink(ServiceManager $sm) + public static function getExternalCatalogueLink(ContainerInterface $container) { // check if config json exists, as fallback empty array is passed to // constructor @@ -200,7 +201,7 @@ class Factory } return new ExternalCatalogueLink( - $sm->getServiceLocator()->get('VuFind\Config')->get('config'), + $container->get('VuFind\Config')->get('config'), empty($externalAccessLinks) ? [] : $externalAccessLinks ); } diff --git a/module/finc/src/finc/View/Helper/Root/Record.php b/module/finc/src/finc/View/Helper/Root/Record.php index 78bd77c59a4..d54f2d31179 100644 --- a/module/finc/src/finc/View/Helper/Root/Record.php +++ b/module/finc/src/finc/View/Helper/Root/Record.php @@ -26,6 +26,7 @@ * @link https://vufind.org/wiki/development Wiki */ namespace finc\View\Helper\Root; + use finc\Rewrite; use Symfony\Component\Config\Definition\Exception\Exception; diff --git a/themes/finc/templates/layout/layout.phtml b/themes/finc/templates/layout/layout.phtml index c6ba1d18fc8..c6049cff8a8 100644 --- a/themes/finc/templates/layout/layout.phtml +++ b/themes/finc/templates/layout/layout.phtml @@ -106,9 +106,9 @@ } // Session keep-alive - if ($this->KeepAlive()) { + if ($this->keepAlive()) { $this->headScript()->appendScript('var keepAliveInterval = ' - . $this->KeepAlive()); + . $this->keepAlive()); $this->headScript()->appendFile("keep_alive.js"); } ?> diff --git a/themes/finc/templates/search/searchbox.phtml b/themes/finc/templates/search/searchbox.phtml index e2078ad5c92..050d3d733a7 100644 --- a/themes/finc/templates/search/searchbox.phtml +++ b/themes/finc/templates/search/searchbox.phtml @@ -19,16 +19,16 @@ $lastSort = $this->searchMemory()->getLastSort($this->searchClassId); $lastLimit = $this->searchMemory()->getLastLimit($this->searchClassId); $ignoreHiddenFilterMemory = isset($this->ignoreHiddenFilterMemory) && $this->ignoreHiddenFilterMemory; $ignoreHiddenFiltersInRequest = isset($this->ignoreHiddenFiltersInRequest) && $this->ignoreHiddenFiltersInRequest; -$hiddenFilters = $this->searchtabs()->getHiddenFilters($this->searchClassId, $ignoreHiddenFilterMemory, $ignoreHiddenFiltersInRequest); +$hiddenFilters = $this->searchTabs()->getHiddenFilters($this->searchClassId, $ignoreHiddenFilterMemory, $ignoreHiddenFiltersInRequest); if (empty($hiddenFilters) && !$ignoreHiddenFilterMemory) { $hiddenFilters = $this->searchMemory()->getLastHiddenFilters($this->searchClassId); if (empty($hiddenFilters)) { - $hiddenFilters = $this->searchtabs()->getHiddenFilters($this->searchClassId); + $hiddenFilters = $this->searchTabs()->getHiddenFilters($this->searchClassId); } } -$hiddenFilterParams = $this->searchtabs()->getCurrentHiddenFilterParams($this->searchClassId, $ignoreHiddenFilterMemory, '?'); +$hiddenFilterParams = $this->searchTabs()->getCurrentHiddenFilterParams($this->searchClassId, $ignoreHiddenFilterMemory, '?'); ?> -<? $searchTabs = $this->searchtabs()->getTabConfig($this->searchClassId, $this->lookfor, $this->searchIndex, $this->searchType, $hiddenFilters); ?> +<? $searchTabs = $this->searchTabs()->getTabConfig($this->searchClassId, $this->lookfor, $this->searchIndex, $this->searchType, $hiddenFilters); ?> <? if ($this->searchType == 'advanced'): ?> <? /* finc: keep .no-margin-t or advanced search box will be pushed down too far (navbar-form) */ ?> <div class="navbar-left flip no-margin-t"> diff --git a/themes/finc/theme.config.php b/themes/finc/theme.config.php index ee4a2745532..0d40a70f59d 100644 --- a/themes/finc/theme.config.php +++ b/themes/finc/theme.config.php @@ -1,30 +1,40 @@ <?php -return array( +return [ 'extends' => 'bootstrap3', - 'js' => array( + 'js' => [ 'openurl.js', 'check_item_statuses.js', // remove nxt line when aria-hidden issue fixed, obsolete in VF5, see #12684 'finc.js', - ), - 'helpers' => array( - 'factories' => array( - //'permission' => 'finc\View\Helper\Root\Factory::getPermission', - 'record' => 'finc\View\Helper\Root\Factory::getRecord', - 'recordlink' => 'finc\View\Helper\Root\Factory::getRecordLink', - 'interlibraryloan' => - 'finc\View\Helper\Root\Factory::getInterlibraryLoanLink', - 'citation' => 'finc\View\Helper\Root\Factory::getCitation', - 'openurl' => 'finc\View\Helper\Root\Factory::getOpenUrl', - 'branchinfo' => 'finc\View\Helper\Root\Factory::getBranchInfo', - 'sidefacet' => 'finc\View\Helper\Root\Factory::getSideFacet', - 'externalCatalogueLink' => + ], + 'helpers' => [ + 'aliases' => [ + 'branchInfo' => 'finc\View\Helper\Root\BranchInfo', + 'externalCatalogueLink' => 'finc\View\Helper\Root\ExternalCatalogueLink', + 'interlibraryloan' => 'finc\View\Helper\Root\InterlibraryLoanLink', + 'sidefacet' => 'finc\View\Helper\Root\SideFacet', + ], + 'factories' => [ + 'finc\View\Helper\Root\BranchInfo' => + 'finc\View\Helper\Root\Factory::getBranchInfo', + 'finc\View\Helper\Root\ExternalCatalogueLink' => 'finc\View\Helper\Root\Factory::getExternalCatalogueLink', - 'recordDataFormatter' => + 'finc\View\Helper\Root\InterlibraryLoanLink' => + 'finc\View\Helper\Root\Factory::getInterlibraryLoanLink', + 'finc\View\Helper\Root\SideFacet' => + 'finc\View\Helper\Root\Factory::getSideFacet', + 'VuFind\View\Helper\Root\Record' => + 'finc\View\Helper\Root\Factory::getRecord', + 'VuFind\View\Helper\Root\RecordLink' => + 'finc\View\Helper\Root\Factory::getRecordLink', + 'VuFind\View\Helper\Root\Citation' => + 'finc\View\Helper\Root\Factory::getCitation', + 'VuFind\View\Helper\Root\OpenUrl' => + 'finc\View\Helper\Root\Factory::getOpenUrl', + 'VuFind\View\Helper\Root\RecordDataFormatter' => 'finc\View\Helper\Root\RecordDataFormatterFactory', - ), - 'invokables' => array( - 'resultfeed' => 'finc\View\Helper\Root\ResultFeed' - ) - ), -); + 'VuFind\View\Helper\Root\ResultFeed' => + 'Zend\ServiceManager\Factory\InvokableFactory' + ] + ] +]; -- GitLab