InstallMiddleware.php 500 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace app\common\middleware;
  3. use app\Request;
  4. use think\exception\HttpResponseException;
  5. use think\facade\Route;
  6. use think\Response;
  7. class InstallMiddleware extends BaseMiddleware
  8. {
  9. public function before(Request $request)
  10. {
  11. if(!file_exists(__DIR__.'/../../../install/install.lock')){
  12. throw new HttpResponseException( Response::create('/install.html', 'redirect')->code(302));
  13. }
  14. }
  15. public function after(Response $response)
  16. {
  17. }
  18. }