You've already forked phpmyadmin
mirror of
https://github.com/phpmyadmin/phpmyadmin.git
synced 2026-10-23 18:29:15 +03:00
27 lines
668 B
PHP
27 lines
668 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace PhpMyAdmin\Controllers;
|
|
|
|
use PhpMyAdmin\Dbal\DatabaseInterface;
|
|
use PhpMyAdmin\Http\Response;
|
|
use PhpMyAdmin\Http\ServerRequest;
|
|
use PhpMyAdmin\ResponseRenderer;
|
|
use PhpMyAdmin\Routing\Route;
|
|
|
|
#[Route('/databases', ['POST'])]
|
|
final class DatabaseController implements InvocableController
|
|
{
|
|
public function __construct(private readonly ResponseRenderer $response, private readonly DatabaseInterface $dbi)
|
|
{
|
|
}
|
|
|
|
public function __invoke(ServerRequest $request): Response
|
|
{
|
|
$this->response->addJSON(['databases' => $this->dbi->getDatabaseList()]);
|
|
|
|
return $this->response->response();
|
|
}
|
|
}
|