fixed code indention
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
* display list of server enignes and additonal information about them
|
||||
*
|
||||
* @version $Id$
|
||||
* @todo falcon storage enginge is not listed under dev.mysql.com/doc/refman but dev.mysql.com/doc/falcon/
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -22,7 +23,7 @@ require_once './libraries/common.inc.php';
|
||||
* Does the common work
|
||||
*/
|
||||
require './libraries/server_common.inc.php';
|
||||
require './libraries/storage_engines.lib.php';
|
||||
require './libraries/StorageEngine.class.php';
|
||||
|
||||
|
||||
/**
|
||||
@@ -30,109 +31,11 @@ require './libraries/storage_engines.lib.php';
|
||||
*/
|
||||
require './libraries/server_links.inc.php';
|
||||
|
||||
/**
|
||||
* defines
|
||||
*/
|
||||
define('PMA_ENGINE_DETAILS_TYPE_PLAINTEXT', 0);
|
||||
define('PMA_ENGINE_DETAILS_TYPE_SIZE', 1);
|
||||
define('PMA_ENGINE_DETAILS_TYPE_NUMERIC', 2); //Has no effect yet...
|
||||
define('PMA_ENGINE_DETAILS_TYPE_BOOLEAN', 3); // 'ON' or 'OFF'
|
||||
|
||||
/**
|
||||
* Function for displaying the table of an engine's parameters
|
||||
*
|
||||
* @param array List of MySQL variables and corresponding localized descriptions.
|
||||
* The array elements should have the following format:
|
||||
* $variable => array('title' => $title, 'desc' => $description);
|
||||
* @param string Prefix for the SHOW VARIABLES query.
|
||||
* @return string The table that was generated based on the given information.
|
||||
*/
|
||||
function PMA_generateEngineDetails($variables, $like = null) {
|
||||
|
||||
/**
|
||||
* Get the variables!
|
||||
*/
|
||||
if (!empty($variables)) {
|
||||
$sql_query = 'SHOW '
|
||||
. (PMA_MYSQL_INT_VERSION >= 40102 ? 'GLOBAL ' : '')
|
||||
. 'VARIABLES'
|
||||
. (empty($like) ? '' : ' LIKE \'' . $like . '\'')
|
||||
. ';';
|
||||
$res = PMA_DBI_query($sql_query);
|
||||
$mysql_vars = array();
|
||||
while ($row = PMA_DBI_fetch_row($res)) {
|
||||
if (isset($variables[$row[0]])) {
|
||||
$mysql_vars[$row[0]] = $row[1];
|
||||
}
|
||||
}
|
||||
PMA_DBI_free_result($res);
|
||||
}
|
||||
|
||||
if (empty($mysql_vars)) {
|
||||
return '<p>' . "\n"
|
||||
. ' ' . $GLOBALS['strNoDetailsForEngine'] . "\n"
|
||||
. '</p>' . "\n";
|
||||
}
|
||||
|
||||
$dt_table = '<table class="data">' . "\n";
|
||||
$odd_row = false;
|
||||
$has_content = false;
|
||||
|
||||
foreach ($variables as $var => $details) {
|
||||
if (!isset($mysql_vars[$var])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($details['type'])) {
|
||||
$details['type'] = PMA_ENGINE_DETAILS_TYPE_PLAINTEXT;
|
||||
}
|
||||
$is_num = $details['type'] == PMA_ENGINE_DETAILS_TYPE_SIZE
|
||||
|| $details['type'] == PMA_ENGINE_DETAILS_TYPE_NUMERIC;
|
||||
|
||||
$dt_table .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">' . "\n"
|
||||
. ' <td>' . "\n";
|
||||
if (!empty($variables[$var]['desc'])) {
|
||||
$dt_table .= ' ' . PMA_showHint($details['desc']) . "\n";
|
||||
}
|
||||
$dt_table .= ' </td>' . "\n"
|
||||
. ' <th>'
|
||||
. htmlspecialchars(empty($details['title'])
|
||||
? $var : $details['title']) . "\n"
|
||||
. ' </th>' . "\n"
|
||||
. ' <td class="value">';
|
||||
switch ($details['type']) {
|
||||
case PMA_ENGINE_DETAILS_TYPE_SIZE:
|
||||
$parsed_size = PMA_formatByteDown($mysql_vars[$var]);
|
||||
$dt_table .= $parsed_size[0] . ' ' . $parsed_size[1];
|
||||
unset($parsed_size);
|
||||
break;
|
||||
case PMA_ENGINE_DETAILS_TYPE_NUMERIC:
|
||||
$dt_table .= PMA_formatNumber($mysql_vars[$var]) . ' ';
|
||||
break;
|
||||
default:
|
||||
$dt_table .= htmlspecialchars($mysql_vars[$var]) . ' ';
|
||||
}
|
||||
$dt_table .= '</td>' . "\n"
|
||||
. '</tr>' . "\n";
|
||||
$odd_row = !$odd_row;
|
||||
$has_content = true;
|
||||
}
|
||||
|
||||
if (!$has_content) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$dt_table .= '</table>' . "\n";
|
||||
|
||||
return $dt_table;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Did the user request information about a certain storage engine?
|
||||
*/
|
||||
if (empty($_REQUEST['engine'])
|
||||
|| empty($mysql_storage_engines[$_REQUEST['engine']])) {
|
||||
|| ! PMA_StorageEngine::isValid($_REQUEST['engine'])) {
|
||||
|
||||
/**
|
||||
* Displays the sub-page heading
|
||||
@@ -163,7 +66,7 @@ if (empty($_REQUEST['engine'])
|
||||
* Listing the storage engines
|
||||
*/
|
||||
$odd_row = true;
|
||||
foreach ($mysql_storage_engines as $engine => $details) {
|
||||
foreach (PMA_StorageEngine::getStorageEngines() as $engine => $details) {
|
||||
echo '<tr class="'
|
||||
. ($odd_row ? 'odd' : 'even')
|
||||
. ($details['Support'] == 'NO' || $details['Support'] == 'DISABLED'
|
||||
@@ -242,8 +145,7 @@ if (empty($_REQUEST['engine'])
|
||||
} else {
|
||||
echo '<p> ' . $engine_plugin->getSupportInformationMessage() . "\n"
|
||||
. '</p>' . "\n"
|
||||
. PMA_generateEngineDetails($engine_plugin->getVariables(),
|
||||
$engine_plugin->getVariablesLikePattern());
|
||||
. $engine_plugin->getHtmlVariables();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user