phpmyadmin/libraries/classes/Controllers/PhpInfoController.php
Maurício Meneghini Fauth db33dc2472 Move phpinfo entry point to routes file
Creates a new controller for the entry point.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2019-11-08 17:19:37 -03:00

31 lines
666 B
PHP

<?php
/**
* phpinfo() wrapper to allow displaying only when configured to do so.
* @package PhpMyAdmin\Controllers
*/
declare(strict_types=1);
namespace PhpMyAdmin\Controllers;
/**
* phpinfo() wrapper to allow displaying only when configured to do so.
* @package PhpMyAdmin\Controllers
*/
class PhpInfoController extends AbstractController
{
/**
* @return void
*/
public function index(): void
{
global $cfg;
$this->response->disable();
$this->response->getHeader()->sendHttpHeaders();
if ($cfg['ShowPhpInfo']) {
phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES);
}
}
}