diff options
author | Daniel Ziegenberg <daniel@ziegenberg.at> | 2021-07-19 00:04:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-19 00:04:51 +0300 |
commit | a66417250c108adca3229ecca85b5587463fb95d (patch) | |
tree | 66a3605e370916986e3b2e21bfa1ad1a8721e82a | |
parent | 7e28103e7731605ef8dd5707ad489072c7db6de6 (diff) |
provide console command for version information (#17755) (#17757)
* adds a new console command core:version which outputs only the bare version information
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
-rw-r--r-- | plugins/CoreAdminHome/Commands/VersionInfo.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/plugins/CoreAdminHome/Commands/VersionInfo.php b/plugins/CoreAdminHome/Commands/VersionInfo.php new file mode 100644 index 0000000000..7464021765 --- /dev/null +++ b/plugins/CoreAdminHome/Commands/VersionInfo.php @@ -0,0 +1,30 @@ +<?php +/** + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +namespace Piwik\Plugins\CoreAdminHome\Commands; + +use Piwik\Plugin\ConsoleCommand; +use Piwik\Version; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + + +class VersionInfo extends ConsoleCommand +{ + protected function configure() + { + $this->setName('core:version'); + $this->setDescription('Returns the current version information of this Matomo instance.'); + $this->setHelp("This command can be used to set get the version information of the current Matomo instance."); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $output->writeln(Version::VERSION); + } +} |