server_status_advisor.lib.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * functions for displaying server status sub item: advisor
  5. *
  6. * @usedby server_status_advisor.php
  7. *
  8. * @package PhpMyAdmin
  9. */
  10. if (! defined('PHPMYADMIN')) {
  11. exit;
  12. }
  13. /**
  14. * Returns html with Advisor
  15. *
  16. * @return string
  17. */
  18. function PMA_getHtmlForAdvisor()
  19. {
  20. $output = '<a href="#openAdvisorInstructions">';
  21. $output .= PMA_Util::getIcon('b_help.png', __('Instructions'));
  22. $output .= '</a>';
  23. $output .= '<div id="statustabs_advisor"></div>';
  24. $output .= '<div id="advisorInstructionsDialog" style="display:none;">';
  25. $output .= '<p>';
  26. $output .= __(
  27. 'The Advisor system can provide recommendations '
  28. . 'on server variables by analyzing the server status variables.'
  29. );
  30. $output .= '</p>';
  31. $output .= '<p>';
  32. $output .= __(
  33. 'Do note however that this system provides recommendations '
  34. . 'based on simple calculations and by rule of thumb which may '
  35. . 'not necessarily apply to your system.'
  36. );
  37. $output .= '</p>';
  38. $output .= '<p>';
  39. $output .= __(
  40. 'Prior to changing any of the configuration, be sure to know '
  41. . 'what you are changing (by reading the documentation) and how '
  42. . 'to undo the change. Wrong tuning can have a very negative '
  43. . 'effect on performance.'
  44. );
  45. $output .= '</p>';
  46. $output .= '<p>';
  47. $output .= __(
  48. 'The best way to tune your system would be to change only one '
  49. . 'setting at a time, observe or benchmark your database, and undo '
  50. . 'the change if there was no clearly measurable improvement.'
  51. );
  52. $output .= '</p>';
  53. $output .= '</div>';
  54. $output .= '<div id="advisorData" style="display:none;">';
  55. $advisor = new Advisor();
  56. $output .= htmlspecialchars(
  57. json_encode(
  58. $advisor->run()
  59. )
  60. );
  61. $output .= '</div>';
  62. return $output;
  63. }
  64. ?>