From 8657795c39b80874ae95a01a80da23f4f973a4f9 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Wed, 8 Nov 2017 15:40:27 -0500 Subject: [PATCH] Normalize controller service names to class names. (#1073) - Follow Zend Framework convention; prepare for ServiceManager v3. --- module/VuFind/config/module.config.php | 182 +++++++++++++----- module/VuFindAdmin/config/module.config.php | 20 +- module/VuFindApi/config/module.config.php | 10 +- module/VuFindConsole/config/module.config.php | 23 ++- .../VuFindDevTools/config/module.config.php | 5 +- 5 files changed, 178 insertions(+), 62 deletions(-) diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index 3b88dd06668..23c8f05cd81 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -105,51 +105,143 @@ $config = [ ], 'controllers' => [ 'factories' => [ - 'AJAX' => 'VuFind\Controller\Factory::getAjaxController', - 'Alphabrowse' => 'VuFind\Controller\Factory::getAlphabrowseController', - 'Author' => 'VuFind\Controller\Factory::getAuthorController', - 'Authority' => 'VuFind\Controller\Factory::getAuthorityController', - 'Browse' => 'VuFind\Controller\Factory::getBrowseController', - 'BrowZine' => 'VuFind\Controller\Factory::getBrowZineController', - 'Cart' => 'VuFind\Controller\Factory::getCartController', - 'Channels' => 'VuFind\Controller\Factory::getChannelsController', - 'Collection' => 'VuFind\Controller\Factory::getCollectionController', - 'Collections' => 'VuFind\Controller\Factory::getCollectionsController', - 'Combined' => 'VuFind\Controller\Factory::getCombinedController', - 'Confirm' => 'VuFind\Controller\Factory::getConfirmController', - 'Content' => 'VuFind\Controller\Factory::getContentController', - 'Cover' => 'VuFind\Controller\Factory::getCoverController', - 'EDS' => 'VuFind\Controller\Factory::getEdsController', - 'EdsRecord' => 'VuFind\Controller\Factory::getEdsrecordController', - 'EIT' => 'VuFind\Controller\Factory::getEITController', - 'EITRecord' => '\VuFind\Controller\Factory::getEITrecordController', - 'Error' => 'VuFind\Controller\Factory::getErrorController', - 'ExternalAuth' => 'VuFind\Controller\Factory::getExternalAuthController', - 'Feedback' => 'VuFind\Controller\Factory::getFeedbackController', - 'Help' => 'VuFind\Controller\Factory::getHelpController', - 'Hierarchy' => 'VuFind\Controller\Factory::getHierarchyController', - 'index' => 'VuFind\Controller\Factory::getIndexController', - 'Install' => 'VuFind\Controller\Factory::getInstallController', - 'LibGuides' => 'VuFind\Controller\Factory::getLibGuidesController', - 'LibraryCards' => 'VuFind\Controller\Factory::getLibraryCardsController', - 'MissingRecord' => 'VuFind\Controller\Factory::getMissingrecordController', - 'MyResearch' => 'VuFind\Controller\Factory::getMyResearchController', - 'OAI' => 'VuFind\Controller\Factory::getOaiController', - 'Pazpar2' => 'VuFind\Controller\Factory::getPazpar2Controller', - 'Primo' => 'VuFind\Controller\Factory::getPrimoController', - 'PrimoRecord' => 'VuFind\Controller\Factory::getPrimorecordController', - 'QRCode' => 'VuFind\Controller\Factory::getQRCodeController', - 'Record' => 'VuFind\Controller\Factory::getRecordController', - 'Records' => 'VuFind\Controller\Factory::getRecordsController', - 'Search' => 'VuFind\Controller\Factory::getSearchController', - 'ShibbolethLogoutNotification' => 'VuFind\Controller\Factory::getShibbolethLogoutNotificationController', - 'Summon' => 'VuFind\Controller\Factory::getSummonController', - 'SummonRecord' => 'VuFind\Controller\Factory::getSummonrecordController', - 'Tag' => 'VuFind\Controller\Factory::getTagController', - 'Upgrade' => 'VuFind\Controller\Factory::getUpgradeController', - 'Web' => 'VuFind\Controller\Factory::getWebController', - 'Worldcat' => 'VuFind\Controller\Factory::getWorldcatController', - 'WorldcatRecord' => 'VuFind\Controller\Factory::getWorldcatrecordController', + 'VuFind\Controller\AjaxController' => 'VuFind\Controller\Factory::getAjaxController', + 'VuFind\Controller\AlphabrowseController' => 'VuFind\Controller\Factory::getAlphabrowseController', + 'VuFind\Controller\AuthorController' => 'VuFind\Controller\Factory::getAuthorController', + 'VuFind\Controller\AuthorityController' => 'VuFind\Controller\Factory::getAuthorityController', + 'VuFind\Controller\BrowseController' => 'VuFind\Controller\Factory::getBrowseController', + 'VuFind\Controller\BrowZineController' => 'VuFind\Controller\Factory::getBrowZineController', + 'VuFind\Controller\CartController' => 'VuFind\Controller\Factory::getCartController', + 'VuFind\Controller\ChannelsController' => 'VuFind\Controller\Factory::getChannelsController', + 'VuFind\Controller\CollectionController' => 'VuFind\Controller\Factory::getCollectionController', + 'VuFind\Controller\CollectionsController' => 'VuFind\Controller\Factory::getCollectionsController', + 'VuFind\Controller\CombinedController' => 'VuFind\Controller\Factory::getCombinedController', + 'VuFind\Controller\ConfirmController' => 'VuFind\Controller\Factory::getConfirmController', + 'VuFind\Controller\ContentController' => 'VuFind\Controller\Factory::getContentController', + 'VuFind\Controller\CoverController' => 'VuFind\Controller\Factory::getCoverController', + 'VuFind\Controller\EdsController' => 'VuFind\Controller\Factory::getEdsController', + 'VuFind\Controller\EdsrecordController' => 'VuFind\Controller\Factory::getEdsrecordController', + 'VuFind\Controller\EITController' => 'VuFind\Controller\Factory::getEITController', + 'VuFind\Controller\EITrecordController' => '\VuFind\Controller\Factory::getEITrecordController', + 'VuFind\Controller\ErrorController' => 'VuFind\Controller\Factory::getErrorController', + 'VuFind\Controller\ExternalAuthController' => 'VuFind\Controller\Factory::getExternalAuthController', + 'VuFind\Controller\FeedbackController' => 'VuFind\Controller\Factory::getFeedbackController', + 'VuFind\Controller\HelpController' => 'VuFind\Controller\Factory::getHelpController', + 'VuFind\Controller\HierarchyController' => 'VuFind\Controller\Factory::getHierarchyController', + 'VuFind\Controller\IndexController' => 'VuFind\Controller\Factory::getIndexController', + 'VuFind\Controller\InstallController' => 'VuFind\Controller\Factory::getInstallController', + 'VuFind\Controller\LibGuidesController' => 'VuFind\Controller\Factory::getLibGuidesController', + 'VuFind\Controller\LibraryCardsController' => 'VuFind\Controller\Factory::getLibraryCardsController', + 'VuFind\Controller\MissingrecordController' => 'VuFind\Controller\Factory::getMissingrecordController', + 'VuFind\Controller\MyResearchController' => 'VuFind\Controller\Factory::getMyResearchController', + 'VuFind\Controller\OaiController' => 'VuFind\Controller\Factory::getOaiController', + 'VuFind\Controller\Pazpar2Controller' => 'VuFind\Controller\Factory::getPazpar2Controller', + 'VuFind\Controller\PrimoController' => 'VuFind\Controller\Factory::getPrimoController', + 'VuFind\Controller\PrimorecordController' => 'VuFind\Controller\Factory::getPrimorecordController', + 'VuFind\Controller\QRCodeController' => 'VuFind\Controller\Factory::getQRCodeController', + 'VuFind\Controller\RecordController' => 'VuFind\Controller\Factory::getRecordController', + 'VuFind\Controller\RecordsController' => 'VuFind\Controller\Factory::getRecordsController', + 'VuFind\Controller\SearchController' => 'VuFind\Controller\Factory::getSearchController', + 'VuFind\Controller\ShibbolethLogoutNotificationController' => 'VuFind\Controller\Factory::getShibbolethLogoutNotificationController', + 'VuFind\Controller\SummonController' => 'VuFind\Controller\Factory::getSummonController', + 'VuFind\Controller\SummonrecordController' => 'VuFind\Controller\Factory::getSummonrecordController', + 'VuFind\Controller\TagController' => 'VuFind\Controller\Factory::getTagController', + 'VuFind\Controller\UpgradeController' => 'VuFind\Controller\Factory::getUpgradeController', + 'VuFind\Controller\WebController' => 'VuFind\Controller\Factory::getWebController', + 'VuFind\Controller\WorldcatController' => 'VuFind\Controller\Factory::getWorldcatController', + 'VuFind\Controller\WorldcatrecordController' => 'VuFind\Controller\Factory::getWorldcatrecordController', + ], + 'aliases' => [ + 'AJAX' => 'VuFind\Controller\AjaxController', + 'ajax' => 'VuFind\Controller\AjaxController', + 'Alphabrowse' => 'VuFind\Controller\AlphabrowseController', + 'alphabrowse' => 'VuFind\Controller\AlphabrowseController', + 'Author' => 'VuFind\Controller\AuthorController', + 'author' => 'VuFind\Controller\AuthorController', + 'Authority' => 'VuFind\Controller\AuthorityController', + 'authority' => 'VuFind\Controller\AuthorityController', + 'Browse' => 'VuFind\Controller\BrowseController', + 'browse' => 'VuFind\Controller\BrowseController', + 'BrowZine' => 'VuFind\Controller\BrowZineController', + 'browzine' => 'VuFind\Controller\BrowZineController', + 'Cart' => 'VuFind\Controller\CartController', + 'cart' => 'VuFind\Controller\CartController', + 'Channels' => 'VuFind\Controller\ChannelsController', + 'channels' => 'VuFind\Controller\ChannelsController', + 'Collection' => 'VuFind\Controller\CollectionController', + 'collection' => 'VuFind\Controller\CollectionController', + 'Collections' => 'VuFind\Controller\CollectionsController', + 'collections' => 'VuFind\Controller\CollectionsController', + 'Combined' => 'VuFind\Controller\CombinedController', + 'combined' => 'VuFind\Controller\CombinedController', + 'Confirm' => 'VuFind\Controller\ConfirmController', + 'confirm' => 'VuFind\Controller\ConfirmController', + 'Content' => 'VuFind\Controller\ContentController', + 'content' => 'VuFind\Controller\ContentController', + 'Cover' => 'VuFind\Controller\CoverController', + 'cover' => 'VuFind\Controller\CoverController', + 'EDS' => 'VuFind\Controller\EdsController', + 'eds' => 'VuFind\Controller\EdsController', + 'EdsRecord' => 'VuFind\Controller\EdsrecordController', + 'edsrecord' => 'VuFind\Controller\EdsrecordController', + 'EIT' => 'VuFind\Controller\EITController', + 'eit' => 'VuFind\Controller\EITController', + 'EITRecord' => 'VuFind\Controller\EITrecordController', + 'eitrecord' => 'VuFind\Controller\EITrecordController', + 'Error' => 'VuFind\Controller\ErrorController', + 'error' => 'VuFind\Controller\ErrorController', + 'ExternalAuth' => 'VuFind\Controller\ExternalAuthController', + 'externalauth' => 'VuFind\Controller\ExternalAuthController', + 'Feedback' => 'VuFind\Controller\FeedbackController', + 'feedback' => 'VuFind\Controller\FeedbackController', + 'Help' => 'VuFind\Controller\HelpController', + 'help' => 'VuFind\Controller\HelpController', + 'Hierarchy' => 'VuFind\Controller\HierarchyController', + 'hierarchy' => 'VuFind\Controller\HierarchyController', + 'Index' => 'VuFind\Controller\IndexController', + 'index' => 'VuFind\Controller\IndexController', + 'Install' => 'VuFind\Controller\InstallController', + 'install' => 'VuFind\Controller\InstallController', + 'LibGuides' => 'VuFind\Controller\LibGuidesController', + 'libguides' => 'VuFind\Controller\LibGuidesController', + 'LibraryCards' => 'VuFind\Controller\LibraryCardsController', + 'librarycards' => 'VuFind\Controller\LibraryCardsController', + 'MissingRecord' => 'VuFind\Controller\MissingrecordController', + 'missingrecord' => 'VuFind\Controller\MissingrecordController', + 'MyResearch' => 'VuFind\Controller\MyResearchController', + 'myresearch' => 'VuFind\Controller\MyResearchController', + 'OAI' => 'VuFind\Controller\OaiController', + 'oai' => 'VuFind\Controller\OaiController', + 'Pazpar2' => 'VuFind\Controller\Pazpar2Controller', + 'pazpar2' => 'VuFind\Controller\Pazpar2Controller', + 'Primo' => 'VuFind\Controller\PrimoController', + 'primo' => 'VuFind\Controller\PrimoController', + 'PrimoRecord' => 'VuFind\Controller\PrimorecordController', + 'primorecord' => 'VuFind\Controller\PrimorecordController', + 'QRCode' => 'VuFind\Controller\QRCodeController', + 'qrcode' => 'VuFind\Controller\QRCodeController', + 'Record' => 'VuFind\Controller\RecordController', + 'record' => 'VuFind\Controller\RecordController', + 'Records' => 'VuFind\Controller\RecordsController', + 'records' => 'VuFind\Controller\RecordsController', + 'Search' => 'VuFind\Controller\SearchController', + 'search' => 'VuFind\Controller\SearchController', + 'ShibbolethLogoutNotification' => 'VuFind\Controller\ShibbolethLogoutNotificationController', + 'shibbolethlogoutnotification' => 'VuFind\Controller\ShibbolethLogoutNotificationController', + 'Summon' => 'VuFind\Controller\SummonController', + 'summon' => 'VuFind\Controller\SummonController', + 'SummonRecord' => 'VuFind\Controller\SummonrecordController', + 'summonrecord' => 'VuFind\Controller\SummonrecordController', + 'Tag' => 'VuFind\Controller\TagController', + 'tag' => 'VuFind\Controller\TagController', + 'Upgrade' => 'VuFind\Controller\UpgradeController', + 'upgrade' => 'VuFind\Controller\UpgradeController', + 'Web' => 'VuFind\Controller\WebController', + 'web' => 'VuFind\Controller\WebController', + 'Worldcat' => 'VuFind\Controller\WorldcatController', + 'worldcat' => 'VuFind\Controller\WorldcatController', + 'WorldcatRecord' => 'VuFind\Controller\WorldcatrecordController', + 'worldcatrecord' => 'VuFind\Controller\WorldcatrecordController', ], ], 'controller_plugins' => [ diff --git a/module/VuFindAdmin/config/module.config.php b/module/VuFindAdmin/config/module.config.php index 6c28c37e563..b437b922b85 100644 --- a/module/VuFindAdmin/config/module.config.php +++ b/module/VuFindAdmin/config/module.config.php @@ -4,12 +4,20 @@ namespace VuFindAdmin\Module\Configuration; $config = [ 'controllers' => [ 'factories' => [ - 'Admin' => 'VuFindAdmin\Controller\Factory::getAdminController', - 'AdminConfig' => 'VuFindAdmin\Controller\Factory::getConfigController', - 'AdminSocial' => 'VuFindAdmin\Controller\Factory::getSocialstatsController', - 'AdminMaintenance' => 'VuFindAdmin\Controller\Factory::getMaintenanceController', - 'AdminStatistics' => 'VuFindAdmin\Controller\Factory::getStatisticsController', - 'AdminTags' => 'VuFindAdmin\Controller\Factory::getTagsController', + 'VuFindAdmin\Controller\AdminController' => 'VuFindAdmin\Controller\Factory::getAdminController', + 'VuFindAdmin\Controller\ConfigController' => 'VuFindAdmin\Controller\Factory::getConfigController', + 'VuFindAdmin\Controller\MaintenanceController' => 'VuFindAdmin\Controller\Factory::getMaintenanceController', + 'VuFindAdmin\Controller\SocialController' => 'VuFindAdmin\Controller\Factory::getSocialstatsController', + 'VuFindAdmin\Controller\StatisticsController' => 'VuFindAdmin\Controller\Factory::getStatisticsController', + 'VuFindAdmin\Controller\TagsController' => 'VuFindAdmin\Controller\Factory::getTagsController', + ], + 'aliases' => [ + 'Admin' => 'VuFindAdmin\Controller\AdminController', + 'AdminConfig' => 'VuFindAdmin\Controller\ConfigController', + 'AdminMaintenance' => 'VuFindAdmin\Controller\MaintenanceController', + 'AdminSocial' => 'VuFindAdmin\Controller\SocialController', + 'AdminStatistics' => 'VuFindAdmin\Controller\StatisticsController', + 'AdminTags' => 'VuFindAdmin\Controller\TagsController', ], ], 'router' => [ diff --git a/module/VuFindApi/config/module.config.php b/module/VuFindApi/config/module.config.php index 653d8c50c1f..5b075d4b05b 100644 --- a/module/VuFindApi/config/module.config.php +++ b/module/VuFindApi/config/module.config.php @@ -4,9 +4,13 @@ namespace VuFindApi\Module\Configuration; $config = [ 'controllers' => [ 'factories' => [ - 'Api' => 'VuFindApi\Controller\Factory::getApiController', - 'SearchApi' => 'VuFindApi\Controller\Factory::getSearchApiController', - ] + 'VuFindApi\Controller\ApiController' => 'VuFindApi\Controller\Factory::getApiController', + 'VuFindApi\Controller\SearchApiController' => 'VuFindApi\Controller\Factory::getSearchApiController', + ], + 'aliases' => [ + 'Api' => 'VuFindApi\Controller\ApiController', + 'SearchApi' => 'VuFindApi\Controller\SearchApiController', + ], ], 'router' => [ 'routes' => [ diff --git a/module/VuFindConsole/config/module.config.php b/module/VuFindConsole/config/module.config.php index 086187c098d..3a0e8895e8b 100644 --- a/module/VuFindConsole/config/module.config.php +++ b/module/VuFindConsole/config/module.config.php @@ -4,13 +4,22 @@ namespace VuFindConsole\Module\Configuration; $config = [ 'controllers' => [ 'factories' => [ - 'compile' => 'VuFindConsole\Controller\Factory::getCompileController', - 'generate' => 'VuFindConsole\Controller\Factory::getGenerateController', - 'harvest' => 'VuFindConsole\Controller\Factory::getHarvestController', - 'import' => 'VuFindConsole\Controller\Factory::getImportController', - 'language' => 'VuFindConsole\Controller\Factory::getLanguageController', - 'redirect' => 'VuFindConsole\Controller\Factory::getRedirectController', - 'util' => 'VuFindConsole\Controller\Factory::getUtilController', + 'VuFindConsole\Controller\CompileController' => 'VuFindConsole\Controller\Factory::getCompileController', + 'VuFindConsole\Controller\GenerateController' => 'VuFindConsole\Controller\Factory::getGenerateController', + 'VuFindConsole\Controller\HarvestController' => 'VuFindConsole\Controller\Factory::getHarvestController', + 'VuFindConsole\Controller\ImportController' => 'VuFindConsole\Controller\Factory::getImportController', + 'VuFindConsole\Controller\LanguageController' => 'VuFindConsole\Controller\Factory::getLanguageController', + 'VuFindConsole\Controller\RedirectController' => 'VuFindConsole\Controller\Factory::getRedirectController', + 'VuFindConsole\Controller\UtilController' => 'VuFindConsole\Controller\Factory::getUtilController', + ], + 'aliases' => [ + 'compile' => 'VuFindConsole\Controller\CompileController', + 'generate' => 'VuFindConsole\Controller\GenerateController', + 'harvest' => 'VuFindConsole\Controller\HarvestController', + 'import' => 'VuFindConsole\Controller\ImportController', + 'language' => 'VuFindConsole\Controller\LanguageController', + 'redirect' => 'VuFindConsole\Controller\RedirectController', + 'util' => 'VuFindConsole\Controller\UtilController', ], ], 'console' => [ diff --git a/module/VuFindDevTools/config/module.config.php b/module/VuFindDevTools/config/module.config.php index 095a9b1a3f0..55729e3670f 100644 --- a/module/VuFindDevTools/config/module.config.php +++ b/module/VuFindDevTools/config/module.config.php @@ -4,7 +4,10 @@ namespace VuFindLocalTemplate\Module\Configuration; $config = [ 'controllers' => [ 'factories' => [ - 'DevTools' => 'VuFindDevTools\Controller\Factory::getDevtoolsController', + 'VuFindDevTools\Controller\DevtoolsController' => 'VuFindDevTools\Controller\Factory::getDevtoolsController', + ], + 'aliases' => [ + 'DevTools' => 'VuFindDevTools\Controller\DevtoolsController', ], ], 'router' => [ -- GitLab