diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-11-16 13:15:22 -0800 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-11-16 13:52:01 -0800 |
commit | 6f55acf1a6eb58c7eeed3233e70782d031814201 (patch) | |
tree | 49a2cef2913053979945a878dcec20516bf1ff72 | |
parent | 9f3486f7481ea5f7ecd9de724549c168072dd046 (diff) |
Add command to display Kanboard version
-rw-r--r-- | app/Console/VersionCommand.php | 28 | ||||
-rw-r--r-- | app/ServiceProvider/CommandProvider.php | 2 | ||||
-rw-r--r-- | doc/en_US/cli.markdown | 1 |
3 files changed, 31 insertions, 0 deletions
diff --git a/app/Console/VersionCommand.php b/app/Console/VersionCommand.php new file mode 100644 index 00000000..678cc2ee --- /dev/null +++ b/app/Console/VersionCommand.php @@ -0,0 +1,28 @@ +<?php + +namespace Kanboard\Console; + +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Class VersionCommand + * + * @package Kanboard\Console + * @author Frederic Guillot + */ +class VersionCommand extends BaseCommand +{ + protected function configure() + { + $this + ->setName('version') + ->setDescription('Display Kanboard version') + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $output->writeln(APP_VERSION); + } +} diff --git a/app/ServiceProvider/CommandProvider.php b/app/ServiceProvider/CommandProvider.php index f17ba352..b31162b8 100644 --- a/app/ServiceProvider/CommandProvider.php +++ b/app/ServiceProvider/CommandProvider.php @@ -20,6 +20,7 @@ use Kanboard\Console\TaskExportCommand; use Kanboard\Console\TaskOverdueNotificationCommand; use Kanboard\Console\TaskTriggerCommand; use Kanboard\Console\TransitionExportCommand; +use Kanboard\Console\VersionCommand; use Kanboard\Console\WorkerCommand; use Pimple\Container; use Pimple\ServiceProviderInterface; @@ -61,6 +62,7 @@ class CommandProvider implements ServiceProviderInterface $application->add(new PluginUninstallCommand($container)); $application->add(new DatabaseMigrationCommand($container)); $application->add(new DatabaseVersionCommand($container)); + $application->add(new VersionCommand($container)); $container['cli'] = $application; return $container; diff --git a/doc/en_US/cli.markdown b/doc/en_US/cli.markdown index b7d60705..9ee8ae62 100644 --- a/doc/en_US/cli.markdown +++ b/doc/en_US/cli.markdown @@ -32,6 +32,7 @@ Available commands: help Displays help for a command job Execute individual job (read payload from stdin) list Lists commands + version Display Kanboard version worker Execute queue worker db db:migrate Execute SQL migrations |