From e9c63abc3a2b0f802cfe3d989f26de109ca0b530 Mon Sep 17 00:00:00 2001 From: Aldarien Date: Mon, 20 Dec 2021 22:43:43 -0300 Subject: [PATCH] PHP info --- api/common/Controller/Base.php | 7 +++++++ api/resources/routes/base.php | 1 + 2 files changed, 8 insertions(+) diff --git a/api/common/Controller/Base.php b/api/common/Controller/Base.php index ea2e716..8153b7b 100644 --- a/api/common/Controller/Base.php +++ b/api/common/Controller/Base.php @@ -24,4 +24,11 @@ class Base { $key = urlencode(base64_encode($signature)); return $this->withJson($response, ['key' => $key]); } + public function info(Request $request, Response $response): Response { + ob_start(); + phpinfo(); + $data = ob_get_clean(); + $response->getBody()->write($data); + return $response; + } } diff --git a/api/resources/routes/base.php b/api/resources/routes/base.php index c818f29..2be3305 100644 --- a/api/resources/routes/base.php +++ b/api/resources/routes/base.php @@ -3,4 +3,5 @@ use Contabilidad\Common\Controller\Base; $app->get('/key/generate[/]', [Base::class, 'generate_key']); $app->get('/balance[/]', [Contabilidad\Common\Controller\TiposCategorias::class, 'balance']); +$app->get('/info', [Base::class, 'info']); $app->get('/', Base::class);