"Fossies" - the Fresh Open Source Software Archive

Member "phpMyAdmin-5.1.0-all-languages/setup/config.php" (24 Feb 2021, 1371 Bytes) of package /linux/www/phpMyAdmin-5.1.0-all-languages.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "config.php": 5.0.4-english_vs_5.1.0-english.

    1 <?php
    2 /**
    3  * Front controller for config view / download and clear
    4  */
    5 
    6 declare(strict_types=1);
    7 
    8 use PhpMyAdmin\Config\Forms\Setup\ConfigForm;
    9 use PhpMyAdmin\Core;
   10 use PhpMyAdmin\Response;
   11 use PhpMyAdmin\Setup\ConfigGenerator;
   12 use PhpMyAdmin\Url;
   13 
   14 if (! defined('ROOT_PATH')) {
   15     // phpcs:disable PSR1.Files.SideEffects
   16     define('ROOT_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR);
   17     // phpcs:enable
   18 }
   19 
   20 /**
   21  * Core libraries.
   22  */
   23 require ROOT_PATH . 'setup/lib/common.inc.php';
   24 
   25 $form_display = new ConfigForm($GLOBALS['ConfigFile']);
   26 $form_display->save('Config');
   27 
   28 $response = Response::getInstance();
   29 $response->disable();
   30 
   31 if (isset($_POST['eol'])) {
   32     $_SESSION['eol'] = $_POST['eol'] === 'unix' ? 'unix' : 'win';
   33 }
   34 
   35 if (Core::ifSetOr($_POST['submit_clear'], '')) {
   36     // Clear current config and return to main page
   37     $GLOBALS['ConfigFile']->resetConfigData();
   38     // drop post data
   39     $response->generateHeader303('index.php' . Url::getCommonRaw());
   40     exit;
   41 }
   42 
   43 if (Core::ifSetOr($_POST['submit_download'], '')) {
   44     // Output generated config file
   45     Core::downloadHeader('config.inc.php', 'text/plain');
   46     $response->disable();
   47     echo ConfigGenerator::getConfigFile($GLOBALS['ConfigFile']);
   48     exit;
   49 }
   50 
   51 // Show generated config file in a <textarea>
   52 $response->generateHeader303('index.php' . Url::getCommonRaw(['page' => 'config']));
   53 exit;