2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Front controller for config view / download and clear
6 * @package PhpMyAdmin-Setup
8 use PhpMyAdmin\Setup\ConfigGenerator
;
9 use PhpMyAdmin\Config\Forms\Setup\ConfigForm
;
12 use PhpMyAdmin\Response
;
17 require './lib/common.inc.php';
19 $form_display = new ConfigForm($GLOBALS['ConfigFile']);
20 $form_display->save('Config');
22 $response = Response
::getInstance();
24 if (isset($_POST['eol'])) {
25 $_SESSION['eol'] = ($_POST['eol'] == 'unix') ?
'unix' : 'win';
28 if (Core
::ifSetOr($_POST['submit_clear'], '')) {
30 // Clear current config and return to main page
32 $GLOBALS['ConfigFile']->resetConfigData();
34 $response->generateHeader303('index.php' . Url
::getCommonRaw());
36 } elseif (Core
::ifSetOr($_POST['submit_download'], '')) {
38 // Output generated config file
40 Core
::downloadHeader('config.inc.php', 'text/plain');
42 echo ConfigGenerator
::getConfigFile($GLOBALS['ConfigFile']);
46 // Show generated config file in a <textarea>
48 $response->generateHeader303('index.php' . Url
::getCommonRaw(array('page' => 'config')));