Middleware.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: 刘志淳 <chun@engineer.com>
  10. // +----------------------------------------------------------------------
  11. namespace think\console\command\make;
  12. use think\console\command\Make;
  13. class Middleware extends Make
  14. {
  15. protected $type = "Middleware";
  16. protected function configure()
  17. {
  18. parent::configure();
  19. $this->setName('make:middleware')
  20. ->setDescription('Create a new middleware class');
  21. }
  22. protected function getStub()
  23. {
  24. return __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'middleware.stub';
  25. }
  26. protected function getNamespace($appNamespace, $module)
  27. {
  28. return parent::getNamespace($appNamespace, 'http') . '\middleware';
  29. }
  30. }