This commit is contained in:
2022-11-25 20:52:52 -03:00
parent dd0410a0fb
commit efed50cd7f
39 changed files with 2777 additions and 5 deletions

View File

@ -0,0 +1,28 @@
<?php
namespace ProVM\Common\Controller;
use ProVM\Common\Implement\Controller\Json;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Exception;
use ProVM\Common\Service\Install as Service;
class Install
{
use Json;
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, Service $service): ResponseInterface
{
try {
$service->run();
return $this->withJson($response, [
'message' => 'Install finished'
]);
} catch (Exception $e) {
return $this->withJson($response, [
'message' => 'Install with error',
'error' => $e->getMessage()
]);
}
}
}