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