Version.php 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: liu21st <liu21st@gmail.com>
  10. // +----------------------------------------------------------------------
  11. namespace think\console\command;
  12. use think\console\Command;
  13. use think\console\Input;
  14. use think\console\Output;
  15. use think\facade\App;
  16. class Version extends Command
  17. {
  18. protected function configure()
  19. {
  20. // 指令配置
  21. $this->setName('version')
  22. ->setDescription('show thinkphp framework version');
  23. }
  24. protected function execute(Input $input, Output $output)
  25. {
  26. $output->writeln('v' . App::version());
  27. }
  28. }