home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / phpMyAdmin / server_variables.php < prev    next >
PHP Script  |  2008-06-23  |  2KB  |  122 lines

  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4.  *
  5.  * @version $Id: server_variables.php 10240 2007-04-01 11:02:46Z cybot_tm $
  6.  */
  7.  
  8. /**
  9.  *
  10.  */
  11. if (! defined('PMA_NO_VARIABLES_IMPORT')) {
  12.     define('PMA_NO_VARIABLES_IMPORT', true);
  13. }
  14. require_once './libraries/common.inc.php';
  15.  
  16. /**
  17.  * Does the common work
  18.  */
  19. require './libraries/server_common.inc.php';
  20.  
  21.  
  22. /**
  23.  * Displays the links
  24.  */
  25. require './libraries/server_links.inc.php';
  26.  
  27.  
  28. /**
  29.  * Displays the sub-page heading
  30.  */
  31. echo '<h2>' . "\n"
  32.    . ($cfg['MainPageIconic'] ? '<img class="icon" src="' . $pmaThemeImage . 's_vars.png" width="16" height="16" alt="" />' : '')
  33.    . '' . $strServerVars . "\n"
  34.    . '</h2>' . "\n";
  35.  
  36.  
  37. /**
  38.  * Sends the queries and buffers the results
  39.  */
  40. if (PMA_MYSQL_INT_VERSION >= 40003) {
  41.     $serverVars = PMA_DBI_fetch_result('SHOW SESSION VARIABLES;', 0, 1);
  42.     $serverVarsGlobal = PMA_DBI_fetch_result('SHOW GLOBAL VARIABLES;', 0, 1);
  43. } else {
  44.     $serverVars = PMA_DBI_fetch_result('SHOW VARIABLES;', 0, 1);
  45. }
  46.  
  47.  
  48. /**
  49.  * Displays the page
  50.  */
  51. ?>
  52. <table class="data">
  53. <thead>
  54. <tr><th><?php echo $strVar; ?></th>
  55.     <th>
  56. <?php
  57. if (PMA_MYSQL_INT_VERSION >= 40003) {
  58.     echo $strSessionValue . ' / ' . $strGlobalValue;
  59. } else {
  60.     echo $strValue;
  61. }
  62. ?>
  63.     </th>
  64. </tr>
  65. </thead>
  66. <tbody>
  67. <?php
  68. $odd_row = true;
  69. foreach ($serverVars as $name => $value) {
  70.     ?>
  71. <tr class="<?php
  72.     echo $odd_row ? 'odd' : 'even';
  73.     if (PMA_MYSQL_INT_VERSION >= 40003
  74.      && $serverVarsGlobal[$name] !== $value) {
  75.         echo ' marked';
  76.     }
  77.     ?>">
  78.     <th nowrap="nowrap">
  79.         <?php echo htmlspecialchars(str_replace('_', ' ', $name)); ?></th>
  80.     <td class="value"><?php
  81.     if (strlen($value) < 16 && is_numeric($value)) {
  82.         echo PMA_formatNumber($value, 0);
  83.         $is_numeric = true;
  84.     } else {
  85.         echo htmlspecialchars($value);
  86.         $is_numeric = false;
  87.     }
  88.     ?></td>
  89.     <?php
  90.     if (PMA_MYSQL_INT_VERSION >= 40003
  91.      && $serverVarsGlobal[$name] !== $value) {
  92.         ?>
  93. </tr>
  94. <tr class="<?php
  95.     echo $odd_row ? 'odd' : 'even';
  96.     ?> marked">
  97.     <td>(<?php echo $strGlobalValue; ?>)</td>
  98.     <td class="value"><?php
  99.     if ($is_numeric) {
  100.         echo PMA_formatNumber($serverVarsGlobal[$name], 0);
  101.     } else {
  102.         echo htmlspecialchars($serverVarsGlobal[$name]);
  103.     }
  104.     ?></td>
  105.     <?php } ?>
  106. </tr>
  107.     <?php
  108.     $odd_row = !$odd_row;
  109. }
  110. ?>
  111. </tbody>
  112. </table>
  113. <?php
  114.  
  115.  
  116. /**
  117.  * Sends the footer
  118.  */
  119. require_once './libraries/footer.inc.php';
  120.  
  121. ?>
  122.