From ac6439432d30fccf777d73fa2c404beb6fc5269d Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Mon, 12 Feb 2018 17:08:47 -0500 Subject: [PATCH] Run all console actions through standard router. - Enabled by upgrade to latest Zend_Console library featuring catch-all parameters. --- module/VuFindConsole/config/module.config.php | 4 ++-- .../src/VuFindConsole/Controller/HarvestController.php | 1 + .../src/VuFindConsole/Controller/UtilController.php | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/VuFindConsole/config/module.config.php b/module/VuFindConsole/config/module.config.php index fe5e16a7624..bdadb5389c7 100644 --- a/module/VuFindConsole/config/module.config.php +++ b/module/VuFindConsole/config/module.config.php @@ -59,7 +59,7 @@ $routes = [ 'generate/staticroute' => 'generate staticroute [<name>] [<module>]', 'generate/theme' => 'generate theme [<themename>]', 'generate/thememixin' => 'generate thememixin [<name>]', - // harvest/harvest_oai is too complex to represent here; we need to rely on default-route + 'harvest/harvest_oai' => 'harvest harvest_oai [...params]', 'harvest/merge-marc' => 'harvest merge-marc [<dir>]', 'import/import-xsl' => 'import import-xsl [--test-only] [--index=] [<xml>] [<properties>]', 'import/webcrawl' => 'import webcrawl [--test-only] [--index=]', @@ -70,7 +70,7 @@ $routes = [ 'util/cleanup_record_cache' => 'util (cleanuprecordcache|cleanup_record_cache) [--help|-h]', 'util/commit' => 'util commit [<core>]', 'util/createHierarchyTrees' => 'util createHierarchyTrees [--skip-xml|-sx] [--skip-json|-sj] [--help|-h]', - // util/cssBuilder relies on default-route because it has an arbitrary number of parameters + 'util/cssBuilder' => 'util cssBuilder [...themes]', 'util/deletes' => 'util deletes [--verbose] [<filename>] [<format>] [<index>]', 'util/expire_external_sessions' => 'util expire_external_sessions [--help|-h] [--batch=] [--sleep=] [<daysOld>]', 'util/expire_searches' => 'util expire_searches [--help|-h] [--batch=] [--sleep=] [<daysOld>]', diff --git a/module/VuFindConsole/src/VuFindConsole/Controller/HarvestController.php b/module/VuFindConsole/src/VuFindConsole/Controller/HarvestController.php index 93d7aa2b3ee..777eeb12a60 100644 --- a/module/VuFindConsole/src/VuFindConsole/Controller/HarvestController.php +++ b/module/VuFindConsole/src/VuFindConsole/Controller/HarvestController.php @@ -77,6 +77,7 @@ class HarvestController extends AbstractBase // Get default options, add the default --ini setting if missing: $opts = HarvesterConsoleRunner::getDefaultOptions(); + $opts->setArguments($this->getRequest()->getParam('params')); if (!$opts->getOption('ini')) { $ini = \VuFind\Config\Locator::getConfigPath('oai.ini', 'harvest'); $opts->addArguments(['--ini=' . $ini]); diff --git a/module/VuFindConsole/src/VuFindConsole/Controller/UtilController.php b/module/VuFindConsole/src/VuFindConsole/Controller/UtilController.php index 2fbfb153865..3380a7fb340 100644 --- a/module/VuFindConsole/src/VuFindConsole/Controller/UtilController.php +++ b/module/VuFindConsole/src/VuFindConsole/Controller/UtilController.php @@ -665,12 +665,11 @@ class UtilController extends AbstractBase */ public function cssbuilderAction() { - $opts = new \Zend\Console\Getopt([]); $compiler = new \VuFindTheme\LessCompiler(true); $cacheManager = $this->serviceLocator->get('VuFind\Cache\Manager'); $cacheDir = $cacheManager->getCacheDir() . 'less/'; $compiler->setTempPath($cacheDir); - $compiler->compile(array_unique($opts->getRemainingArgs())); + $compiler->compile(array_unique($this->getRequest()->getParam('themes'))); return $this->getSuccessResponse(); } -- GitLab