PageRenderTime 55ms CodeModel.GetById 29ms RepoModel.GetById 1ms app.codeStats 0ms

/library/MTool/Command/Current.php

https://bitbucket.org/dbritan/mtool
PHP | 28 lines | 16 code | 3 blank | 9 comment | 3 complexity | b8ce7ceec4a32e426388da45b69ea2fe MD5 | raw file
  1. <?php
  2. /**
  3. * @package MTool_Command
  4. * @author Dmitriy Britan <dmitriy.britan@nixsolutions.com>
  5. */
  6. class MTool_Command_Current extends MTool_Command_Abstract
  7. {
  8. const HELP_TITLE = 'current';
  9. const HELP_SHORT = 'Show current migration';
  10. const HELP_DESCRIPTION = '';
  11. /**
  12. * Main method, implements command 'current'
  13. *
  14. * @param array $params
  15. */
  16. protected function _exec()
  17. {
  18. $current = $this->getCurrentMigration();
  19. if ($current != '0') {
  20. $this->addMessage('Current migration: ' . $current);
  21. } else {
  22. $this->addMessage('Current migration: none');
  23. }
  24. }
  25. }