<?php
/**
 * Generated configuration file
 * Generated by: phpMyAdmin 5.2.1 setup script
 * Date: Sat, 14 Sep 2024 02:05:47 +0000
 */

/* Servers configuration */
$i = 0;

/* Server: localhost [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = 'localhost';
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = 3306;
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['auth_type'] = 'signon';
$cfg['Servers'][$i]['SignonSession'] = 'SignonSession';
$cfg['Servers'][$i]['SignonURL'] = 'sso.php';

/*
 * phpMyAdmin configuration storage.
 *
 * setup.sh and scripts/updates/staging/wire-phpmyadmin-storage.sh create the
 * `phpmyadmin` database, the schema (via web-files/phpMyAdmin/sql/create_tables.sql),
 * a `pma` MySQL user scoped to that DB, and drop the random password at
 * /etc/whp/pma-password (mode 0600 root:root). We read it here at runtime
 * so the password is never committed and rotates with re-runs of the install.
 *
 * If the password file is missing (older install, or it got deleted), we leave
 * controluser/controlpass blank. phpMyAdmin still works for general queries;
 * the panel surfaces a soft "configuration storage not configured" notice
 * which is the same behaviour we had before this block. Re-running the
 * staging script fixes it.
 */
$pma_password_file = '/etc/whp/pma-password';
if (is_readable($pma_password_file)) {
    $cfg['Servers'][$i]['controlhost'] = '127.0.0.1';
    $cfg['Servers'][$i]['controlport'] = '3306';
    $cfg['Servers'][$i]['controluser'] = 'pma';
    $cfg['Servers'][$i]['controlpass'] = trim((string) @file_get_contents($pma_password_file));
    $cfg['Servers'][$i]['pmadb']                = 'phpmyadmin';
    $cfg['Servers'][$i]['bookmarktable']        = 'pma__bookmark';
    $cfg['Servers'][$i]['relation']             = 'pma__relation';
    $cfg['Servers'][$i]['table_info']           = 'pma__table_info';
    $cfg['Servers'][$i]['table_coords']         = 'pma__table_coords';
    $cfg['Servers'][$i]['pdf_pages']            = 'pma__pdf_pages';
    $cfg['Servers'][$i]['column_info']          = 'pma__column_info';
    $cfg['Servers'][$i]['history']              = 'pma__history';
    $cfg['Servers'][$i]['table_uiprefs']        = 'pma__table_uiprefs';
    $cfg['Servers'][$i]['tracking']             = 'pma__tracking';
    $cfg['Servers'][$i]['userconfig']           = 'pma__userconfig';
    $cfg['Servers'][$i]['recent']               = 'pma__recent';
    $cfg['Servers'][$i]['favorite']             = 'pma__favorite';
    $cfg['Servers'][$i]['users']                = 'pma__users';
    $cfg['Servers'][$i]['usergroups']           = 'pma__usergroups';
    $cfg['Servers'][$i]['navigationhiding']     = 'pma__navigationhiding';
    $cfg['Servers'][$i]['savedsearches']        = 'pma__savedsearches';
    $cfg['Servers'][$i]['central_columns']      = 'pma__central_columns';
    $cfg['Servers'][$i]['designer_settings']    = 'pma__designer_settings';
    $cfg['Servers'][$i]['export_templates']     = 'pma__export_templates';
}

$cfg['ZeroConf'] = true;