From 95fa17e47e6bd3223baa7d47a3258742e61fdc97 Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Wed, 30 Nov 2005 15:32:47 +0000 Subject: [PATCH] user class PMA_Config --- scripts/setup.php | 147 +++++++++++++++++++++++----------------------- 1 file changed, 75 insertions(+), 72 deletions(-) diff --git a/scripts/setup.php b/scripts/setup.php index 2485ffa5d..308b981ca 100644 --- a/scripts/setup.php +++ b/scripts/setup.php @@ -1,22 +1,25 @@ - // Grab phpMyAdmin version and PMA_dl function -$cfg['GD2Available'] = 'auto'; -require('../libraries/defines.lib.php'); -unset($cfg); +define( 'PMA_MINIMUM_COMMON', TRUE ); +chdir('..'); +require_once('./libraries/common.lib.php'); // Script information $script_info = 'phpMyAdmin ' . PMA_VERSION . ' setup script by Michal Čihař '; $script_version = '$Id$'; + // Grab configuration defaults -require('../config.default.php'); +$PMA_Config = new PMA_Config(); +$PMA_Config->enableBc(); $default_cfg = $cfg; -unset($cfg); +unset( $cfg ); +chdir('scripts'); /** * Removes slashes from string if needed (eg. magic quotes are enabled) @@ -69,7 +72,7 @@ if ($action != 'download') { header('Content-Type: text/html; charset=utf-8'); // this needs to be echoed otherwise php with short tags complains -echo '' . "\n"; +echo '' . "\n"; ?> @@ -315,7 +318,7 @@ function message($type, $text, $title = '') { */ function get_hidden_cfg() { global $cfg; - + return '' . "\n"; } @@ -380,7 +383,7 @@ function footer() { */ function get_server_auth($val) { global $default_cfg; - + if (isset($val['auth_type'])) { $auth = $val['auth_type']; } else { @@ -419,7 +422,7 @@ function get_server_name($val, $id = FALSE) { } /** - * Creates configuration PHP code + * Creates configuration PHP code * * @param array configuration * @@ -474,7 +477,7 @@ function get_cfg_string($cfg) { $ret .= "\$cfg['$key'] = " . var_export($val, TRUE) . ";\n"; } } - + $ret .= "?>\n"; return $ret; } @@ -499,7 +502,7 @@ function compress_servers(&$cfg) { /** * Grabs values from POST * - * @param string list of values to grab, values are separated by ";", + * @param string list of values to grab, values are separated by ";", * each can have defined type separated by ":", if no type * is defined, string is assumed. Possible types: bool - * boolean value, serialized - serialized value, int - @@ -602,9 +605,9 @@ function show_overview($title, $list, $buttons = '') { */ function show_config_form($list, $legend, $help, $defaults = array(), $save = '', $prefix = '') { global $default_cfg; - + if (empty($save)) $save = 'Update'; - + echo '
' . "\n"; echo '' . $legend . '' . "\n"; echo '

' . $help . '

' . "\n"; @@ -695,8 +698,8 @@ function show_security_form($defaults = array()) { ?>
- @@ -725,13 +728,13 @@ function show_manual_form($defaults = array()) { ?> - viewable type and http://dev.mysql.com/doc/refman as manual base URL.', $defaults); ?> @@ -751,15 +754,15 @@ function show_charset_form($defaults = array()) { ?> - @@ -779,12 +782,12 @@ function show_extensions_form($defaults = array()) { ?> - @@ -804,15 +807,15 @@ function show_relation_form($defaults = array()) { ?> - @@ -831,14 +834,14 @@ function show_upload_form($defaults = array()) { ?> - @@ -857,8 +860,8 @@ function show_server_form($defaults = array(), $number = FALSE) { ?> - '; } @@ -883,8 +886,8 @@ function show_server_form($defaults = array(), $number = FALSE) { array('phpMyAdmin control user', 'controluser', 'User which phpMyAdmin can use for various actions'), array('phpMyAdmin control user password', 'controlpass', 'Password for user which phpMyAdmin can use for various actions', 'password'), array('phpMyAdmin database for advanced features', 'pmadb', 'phpMyAdmin will allow much more when you enable this. Table names are filled in automatically.'), - ), - 'Configure server', + ), + 'Configure server', ($number === FALSE) ? 'Enter new server connection parameters.' : 'Editing server ' . get_server_name($defaults, $number), $defaults, $number === FALSE ? 'Add' : '', 'Servers_'); ?> @@ -903,8 +906,8 @@ function show_left_form($defaults = array()) { ?> - @@ -934,15 +937,15 @@ function show_tabs_form($defaults = array()) { ?> - @@ -961,16 +964,16 @@ function show_icons_form($defaults = array()) { ?> - @@ -989,8 +992,8 @@ function show_browse_form($defaults = array()) { ?> - @@ -1018,8 +1021,8 @@ function show_edit_form($defaults = array()) { ?> - @@ -1051,15 +1054,15 @@ function show_window_form($defaults = array()) { ?> - @@ -1075,7 +1078,7 @@ function show_window_form($defaults = array()) { * @return string HTML for server selection */ function get_server_selection($cfg) { - if (count($cfg['Servers']) == 0) return ''; + if (count($cfg['Servers']) == 0) return ''; $ret = '