aboutsummaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorMarcus Eibrink-Lunzenauer <lunzenauer@elan-ev.de>2022-11-04 07:14:50 +0000
committerMarcus Eibrink-Lunzenauer <lunzenauer@elan-ev.de>2022-11-04 07:14:50 +0000
commitd08d1b67d2e6d17e67623bb6b47c37a67eea22e4 (patch)
treebb5d9408f245ce4f26a9e981b034ac203a36eff4 /cli
parente814af9c5111f1da26e4ba5e16cca80c5ba5a022 (diff)
Use dependency injection in trails, closes #1714.
Closes #1714 Merge request studip/studip!1118
Diffstat (limited to 'cli')
-rw-r--r--cli/Commands/Checks/HelpTours.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/cli/Commands/Checks/HelpTours.php b/cli/Commands/Checks/HelpTours.php
index 04d66c0..b4b2fa7 100644
--- a/cli/Commands/Checks/HelpTours.php
+++ b/cli/Commands/Checks/HelpTours.php
@@ -59,11 +59,10 @@ class HelpTours extends Command
$plugin = new $plugin_info['class']();
if ($result[1]) {
- $dispatcher = new \Trails_Dispatcher(
- $GLOBALS['ABSOLUTE_PATH_STUDIP'] . $plugin->getPluginPath(),
- rtrim(\PluginEngine::getLink($plugin, [], null, true), '/'),
- 'index'
- );
+ $dispatcher = app(\Trails_Dispatcher::class);
+ $dispatcher->trails_root = $GLOBALS['ABSOLUTE_PATH_STUDIP'] . $plugin->getPluginPath();
+ $dispatcher->trails_uri = rtrim(\PluginEngine::getLink($plugin, [], null, true), '/');
+ $dispatcher->default_controller = 'index';
$dispatcher->current_plugin = $plugin;
$parsed = $dispatcher->parse($result[1]);
$controller = $dispatcher->load_controller($parsed[0]);
@@ -72,7 +71,7 @@ class HelpTours extends Command
}
}
} elseif (match_route('dispatch.php/*', $step->route)) {
- $dispatcher = new \StudipDispatcher();
+ $dispatcher = app(\Trails_Dispatcher::class);
$parsed = $dispatcher->parse(substr($step->route, strlen('dispatch.php') + 1));
$controller = $dispatcher->load_controller($parsed[0]);
if ($parsed[1] && !$controller->has_action($parsed[1])) {