From 5acd58ac1e5fb94d30bac8dd7d42dcc9970eb46f Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Tue, 31 Oct 2017 13:08:18 -0400 Subject: [PATCH] Namespace change: Zend\Mvc\Router --> Zend\Router. --- module/VuFind/config/module.config.php | 16 ++++++++-------- module/VuFind/src/VuFind/Bootstrapper.php | 2 +- .../VuFind/src/VuFind/Route/RouteGenerator.php | 8 ++++---- .../VuFind/src/VuFind/View/Helper/Root/Piwik.php | 4 ++-- .../src/VuFind/View/Helper/Root/ResultFeed.php | 2 +- .../View/Helper/Root/RecordDataFormatterTest.php | 4 ++-- module/VuFindAdmin/config/module.config.php | 14 +++++++------- module/VuFindApi/config/module.config.php | 6 +++--- module/VuFindDevTools/config/module.config.php | 6 +++--- 9 files changed, 31 insertions(+), 31 deletions(-) diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index 75cde9007b3..1bdad7d9507 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -5,7 +5,7 @@ $config = [ 'router' => [ 'routes' => [ 'default' => [ - 'type' => 'Zend\Mvc\Router\Http\Segment', + 'type' => 'Zend\Router\Http\Segment', 'options' => [ 'route' => '/[:controller[/[:action]]]', 'constraints' => [ @@ -19,7 +19,7 @@ $config = [ ], ], 'content-page' => [ - 'type' => 'Zend\Mvc\Router\Http\Segment', + 'type' => 'Zend\Router\Http\Segment', 'options' => [ 'route' => '/Content/[:page]', 'constraints' => [ @@ -32,7 +32,7 @@ $config = [ ], ], 'legacy-alphabrowse-results' => [ - 'type' => 'Zend\Mvc\Router\Http\Literal', + 'type' => 'Zend\Router\Http\Literal', 'options' => [ 'route' => '/AlphaBrowse/Results', 'defaults' => [ @@ -42,7 +42,7 @@ $config = [ ] ], 'legacy-bookcover' => [ - 'type' => 'Zend\Mvc\Router\Http\Literal', + 'type' => 'Zend\Router\Http\Literal', 'options' => [ 'route' => '/bookcover.php', 'defaults' => [ @@ -52,7 +52,7 @@ $config = [ ] ], 'legacy-summonrecord' => [ - 'type' => 'Zend\Mvc\Router\Http\Literal', + 'type' => 'Zend\Router\Http\Literal', 'options' => [ 'route' => '/Summon/Record', 'defaults' => [ @@ -62,7 +62,7 @@ $config = [ ] ], 'legacy-worldcatrecord' => [ - 'type' => 'Zend\Mvc\Router\Http\Literal', + 'type' => 'Zend\Router\Http\Literal', 'options' => [ 'route' => '/WorldCat/Record', 'defaults' => [ @@ -72,7 +72,7 @@ $config = [ ] ], 'soap-shibboleth-logout-notification-handler' => [ - 'type' => 'Zend\Mvc\Router\Http\Literal', + 'type' => 'Zend\Router\Http\Literal', 'options' => [ 'route' => '/soap/shiblogout', 'defaults' => [ @@ -987,7 +987,7 @@ $routeGenerator->addStaticRoutes($config, $staticRoutes); // Add the home route last $config['router']['routes']['home'] = [ - 'type' => 'Zend\Mvc\Router\Http\Literal', + 'type' => 'Zend\Router\Http\Literal', 'options' => [ 'route' => '/', 'defaults' => [ diff --git a/module/VuFind/src/VuFind/Bootstrapper.php b/module/VuFind/src/VuFind/Bootstrapper.php index 72b941ec3c8..d886c694e00 100644 --- a/module/VuFind/src/VuFind/Bootstrapper.php +++ b/module/VuFind/src/VuFind/Bootstrapper.php @@ -29,7 +29,7 @@ namespace VuFind; use Zend\Console\Console; use Zend\Mvc\MvcEvent; -use Zend\Mvc\Router\Http\RouteMatch; +use Zend\Router\Http\RouteMatch; /** * VuFind Bootstrapper diff --git a/module/VuFind/src/VuFind/Route/RouteGenerator.php b/module/VuFind/src/VuFind/Route/RouteGenerator.php index 8e1b229786b..b9b198e8c65 100644 --- a/module/VuFind/src/VuFind/Route/RouteGenerator.php +++ b/module/VuFind/src/VuFind/Route/RouteGenerator.php @@ -81,7 +81,7 @@ class RouteGenerator { list($actionName) = explode('/', $action, 2); $config['router']['routes'][$routeName] = [ - 'type' => 'Zend\Mvc\Router\Http\Segment', + 'type' => 'Zend\Router\Http\Segment', 'options' => [ 'route' => "/$controller/$action", 'constraints' => [ @@ -128,7 +128,7 @@ class RouteGenerator { // catch-all "tab" route: $config['router']['routes'][$routeBase] = [ - 'type' => 'Zend\Mvc\Router\Http\Segment', + 'type' => 'Zend\Router\Http\Segment', 'options' => [ 'route' => '/' . $controller . '/[:id[/[:tab]]]', 'constraints' => [ @@ -144,7 +144,7 @@ class RouteGenerator // special non-tab actions that each need their own route: foreach ($this->nonTabRecordActions as $action) { $config['router']['routes'][$routeBase . '-' . strtolower($action)] = [ - 'type' => 'Zend\Mvc\Router\Http\Segment', + 'type' => 'Zend\Router\Http\Segment', 'options' => [ 'route' => '/' . $controller . '/[:id]/' . $action, 'constraints' => [ @@ -189,7 +189,7 @@ class RouteGenerator list($controller, $action) = explode('/', $route); $routeName = str_replace('/', '-', strtolower($route)); $config['router']['routes'][$routeName] = [ - 'type' => 'Zend\Mvc\Router\Http\Literal', + 'type' => 'Zend\Router\Http\Literal', 'options' => [ 'route' => '/' . $route, 'defaults' => [ diff --git a/module/VuFind/src/VuFind/View/Helper/Root/Piwik.php b/module/VuFind/src/VuFind/View/Helper/Root/Piwik.php index ae1f1a899e3..90a348fc898 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/Piwik.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/Piwik.php @@ -76,7 +76,7 @@ class Piwik extends \Zend\View\Helper\AbstractHelper /** * Router object * - * @var Zend\Mvc\Router\Http\RouteMatch + * @var Zend\Router\Http\RouteMatch */ protected $router; @@ -111,7 +111,7 @@ class Piwik extends \Zend\View\Helper\AbstractHelper * if a single value, the Piwik site ID -- for backward compatibility) * @param bool $customVars Whether to track * additional information in custom variables - * @param Zend\Mvc\Router\Http\RouteMatch $router Request + * @param Zend\Router\Http\RouteMatch $router Request * @param Zend\Http\PhpEnvironment\Request $request Request */ public function __construct($url, $options, $customVars, $router, $request) diff --git a/module/VuFind/src/VuFind/View/Helper/Root/ResultFeed.php b/module/VuFind/src/VuFind/View/Helper/Root/ResultFeed.php index 83a074f9fd2..5015133aa84 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/ResultFeed.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/ResultFeed.php @@ -241,7 +241,7 @@ class ResultFeed extends AbstractHelper implements TranslatorAwareInterface $recordLink = $this->getView()->plugin('recordlink'); try { $url = $serverUrl($recordLink->getUrl($record)); - } catch (\Zend\Mvc\Router\Exception\RuntimeException $e) { + } catch (\Zend\Router\Exception\RuntimeException $e) { // No route defined? See if we can get a URL out of the driver. // Useful for web results, among other things. $url = $record->tryMethod('getUrl'); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordDataFormatterTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordDataFormatterTest.php index fae08b83d17..43dc3c61741 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordDataFormatterTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordDataFormatterTest.php @@ -137,10 +137,10 @@ class RecordDataFormatterTest extends \VuFindTest\Unit\ViewHelperTestCase $view = $this->getPhpRenderer($helpers); // Mock out the router to avoid errors: - $match = new \Zend\Mvc\Router\RouteMatch([]); + $match = new \Zend\Router\RouteMatch([]); $match->setMatchedRouteName('foo'); $view->plugin('url') - ->setRouter($this->createMock('Zend\Mvc\Router\RouteStackInterface')) + ->setRouter($this->createMock('Zend\Router\RouteStackInterface')) ->setRouteMatch($match); // Inject the view object into all of the helpers: diff --git a/module/VuFindAdmin/config/module.config.php b/module/VuFindAdmin/config/module.config.php index b437b922b85..6dac6572877 100644 --- a/module/VuFindAdmin/config/module.config.php +++ b/module/VuFindAdmin/config/module.config.php @@ -23,7 +23,7 @@ $config = [ 'router' => [ 'routes' => [ 'admin' => [ - 'type' => 'Zend\Mvc\Router\Http\Literal', + 'type' => 'Zend\Router\Http\Literal', 'options' => [ 'route' => '/Admin', 'defaults' => [ @@ -34,7 +34,7 @@ $config = [ 'may_terminate' => true, 'child_routes' => [ 'disabled' => [ - 'type' => 'Zend\Mvc\Router\Http\Literal', + 'type' => 'Zend\Router\Http\Literal', 'options' => [ 'route' => '/Disabled', 'defaults' => [ @@ -44,7 +44,7 @@ $config = [ ] ], 'config' => [ - 'type' => 'Zend\Mvc\Router\Http\Segment', + 'type' => 'Zend\Router\Http\Segment', 'options' => [ 'route' => '/Config[/:action]', 'defaults' => [ @@ -54,7 +54,7 @@ $config = [ ] ], 'maintenance' => [ - 'type' => 'Zend\Mvc\Router\Http\Segment', + 'type' => 'Zend\Router\Http\Segment', 'options' => [ 'route' => '/Maintenance[/:action]', 'defaults' => [ @@ -64,7 +64,7 @@ $config = [ ] ], 'social' => [ - 'type' => 'Zend\Mvc\Router\Http\Segment', + 'type' => 'Zend\Router\Http\Segment', 'options' => [ 'route' => '/Social[/:action]', 'defaults' => [ @@ -74,7 +74,7 @@ $config = [ ] ], 'statistics' => [ - 'type' => 'Zend\Mvc\Router\Http\Segment', + 'type' => 'Zend\Router\Http\Segment', 'options' => [ 'route' => '/Statistics[/:action]', 'defaults' => [ @@ -84,7 +84,7 @@ $config = [ ] ], 'tags' => [ - 'type' => 'Zend\Mvc\Router\Http\Segment', + 'type' => 'Zend\Router\Http\Segment', 'options' => [ 'route' => '/Tags[/:action]', 'defaults' => [ diff --git a/module/VuFindApi/config/module.config.php b/module/VuFindApi/config/module.config.php index 5b075d4b05b..8b72c900a32 100644 --- a/module/VuFindApi/config/module.config.php +++ b/module/VuFindApi/config/module.config.php @@ -15,7 +15,7 @@ $config = [ 'router' => [ 'routes' => [ 'apiHome' => [ - 'type' => 'Zend\Mvc\Router\Http\Segment', + 'type' => 'Zend\Router\Http\Segment', 'verb' => 'get,post,options', 'options' => [ 'route' => '/api[/v1][/]', @@ -26,7 +26,7 @@ $config = [ ], ], 'searchApiv1' => [ - 'type' => 'Zend\Mvc\Router\Http\Literal', + 'type' => 'Zend\Router\Http\Literal', 'verb' => 'get,post,options', 'options' => [ 'route' => '/api/v1/search', @@ -37,7 +37,7 @@ $config = [ ] ], 'recordApiv1' => [ - 'type' => 'Zend\Mvc\Router\Http\Literal', + 'type' => 'Zend\Router\Http\Literal', 'verb' => 'get,post,options', 'options' => [ 'route' => '/api/v1/record', diff --git a/module/VuFindDevTools/config/module.config.php b/module/VuFindDevTools/config/module.config.php index 55729e3670f..ea761cd5800 100644 --- a/module/VuFindDevTools/config/module.config.php +++ b/module/VuFindDevTools/config/module.config.php @@ -13,7 +13,7 @@ $config = [ 'router' => [ 'routes' => [ 'devtools-deminify' => [ - 'type' => 'Zend\Mvc\Router\Http\Literal', + 'type' => 'Zend\Router\Http\Literal', 'options' => [ 'route' => '/devtools/deminify', 'defaults' => [ @@ -23,7 +23,7 @@ $config = [ ] ], 'devtools-home' => [ - 'type' => 'Zend\Mvc\Router\Http\Literal', + 'type' => 'Zend\Router\Http\Literal', 'options' => [ 'route' => '/devtools/home', 'defaults' => [ @@ -33,7 +33,7 @@ $config = [ ] ], 'devtools-language' => [ - 'type' => 'Zend\Mvc\Router\Http\Literal', + 'type' => 'Zend\Router\Http\Literal', 'options' => [ 'route' => '/devtools/language', 'defaults' => [ -- GitLab