?? setup.php
字號:
<?php/** * phpMyAdmin setup script * * PHP versions 4 and 5 * * @category Setup * @package phpMyAdmin-setup * @author Michal 膶iha艡 <michal@cihar.com> * @copyright 2006 Michal 膶iha艡 <michal@cihar.com> * @license http://www.gnu.org/licenses/gpl.html GNU GPL 2.0 * @version Subversion $Id: setup.php 9697 2006-11-13 08:32:28Z nijel $ *//* $Id: setup.php 9697 2006-11-13 08:32:28Z nijel $ */// vim: expandtab sw=4 ts=4 sts=4:// Grab phpMyAdmin version and PMA_dl functiondefine( 'PMA_MINIMUM_COMMON', TRUE );chdir('..');require_once('./libraries/common.lib.php');// Grab configuration defaults// Do not use $PMA_Config, it interferes with the one in $_SESSION// on servers with register_globals enabled$PMA_Config_Setup = new PMA_Config();// Script information$script_info = 'phpMyAdmin ' . $PMA_Config_Setup->get('PMA_VERSION') . ' setup script by Michal 膶iha艡 <michal@cihar.com>';$script_version = '$Id: setup.php 9697 2006-11-13 08:32:28Z nijel $';// Grab actionif (isset($_POST['action'])) { $action = $_POST['action'];} else { $action = '';}// Grab wanted CRLF typeif (isset($_POST['eoltype'])) { $eoltype = $_POST['eoltype'];} else { if (PMA_USR_OS == 'Win') { $eoltype = 'dos'; } else { $eoltype = 'unix'; }}// Detect which CRLF to useif ($eoltype == 'dos') { $crlf = "\r\n";} elseif ($eoltype == 'mac') { $crlf = "\r";} else { $crlf = "\n";}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_Setup->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: '"'; } span.doc { margin: 0 1em 0 1em; } span.doc a { margin: 0 0.1em 0 0.1em; } span.doc a img { border: none; } </style></head><body><h1>phpMyAdmin <?php echo $PMA_Config_Setup->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) { /* Link for wiki */ $wiki = $anchor; if (strncmp($anchor, 'Servers_', 8) == 0) { $wiki = substr($anchor, 8); } return '<span class="doc">' . '<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>' . '<a href="http://wiki.cihar.com/pma/Config#' . $wiki . '" target="pma_doc" class="doc">' . '<img class="icon" src="../' . $GLOBALS['cfg']['ThemePath'] . '/original/img/b_info.png" width="11" height="11" alt="Wiki" title="Wiki" />' . '</a>' . '</span>' ;}/** * 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, $eoltype; $ret = '<input type="hidden" name="configuration" value="' . htmlspecialchars(serialize($configuration)) . '" />' . "\n"; $ret .= '<input type="hidden" name="eoltype" value="' . htmlspecialchars($eoltype) . '" />' . "\n";
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -