/phpmyadmin/libraries/engines/pbxt.lib.php

https://github.com/drbowen/openemr · PHP · 142 lines · 107 code · 9 blank · 26 comment · 4 complexity · bf01ee84881c40bbf6d6c53569b527df MD5 · raw file

  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * The PBXT storage engine
  5. *
  6. * @package PhpMyAdmin-Engines
  7. */
  8. if (! defined('PHPMYADMIN')) {
  9. exit;
  10. }
  11. /**
  12. * The PBXT storage engine
  13. *
  14. * @package PhpMyAdmin-Engines
  15. */
  16. class PMA_StorageEngine_pbxt extends PMA_StorageEngine
  17. {
  18. /**
  19. * Returns array with variable names dedicated to PBXT storage engine
  20. *
  21. * @return array variable names
  22. */
  23. function getVariables()
  24. {
  25. return array(
  26. 'pbxt_index_cache_size' => array(
  27. 'title' => __('Index cache size'),
  28. 'desc' => __('This is the amount of memory allocated to the index cache. Default value is 32MB. The memory allocated here is used only for caching index pages.'),
  29. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  30. ),
  31. 'pbxt_record_cache_size' => array(
  32. 'title' => __('Record cache size'),
  33. 'desc' => __('This is the amount of memory allocated to the record cache used to cache table data. The default value is 32MB. This memory is used to cache changes to the handle data (.xtd) and row pointer (.xtr) files.'),
  34. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  35. ),
  36. 'pbxt_log_cache_size' => array(
  37. 'title' => __('Log cache size'),
  38. 'desc' => __('The amount of memory allocated to the transaction log cache used to cache on transaction log data. The default is 16MB.'),
  39. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  40. ),
  41. 'pbxt_log_file_threshold' => array(
  42. 'title' => __('Log file threshold'),
  43. 'desc' => __('The size of a transaction log before rollover, and a new log is created. The default value is 16MB.'),
  44. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  45. ),
  46. 'pbxt_transaction_buffer_size' => array(
  47. 'title' => __('Transaction buffer size'),
  48. 'desc' => __('The size of the global transaction log buffer (the engine allocates 2 buffers of this size). The default is 1MB.'),
  49. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  50. ),
  51. 'pbxt_checkpoint_frequency' => array(
  52. 'title' => __('Checkpoint frequency'),
  53. 'desc' => __('The amount of data written to the transaction log before a checkpoint is performed. The default value is 24MB.'),
  54. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  55. ),
  56. 'pbxt_data_log_threshold' => array(
  57. 'title' => __('Data log threshold'),
  58. 'desc' => __('The maximum size of a data log file. The default value is 64MB. PBXT can create a maximum of 32000 data logs, which are used by all tables. So the value of this variable can be increased to increase the total amount of data that can be stored in the database.'),
  59. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  60. ),
  61. 'pbxt_garbage_threshold' => array(
  62. 'title' => __('Garbage threshold'),
  63. 'desc' => __('The percentage of garbage in a data log file before it is compacted. This is a value between 1 and 99. The default is 50.'),
  64. 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC
  65. ),
  66. 'pbxt_log_buffer_size' => array(
  67. 'title' => __('Log buffer size'),
  68. 'desc' => __('The size of the buffer used when writing a data log. The default is 256MB. The engine allocates one buffer per thread, but only if the thread is required to write a data log.'),
  69. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  70. ),
  71. 'pbxt_data_file_grow_size' => array(
  72. 'title' => __('Data file grow size'),
  73. 'desc' => __('The grow size of the handle data (.xtd) files.'),
  74. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  75. ),
  76. 'pbxt_row_file_grow_size' => array(
  77. 'title' => __('Row file grow size'),
  78. 'desc' => __('The grow size of the row pointer (.xtr) files.'),
  79. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  80. ),
  81. 'pbxt_log_file_count' => array(
  82. 'title' => __('Log file count'),
  83. 'desc' => __('This is the number of transaction log files (pbxt/system/xlog*.xt) the system will maintain. If the number of logs exceeds this value then old logs will be deleted, otherwise they are renamed and given the next highest number.'),
  84. 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC
  85. ),
  86. );
  87. }
  88. /**
  89. * returns the pbxt engine specific handling for
  90. * PMA_ENGINE_DETAILS_TYPE_SIZE variables.
  91. *
  92. * @param string $formatted_size the size expression (for example 8MB)
  93. *
  94. * @return string the formatted value and its unit
  95. */
  96. function resolveTypeSize($formatted_size)
  97. {
  98. if (preg_match('/^[0-9]+[a-zA-Z]+$/', $formatted_size)) {
  99. $value = PMA_Util::extractValueFromFormattedSize($formatted_size);
  100. } else {
  101. $value = $formatted_size;
  102. }
  103. return PMA_Util::formatByteDown($value);
  104. }
  105. //--------------------
  106. function getInfoPages()
  107. {
  108. $pages = array();
  109. $pages['Documentation'] = __('Documentation');
  110. return $pages;
  111. }
  112. //--------------------
  113. function getPage($id)
  114. {
  115. if (! array_key_exists($id, $this->getInfoPages())) {
  116. return false;
  117. }
  118. $id = 'getPage' . $id;
  119. return $this->$id();
  120. }
  121. function getPageDocumentation()
  122. {
  123. $output = '<p>'
  124. . sprintf(__('Documentation and further information about PBXT can be found on the %sPrimeBase XT Home Page%s.'), '<a href="' . PMA_linkURL('http://www.primebase.com/xt/') . '" target="_blank">', '</a>')
  125. . '</p>' . "\n"
  126. . '<h3>' . __('Related Links') . '</h3>' . "\n"
  127. . '<ul>' . "\n"
  128. . '<li><a href="' . PMA_linkURL('http://pbxt.blogspot.com/') . '" target="_blank">' . __('The PrimeBase XT Blog by Paul McCullagh') . '</a></li>' . "\n"
  129. . '</ul>' . "\n";
  130. return $output;
  131. }
  132. }
  133. ?>