PageRenderTime 31ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

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

https://bitbucket.org/adarshj/convenient_website
PHP | 137 lines | 105 code | 9 blank | 23 comment | 3 complexity | d738761ad3b376cd5f702de16ca13e94 MD5 | raw file
Possible License(s): Apache-2.0, MPL-2.0-no-copyleft-exception, LGPL-2.1, BSD-2-Clause, GPL-2.0, LGPL-3.0
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * @package PhpMyAdmin-Engines
  5. */
  6. /**
  7. * the MyISAM storage engine
  8. * @package PhpMyAdmin-Engines
  9. */
  10. class PMA_StorageEngine_pbxt extends PMA_StorageEngine
  11. {
  12. /**
  13. * returns array with variable names dedicated to PBXT storage engine
  14. *
  15. * @return array variable names
  16. */
  17. function getVariables()
  18. {
  19. return array(
  20. 'pbxt_index_cache_size' => array(
  21. 'title' => __('Index cache size'),
  22. '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.'),
  23. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  24. ),
  25. 'pbxt_record_cache_size' => array(
  26. 'title' => __('Record cache size'),
  27. '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.'),
  28. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  29. ),
  30. 'pbxt_log_cache_size' => array(
  31. 'title' => __('Log cache size'),
  32. 'desc' => __('The amount of memory allocated to the transaction log cache used to cache on transaction log data. The default is 16MB.'),
  33. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  34. ),
  35. 'pbxt_log_file_threshold' => array(
  36. 'title' => __('Log file threshold'),
  37. 'desc' => __('The size of a transaction log before rollover, and a new log is created. The default value is 16MB.'),
  38. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  39. ),
  40. 'pbxt_transaction_buffer_size' => array(
  41. 'title' => __('Transaction buffer size'),
  42. 'desc' => __('The size of the global transaction log buffer (the engine allocates 2 buffers of this size). The default is 1MB.'),
  43. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  44. ),
  45. 'pbxt_checkpoint_frequency' => array(
  46. 'title' => __('Checkpoint frequency'),
  47. 'desc' => __('The amount of data written to the transaction log before a checkpoint is performed. The default value is 24MB.'),
  48. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  49. ),
  50. 'pbxt_data_log_threshold' => array(
  51. 'title' => __('Data log threshold'),
  52. '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.'),
  53. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  54. ),
  55. 'pbxt_garbage_threshold' => array(
  56. 'title' => __('Garbage threshold'),
  57. '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.'),
  58. 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC
  59. ),
  60. 'pbxt_log_buffer_size' => array(
  61. 'title' => __('Log buffer size'),
  62. '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.'),
  63. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  64. ),
  65. 'pbxt_data_file_grow_size' => array(
  66. 'title' => __('Data file grow size'),
  67. 'desc' => __('The grow size of the handle data (.xtd) files.'),
  68. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  69. ),
  70. 'pbxt_row_file_grow_size' => array(
  71. 'title' => __('Row file grow size'),
  72. 'desc' => __('The grow size of the row pointer (.xtr) files.'),
  73. 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
  74. ),
  75. 'pbxt_log_file_count' => array(
  76. 'title' => __('Log file count'),
  77. '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.'),
  78. 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC
  79. ),
  80. );
  81. }
  82. /**
  83. * returns the pbxt engine specific handling for
  84. * PMA_ENGINE_DETAILS_TYPE_SIZE variables.
  85. *
  86. * @param string $formatted_size the size expression (for example 8MB)
  87. *
  88. * @return string the formatted value and its unit
  89. */
  90. function resolveTypeSize($formatted_size)
  91. {
  92. if (preg_match('/^[0-9]+[a-zA-Z]+$/', $formatted_size)) {
  93. $value = PMA_extractValueFromFormattedSize($formatted_size);
  94. } else {
  95. $value = $formatted_size;
  96. }
  97. return PMA_formatByteDown($value);
  98. }
  99. //--------------------
  100. function getInfoPages()
  101. {
  102. $pages = array();
  103. $pages['Documentation'] = __('Documentation');
  104. return $pages;
  105. }
  106. //--------------------
  107. function getPage($id)
  108. {
  109. if (! array_key_exists($id, $this->getInfoPages())) {
  110. return false;
  111. }
  112. $id = 'getPage' . $id;
  113. return $this->$id();
  114. }
  115. function getPageDocumentation()
  116. {
  117. $output = '<p>'
  118. . 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>')
  119. . '</p>' . "\n"
  120. . '<h3>' . __('Related Links') . '</h3>' . "\n"
  121. . '<ul>' . "\n"
  122. . '<li><a href="' . PMA_linkURL('http://pbxt.blogspot.com/') . '" target="_blank">' . __('The PrimeBase XT Blog by Paul McCullagh') . '</a></li>' . "\n"
  123. . '<li><a href="' . PMA_linkURL('http://www.blobstreaming.org/') . '" target="_blank">' . __('The PrimeBase Media Streaming (PBMS) home page') . '</a></li>' . "\n"
  124. . '</ul>' . "\n";
  125. return $output;
  126. }
  127. }
  128. ?>