Various updates
This commit is contained in:
20
api/common/Middleware/Install.php
Normal file
20
api/common/Middleware/Install.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
namespace ProVM\Common\Middleware;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Server\RequestHandlerInterface;
|
||||
use ProVM\Common\Service\Install as Service;
|
||||
|
||||
class Install
|
||||
{
|
||||
public function __construct(protected Service $service) {}
|
||||
|
||||
public function __invoke(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
||||
{
|
||||
if (!$this->service->check()) {
|
||||
$this->service->install();
|
||||
}
|
||||
return $handler->handle($request);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user