New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New CLI Plugin Type #2168
New CLI Plugin Type #2168
Conversation
It has few more features (like turning down verbosity) and looks nicer
This allows for using the functionality in class hierarchies that can not inherit from DokuWiki_Plugin.
Now plugins can create their own command line interfaces. They are executed through a single entry point in bin/plugin.php
This does not implement the functionality of #2152, because there the output was shown/hidden depending on the output of the git-command itself. However, it makes sense to reimplement that pull request on top of this one. I haven't had time to look at the code, but I noticed that even if the output is suppressed by the loglevel, either gittool or the new cli-plugin still prints a newline for each repository where the command was executed. |
To be more precise about the empty lines: They are caused by the This is should maybe be moved to the beginning and/or end of the |
@@ -15,7 +15,6 @@ | |||
require_once(DOKU_INC.'inc/common.php'); | |||
require_once(DOKU_INC.'inc/confutils.php'); | |||
require_once(DOKU_INC.'inc/pluginutils.php'); | |||
require_once(DOKU_INC.'inc/plugin.php'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file can be added to the data/deleted.files
file as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks handy.
I have not much experience with these language structures. So if that needs more thought, others should ship in as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One typo, as mentioned. Otherwise looks good 👍
bin/plugin.php
Outdated
define('NOSESSION', 1); | ||
require_once(DOKU_INC . 'inc/init.php'); | ||
|
||
class pluginCLI extends CLI { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be PluginCLI
(capital P)?
This PR introduces a new plugin type for command line tools. To do so, the DokuCLI class was deprecated and replaced by the library that grew out of it. The plugin base code was refactored into an interface and a trait to allow for injecting the plugin functionality into a different class hierarchy.
This also fixes #2152 by introducing log levels