Add command to display Kanboard version
This commit is contained in:
28
app/Console/VersionCommand.php
Normal file
28
app/Console/VersionCommand.php
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,6 +20,7 @@ use Kanboard\Console\TaskExportCommand;
|
|||||||
use Kanboard\Console\TaskOverdueNotificationCommand;
|
use Kanboard\Console\TaskOverdueNotificationCommand;
|
||||||
use Kanboard\Console\TaskTriggerCommand;
|
use Kanboard\Console\TaskTriggerCommand;
|
||||||
use Kanboard\Console\TransitionExportCommand;
|
use Kanboard\Console\TransitionExportCommand;
|
||||||
|
use Kanboard\Console\VersionCommand;
|
||||||
use Kanboard\Console\WorkerCommand;
|
use Kanboard\Console\WorkerCommand;
|
||||||
use Pimple\Container;
|
use Pimple\Container;
|
||||||
use Pimple\ServiceProviderInterface;
|
use Pimple\ServiceProviderInterface;
|
||||||
@@ -61,6 +62,7 @@ class CommandProvider implements ServiceProviderInterface
|
|||||||
$application->add(new PluginUninstallCommand($container));
|
$application->add(new PluginUninstallCommand($container));
|
||||||
$application->add(new DatabaseMigrationCommand($container));
|
$application->add(new DatabaseMigrationCommand($container));
|
||||||
$application->add(new DatabaseVersionCommand($container));
|
$application->add(new DatabaseVersionCommand($container));
|
||||||
|
$application->add(new VersionCommand($container));
|
||||||
|
|
||||||
$container['cli'] = $application;
|
$container['cli'] = $application;
|
||||||
return $container;
|
return $container;
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ Available commands:
|
|||||||
help Displays help for a command
|
help Displays help for a command
|
||||||
job Execute individual job (read payload from stdin)
|
job Execute individual job (read payload from stdin)
|
||||||
list Lists commands
|
list Lists commands
|
||||||
|
version Display Kanboard version
|
||||||
worker Execute queue worker
|
worker Execute queue worker
|
||||||
db
|
db
|
||||||
db:migrate Execute SQL migrations
|
db:migrate Execute SQL migrations
|
||||||
|
|||||||
Reference in New Issue
Block a user