TaoLer/app/middleware/Install.php

18 lines
360 B
PHP
Raw Normal View History

2020-02-19 20:42:01 +08:00
<?php
namespace app\middleware;
use think\facade\Request;
class Install
{
public function handle($request, \Closure $next)
{
2021-12-21 16:34:33 +08:00
$app = app('http')->getName();
if($app !== 'install' && !file_exists('./install.lock')){
2020-02-19 20:42:01 +08:00
return redirect('/install/index');
//header('Location:'.Request::domain().'/install.php');
}
2021-12-21 16:34:33 +08:00
return $next($request);
2020-02-19 20:42:01 +08:00
}
}