initial commit
This commit is contained in:
commit
3f64f4a49a
221 files changed
+26665
No files matched your search
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rsgrinko\Proton\Http\Middleware;
|
||||
|
||||
use Rsgrinko\Proton\Http\Request;
|
||||
use Rsgrinko\Proton\Http\Response;
|
||||
use Rsgrinko\Proton\Install\Installer;
|
||||
use Rsgrinko\Proton\View\View;
|
||||
|
||||
/**
|
||||
* Веб-установщик открыт, только пока приложение не установлено.
|
||||
*
|
||||
* Иначе мастером воспользовался бы любой прохожий: он пишет .env и заводит
|
||||
* администратора.
|
||||
*/
|
||||
final class Install
|
||||
{
|
||||
public function __invoke(Request $request, callable $next): Response
|
||||
{
|
||||
if (Installer::installed()) {
|
||||
return Response::redirect(View::route('home'));
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user