You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

InstallMiddleware.php 555B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace app\http\middleware;
  3. use app\Request;
  4. use crmeb\interfaces\MiddlewareInterface;
  5. /**
  6. * Class InstallMiddleware
  7. * @package app\http\middleware
  8. */
  9. class InstallMiddleware implements MiddlewareInterface
  10. {
  11. public function handle(Request $request, \Closure $next)
  12. {
  13. //检测是否已安装CRMEB系统
  14. if (file_exists(root_path() . "public/install/") && !file_exists(root_path() . "public/install/install.lock")) {
  15. return redirect('/install/index');
  16. }
  17. return $next($request);
  18. }
  19. }