📄 setup.php
字号:
<?php/* $Id: setup.php,v 1.23.2.10.2.1 2006/08/01 14:01:37 lem9 Exp $ */// vim: expandtab sw=4 ts=4 sts=4:// phpMyAdmin setup script by Michal 膶iha艡 <michal@cihar.com>// Grab phpMyAdmin version and PMA_dl functiondefine( 'PMA_MINIMUM_COMMON', TRUE );chdir('..');require_once('./libraries/common.lib.php');// Grab configuration defaults$PMA_Config = new PMA_Config();// Script information$script_info = 'phpMyAdmin ' . $PMA_Config->get('PMA_VERSION') . ' setup script by Michal 膶iha艡 <michal@cihar.com>';$script_version = '$Id: setup.php,v 1.23.2.10.2.1 2006/08/01 14:01:37 lem9 Exp $';// Grab actionif (isset($_POST['action'])) { $action = $_POST['action'];} else { $action = '';}if (isset($_POST['configuration']) && $action != 'clear' ) { // Grab previous configuration, if it should not be cleared $configuration = unserialize($_POST['configuration']);} else { // Start with empty configuration $configuration = array();}// We rely on Servers array to exist, so create it hereif (!isset($configuration['Servers']) || !is_array($configuration['Servers'])) { $configuration['Servers'] = array();}// Used later$now = gmdate('D, d M Y H:i:s') . ' GMT';// General header for no cachingheader('Expires: ' . $now); // rfc2616 - Section 14.21header('Last-Modified: ' . $now);header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1header('Pragma: no-cache'); // HTTP/1.0// whether to show html header?if ($action != 'download') {// Define the charset to be usedheader('Content-Type: text/html; charset=utf-8');// this needs to be echoed otherwise php with short tags complainsecho '<?xml version="1.0" encoding="utf-8"?>' . "\n";?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"><head> <link rel="icon" href="../favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> <title>phpMyAdmin <?php echo $PMA_Config->get('PMA_VERSION'); ?> setup</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" language="javascript"> //<![CDATA[ // show this window in top frame if (top != self) { window.top.location.href=location; } //]]> </script> <style type="text/css"> /* message boxes: warning, error, stolen from original theme */ div.notice { color: #000000; background-color: #FFFFDD; } h1.notice, div.notice { margin: 0.5em 0 0.5em 0; border: 0.1em solid #FFD700; background-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/s_notice.png); background-repeat: no-repeat; background-position: 10px 50%; padding: 10px 10px 10px 36px; } div.notice h1 { border-bottom: 0.1em solid #FFD700; font-weight: bold; font-size: large; text-align: left; margin: 0 0 0.2em 0; } div.warning { color: #CC0000; background-color: #FFFFCC; } h1.warning, div.warning { margin: 0.5em 0 0.5em 0; border: 0.1em solid #CC0000; background-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/s_warn.png); background-repeat: no-repeat; background-position: 10px 50%; padding: 10px 10px 10px 36px; } div.warning h1 { border-bottom: 0.1em solid #cc0000; font-weight: bold; text-align: left; font-size: large; margin: 0 0 0.2em 0; } div.error { background-color: #FFFFCC; color: #ff0000; } h1.error, div.error { margin: 0.5em 0 0.5em 0; border: 0.1em solid #ff0000; background-image: url(../<?php echo $GLOBALS['cfg']['ThemePath']; ?>/original/img/s_error.png); background-repeat: no-repeat; background-position: 10px 50%; padding: 10px 10px 10px 36px; } div.error h1 { border-bottom: 0.1em solid #ff0000; font-weight: bold; text-align: left; font-size: large; margin: 0 0 0.2em 0; } fieldset.toolbar form.action { display: block; width: auto; clear: none; float: left; margin: 0; padding: 0; border-right: 1px solid black; } fieldset.toolbar form.action input, fieldset.toolbar form.action select { margin: 0.7em; padding: 0.1em; } fieldset.toolbar { display: block; width: 100%; background-color: #dddddd; padding: 0; } fieldset.optbox { padding: 0; background-color: #FFFFDD; } div.buttons, div.opts, fieldset.optbox p, fieldset.overview div.row { clear: both; padding: 0.5em; margin: 0; background-color: white; } div.opts, fieldset.optbox p, fieldset.overview div.row { border-bottom: 1px dotted black; } fieldset.overview { display: block; width: 100%; padding: 0; } fieldset.optbox p { background-color: #FFFFDD; } div.buttons { background-color: #dddddd; } div.buttons input { margin: 0 1em 0 1em; } div.buttons form { display: inline; margin: 0; padding: 0; } input.save { color: green; font-weight: bolder; } input.cancel { color: red; font-weight: bolder; } div.desc, label.desc, fieldset.overview div.desc { float: left; width: 27em; max-width: 60%; } code:before, code:after { content: '"'; } a.doc { margin: 0 1em 0 1em; } a.doc img { border: none; } </style></head><body><h1>phpMyAdmin <?php echo $PMA_Config->get('PMA_VERSION'); ?> setup</h1><?php} // end show html header/** * Calculates numerical equivalent of phpMyAdmin version string * * @param string version * * @return mixed FALSE on failure, integer on success */function version_to_int($version) { if (!preg_match('/^(\d+)\.(\d+)\.(\d+)((\.|-(pl|rc|dev|beta|alpha))(\d+)?)?$/', $version, $matches)) { return FALSE; } if (!empty($matches[6])) { switch ($matches[6]) { case 'pl': $added = 60; break; case 'rc': $added = 30; break; case 'beta': $added = 20; break; case 'alpha': $added = 10; break; case 'dev': $added = 0; break; default: message('notice', 'Unknown version part: ' . htmlspecialchars($matches[5])); $added = 0; break; } } else { $added = 50; // for final } if (!empty($matches[7])) { $added = $added + $matches[7]; } return $matches[1] * 1000000 + $matches[2] * 10000 + $matches[3] * 100 + $added;}/** * Returns link to documentation of some configuration directive * * @param string confguration directive name * * @return string HTML link to documentation */function get_cfg_doc($anchor) { return '<a href="../Documentation.html#cfg_' . $anchor . '" target="pma_doc" class="doc"><img class="icon" src="../' . $GLOBALS['cfg']['ThemePath'] . '/original/img/b_help.png" width="11" height="11" alt="Documentation" title="Documentation" /></a>';}/** * Displays message * * @param string type of message (notice/warning/error) * @param string text of message * @param title optional title of message * * @return nothing */function message($type, $text, $title = '') { echo '<div class="' . $type . '">' . "\n"; if (!empty($title)) { echo '<h1>'; echo $title; echo '</h1>' . "\n"; } echo $text . "\n"; echo '</div>' . "\n";}/** * Creates hidden input required for keeping current configuraion * * @return string HTML with hidden inputs */function get_hidden_cfg() { global $configuration; return '<input type="hidden" name="configuration" value="' . htmlspecialchars(serialize($configuration)) . '" />' . "\n";}/** * Creates form for some action * * @param string action name * @param string form title * @param string optional additional inputs * * @return string HTML with form */function get_action($name, $title, $added = '', $enabled = TRUE) { $ret = ''; $ret .= '<form class="action" method="post" action="">'; $ret .= '<input type="hidden" name="token" value="' . $_SESSION['PMA_token'] . '" />'; $ret .= '<input type="hidden" name="action" value="' . $name . '" />'; $ret .= $added; $ret .= '<input type="submit" value="' . $title . '"'; if (!$enabled) { $ret .= ' disabled="disabled"'; } $ret .= ' />'; $ret .= get_hidden_cfg(); $ret .= '</form>'; $ret .= "\n"; return $ret;}/** * Creates form for going to some url * * @param string URL where to go * @param string form title * @param string optional array of parameters * * @return string HTML with form */function get_url_action($url, $title, $params = array()) { $ret = ''; $ret .= '<form class="action" method="get" action="' . $url . '" target="_blank">'; $ret .= '<input type="hidden" name="token" value="' . $_SESSION['PMA_token'] . '" />'; foreach ($params as $key => $val) { $ret .= '<input type="hidden" name="' . $key . '" value="' . $val . '" />'; } $ret .= '<input type="submit" value="' . $title . '" />'; $ret .= '</form>'; $ret .= "\n";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -