phpmyadmin/libraries/classes/Controllers/Setup/ConfigController.php
Maurício Meneghini Fauth 8f2f3eff40
Remove the Core::isValid method
This improves the type checking and simplifies the code.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-02 13:20:50 -03:00

38 lines
942 B
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\Controllers\Setup;
use PhpMyAdmin\Setup\ConfigGenerator;
use function is_scalar;
class ConfigController extends AbstractController
{
/**
* @param array $params Request parameters
*
* @return string HTML
*/
public function __invoke(array $params): string
{
$pages = $this->getPages();
static $hasCheckPageRefresh = false;
if (! $hasCheckPageRefresh) {
$hasCheckPageRefresh = true;
}
$config = ConfigGenerator::getConfigFile($this->config);
return $this->template->render('setup/config/index', [
'formset' => $params['formset'] ?? '',
'pages' => $pages,
'eol' => isset($params['eol']) && is_scalar($params['eol']) ? $params['eol'] : 'unix',
'config' => $config,
'has_check_page_refresh' => $hasCheckPageRefresh,
]);
}
}