Upgraded phpmyadmin to 4.0.4 (All Languages) - No modifications yet
[openemr.git] / phpmyadmin / libraries / engines / pbxt.lib.php
blobfc4e343f5ead651a4a9e0b619388ddf08c75b6d6
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * The PBXT storage engine
6 * @package PhpMyAdmin-Engines
7 */
8 if (! defined('PHPMYADMIN')) {
9 exit;
12 /**
13 * The PBXT storage engine
15 * @package PhpMyAdmin-Engines
17 class PMA_StorageEngine_pbxt extends PMA_StorageEngine
19 /**
20 * Returns array with variable names dedicated to PBXT storage engine
22 * @return array variable names
24 function getVariables()
26 return array(
27 'pbxt_index_cache_size' => array(
28 'title' => __('Index cache size'),
29 '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.'),
30 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
32 'pbxt_record_cache_size' => array(
33 'title' => __('Record cache size'),
34 '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.'),
35 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
37 'pbxt_log_cache_size' => array(
38 'title' => __('Log cache size'),
39 'desc' => __('The amount of memory allocated to the transaction log cache used to cache on transaction log data. The default is 16MB.'),
40 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
42 'pbxt_log_file_threshold' => array(
43 'title' => __('Log file threshold'),
44 'desc' => __('The size of a transaction log before rollover, and a new log is created. The default value is 16MB.'),
45 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
47 'pbxt_transaction_buffer_size' => array(
48 'title' => __('Transaction buffer size'),
49 'desc' => __('The size of the global transaction log buffer (the engine allocates 2 buffers of this size). The default is 1MB.'),
50 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
52 'pbxt_checkpoint_frequency' => array(
53 'title' => __('Checkpoint frequency'),
54 'desc' => __('The amount of data written to the transaction log before a checkpoint is performed. The default value is 24MB.'),
55 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
57 'pbxt_data_log_threshold' => array(
58 'title' => __('Data log threshold'),
59 '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.'),
60 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
62 'pbxt_garbage_threshold' => array(
63 'title' => __('Garbage threshold'),
64 '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.'),
65 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC
67 'pbxt_log_buffer_size' => array(
68 'title' => __('Log buffer size'),
69 '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.'),
70 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
72 'pbxt_data_file_grow_size' => array(
73 'title' => __('Data file grow size'),
74 'desc' => __('The grow size of the handle data (.xtd) files.'),
75 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
77 'pbxt_row_file_grow_size' => array(
78 'title' => __('Row file grow size'),
79 'desc' => __('The grow size of the row pointer (.xtr) files.'),
80 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE
82 'pbxt_log_file_count' => array(
83 'title' => __('Log file count'),
84 '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.'),
85 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC
90 /**
91 * returns the pbxt engine specific handling for
92 * PMA_ENGINE_DETAILS_TYPE_SIZE variables.
94 * @param string $formatted_size the size expression (for example 8MB)
96 * @return string the formatted value and its unit
98 function resolveTypeSize($formatted_size)
100 if (preg_match('/^[0-9]+[a-zA-Z]+$/', $formatted_size)) {
101 $value = PMA_Util::extractValueFromFormattedSize($formatted_size);
102 } else {
103 $value = $formatted_size;
105 return PMA_Util::formatByteDown($value);
108 //--------------------
109 function getInfoPages()
111 $pages = array();
112 $pages['Documentation'] = __('Documentation');
113 return $pages;
116 //--------------------
117 function getPage($id)
119 if (! array_key_exists($id, $this->getInfoPages())) {
120 return false;
123 $id = 'getPage' . $id;
125 return $this->$id();
128 function getPageDocumentation()
130 $output = '<p>'
131 . 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>')
132 . '</p>' . "\n"
133 . '<h3>' . __('Related Links') . '</h3>' . "\n"
134 . '<ul>' . "\n"
135 . '<li><a href="' . PMA_linkURL('http://pbxt.blogspot.com/') . '" target="_blank">' . __('The PrimeBase XT Blog by Paul McCullagh') . '</a></li>' . "\n"
136 . '</ul>' . "\n";
138 return $output;