Service.php 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006-2018 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\app;
  12. use think\Service as BaseService;
  13. class Service extends BaseService
  14. {
  15. public function boot()
  16. {
  17. $this->app->event->listen('HttpRun', function () {
  18. $this->app->middleware->add(MultiApp::class);
  19. });
  20. $this->commands([
  21. 'build' => command\Build::class,
  22. 'clear' => command\Clear::class,
  23. ]);
  24. $this->app->bind([
  25. 'think\route\Url' => Url::class,
  26. ]);
  27. }
  28. }