From 8df26bb5f5da206a3a54080a3abbfcab4e223e9a Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 4 Jun 2014 23:39:12 +0000 Subject: [PATCH] bootstrapping: add a dispatchModule() shortcut This allows to easily jump into a specific modules CLI controllers. refs #6411 --- library/Icinga/Application/Cli.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/library/Icinga/Application/Cli.php b/library/Icinga/Application/Cli.php index c5dfc092a..d5f2e08c2 100644 --- a/library/Icinga/Application/Cli.php +++ b/library/Icinga/Application/Cli.php @@ -124,6 +124,13 @@ class Cli extends ApplicationBootstrap return $this->params; } + public function dispatchModule($name, $basedir = null) + { + $this->getModuleManager()->loadModule($name, $basedir); + $this->cliLoader()->setModuleName($name); + $this->dispatch(); + } + public function dispatch() { Benchmark::measure('Dispatching CLI command');