Merge remote-tracking branch 'origin/master'
[phpmyadmin.git] / libraries / config.values.php
bloba46ec3b3720915cdee3a63384ecfa9ecdded8a95
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Database with allowed values for configuration stored in the $cfg array,
5 * used by setup script and user preferences to generate forms.
7 * @package PhpMyAdmin
8 */
10 if (!defined('PHPMYADMIN')) {
11 exit;
14 /**
15 * Value meaning:
16 * o array - select field, array contains allowed values
17 * o string - type override
19 * Use normal array, paths won't be expanded
21 $cfg_db = array();
23 $cfg_db['Servers'] = array(
24 1 => array(
25 'port' => 'integer',
26 'connect_type' => array('tcp', 'socket'),
27 'auth_type' => array('config', 'http', 'signon', 'cookie'),
28 'AllowDeny' => array(
29 'order' => array('', 'deny,allow', 'allow,deny', 'explicit')
31 'only_db' => 'array'
34 $cfg_db['RecodingEngine'] = array('auto', 'iconv', 'recode', 'mb', 'none');
35 $cfg_db['OBGzip'] = array('auto', true, false);
36 $cfg_db['MemoryLimit'] = 'short_string';
37 $cfg_db['NavigationLogoLinkWindow'] = array('main', 'new');
38 $cfg_db['NavigationTreeDefaultTabTable'] = array(
39 'structure' => __('Structure'), // fields list
40 'sql' => __('SQL'), // SQL form
41 'search' => __('Search'), // search page
42 'insert' => __('Insert'), // insert row page
43 'browse' => __('Browse') // browse page
45 $cfg_db['NavigationTreeDefaultTabTable2'] = array(
46 '' => '', //don't display
47 'structure' => __('Structure'), // fields list
48 'sql' => __('SQL'), // SQL form
49 'search' => __('Search'), // search page
50 'insert' => __('Insert'), // insert row page
51 'browse' => __('Browse') // browse page
53 $cfg_db['NavigationTreeDbSeparator'] = 'short_string';
54 $cfg_db['NavigationTreeTableSeparator'] = 'short_string';
55 $cfg_db['TableNavigationLinksMode'] = array(
56 'icons' => __('Icons'),
57 'text' => __('Text'),
58 'both' => __('Both')
60 $cfg_db['MaxRows'] = array(25, 50, 100, 250, 500);
61 $cfg_db['Order'] = array('ASC', 'DESC', 'SMART');
62 $cfg_db['RowActionLinks'] = array(
63 'none' => __('Nowhere'),
64 'left' => __('Left'),
65 'right' => __('Right'),
66 'both' => __('Both')
68 $cfg_db['TablePrimaryKeyOrder'] = array(
69 'NONE' => __('None'),
70 'ASC' => __('Ascending'),
71 'DESC' => __('Descending')
73 $cfg_db['ProtectBinary'] = array(false, 'blob', 'noblob', 'all');
74 $cfg_db['CharEditing'] = array('input', 'textarea');
75 $cfg_db['TabsMode'] = array(
76 'icons' => __('Icons'),
77 'text' => __('Text'),
78 'both' => __('Both')
80 $cfg_db['PDFDefaultPageSize'] = array(
81 'A3' => 'A3',
82 'A4' => 'A4',
83 'A5' => 'A5',
84 'letter' => 'letter',
85 'legal' => 'legal'
87 $cfg_db['ActionLinksMode'] = array(
88 'icons' => __('Icons'),
89 'text' => __('Text'),
90 'both' => __('Both')
92 $cfg_db['GridEditing'] = array(
93 'click' => __('Click'),
94 'double-click' => __('Double click'),
95 'disabled' => __('Disabled'),
97 $cfg_db['RelationalDisplay'] = array(
98 'K' => __('key'),
99 'D' => __('display column')
101 $cfg_db['DefaultTabServer'] = array(
102 'welcome' => __('Welcome'), // the welcome page (recommended for multiuser setups)
103 'databases' => __('Databases'), // list of databases
104 'status' => __('Status'), // runtime information
105 'variables' => __('Variables'), // MySQL server variables
106 'privileges' => __('Privileges') // user management
108 $cfg_db['DefaultTabDatabase'] = array(
109 'structure' => __('Structure'), // tables list
110 'sql' => __('SQL'), // SQL form
111 'search' => __('Search'), // search query
112 'operations' => __('Operations') // operations on database
114 $cfg_db['DefaultTabTable'] = array(
115 'structure' => __('Structure'), // fields list
116 'sql' => __('SQL'), // SQL form
117 'search' => __('Search'), // search page
118 'insert' => __('Insert'), // insert row page
119 'browse' => __('Browse') // browse page
121 $cfg_db['InitialSlidersState'] = array(
122 'open' => __('Open'),
123 'closed' => __('Closed'),
124 'disabled' => __('Disabled')
126 $cfg_db['SendErrorReports'] = array(
127 'ask' => __('Ask before sending error reports'),
128 'always' => __('Always send error reports'),
129 'never' => __('Never send error reports')
131 $cfg_db['DefaultForeignKeyChecks'] = array(
132 'default' => __('Server default'),
133 'enable' => __('Enable'),
134 'disable' => __('Disable')
136 $cfg_db['Import']['format'] = array(
137 'csv', // CSV
138 'docsql', // DocSQL
139 'ldi', // CSV using LOAD DATA
140 'sql' // SQL
142 $cfg_db['Import']['charset'] = array_merge(
143 array(''),
144 $GLOBALS['cfg']['AvailableCharsets']
146 $cfg_db['Import']['sql_compatibility']
147 = $cfg_db['Export']['sql_compatibility'] = array(
148 'NONE', 'ANSI', 'DB2', 'MAXDB', 'MYSQL323',
149 'MYSQL40', 'MSSQL', 'ORACLE',
150 // removed; in MySQL 5.0.33, this produces exports that
151 // can't be read by POSTGRESQL (see our bug #1596328)
152 //'POSTGRESQL',
153 'TRADITIONAL'
155 $cfg_db['Import']['csv_terminated'] = 'short_string';
156 $cfg_db['Import']['csv_enclosed'] = 'short_string';
157 $cfg_db['Import']['csv_escaped'] = 'short_string';
158 $cfg_db['Import']['ldi_terminated'] = 'short_string';
159 $cfg_db['Import']['ldi_enclosed'] = 'short_string';
160 $cfg_db['Import']['ldi_escaped'] = 'short_string';
161 $cfg_db['Import']['ldi_local_option'] = array('auto', true, false);
162 $cfg_db['Export']['_sod_select'] = array(
163 'structure' => __('structure'),
164 'data' => __('data'),
165 'structure_and_data' => __('structure and data')
167 $cfg_db['Export']['method'] = array(
168 'quick' => __('Quick - display only the minimal options to configure'),
169 'custom' => __('Custom - display all possible options to configure'),
170 'custom-no-form' => __('Custom - like above, but without the quick/custom choice')
172 $cfg_db['Export']['format'] = array(
173 'codegen', 'csv', 'excel', 'htmlexcel','htmlword', 'latex', 'ods',
174 'odt', 'pdf', 'sql', 'texytext', 'xls', 'xml', 'yaml'
176 $cfg_db['Export']['compression'] = array('none', 'zip', 'gzip');
177 $cfg_db['Export']['charset'] = array_merge(
178 array(''),
179 $GLOBALS['cfg']['AvailableCharsets']
181 $cfg_db['Export']['codegen_format'] = array(
182 '#', 'NHibernate C# DO', 'NHibernate XML'
184 $cfg_db['Export']['csv_separator'] = 'short_string';
185 $cfg_db['Export']['csv_terminated'] = 'short_string';
186 $cfg_db['Export']['csv_enclosed'] = 'short_string';
187 $cfg_db['Export']['csv_escaped'] = 'short_string';
188 $cfg_db['Export']['csv_null'] = 'short_string';
189 $cfg_db['Export']['excel_null'] = 'short_string';
190 $cfg_db['Export']['excel_edition'] = array(
191 'win' => 'Windows',
192 'mac_excel2003' => 'Excel 2003 / Macintosh',
193 'mac_excel2008' => 'Excel 2008 / Macintosh'
195 $cfg_db['Export']['sql_structure_or_data'] = $cfg_db['Export']['_sod_select'];
196 $cfg_db['Export']['sql_type'] = array('INSERT', 'UPDATE', 'REPLACE');
197 $cfg_db['Export']['sql_insert_syntax'] = array(
198 'complete' => __('complete inserts'),
199 'extended' => __('extended inserts'),
200 'both' => __('both of the above'),
201 'none' => __('neither of the above')
203 $cfg_db['Export']['xls_null'] = 'short_string';
204 $cfg_db['Export']['xlsx_null'] = 'short_string';
205 $cfg_db['Export']['htmlword_structure_or_data'] = $cfg_db['Export']['_sod_select'];
206 $cfg_db['Export']['htmlword_null'] = 'short_string';
207 $cfg_db['Export']['ods_null'] = 'short_string';
208 $cfg_db['Export']['odt_null'] = 'short_string';
209 $cfg_db['Export']['odt_structure_or_data'] = $cfg_db['Export']['_sod_select'];
210 $cfg_db['Export']['texytext_structure_or_data'] = $cfg_db['Export']['_sod_select'];
211 $cfg_db['Export']['texytext_null'] = 'short_string';
214 * Default values overrides
215 * Use only full paths
217 $cfg_db['_overrides'] = array();
220 * Basic validator assignments (functions from libraries/config/Validator.class.php
221 * and 'validators' object in js/config.js)
222 * Use only full paths and form ids
224 $cfg_db['_validators'] = array(
225 'CharTextareaCols' => 'validatePositiveNumber',
226 'CharTextareaRows' => 'validatePositiveNumber',
227 'ExecTimeLimit' => 'validateNonNegativeNumber',
228 'Export/sql_max_query_size' => 'validatePositiveNumber',
229 'FirstLevelNavigationItems' => 'validatePositiveNumber',
230 'ForeignKeyMaxLimit' => 'validatePositiveNumber',
231 'Import/csv_enclosed' => array(array('validateByRegex', '/^.?$/')),
232 'Import/csv_escaped' => array(array('validateByRegex', '/^.$/')),
233 'Import/csv_terminated' => array(array('validateByRegex', '/^.$/')),
234 'Import/ldi_enclosed' => array(array('validateByRegex', '/^.?$/')),
235 'Import/ldi_escaped' => array(array('validateByRegex', '/^.$/')),
236 'Import/ldi_terminated' => array(array('validateByRegex', '/^.$/')),
237 'Import/skip_queries' => 'validateNonNegativeNumber',
238 'InsertRows' => 'validatePositiveNumber',
239 'NumRecentTables' => 'validateNonNegativeNumber',
240 'NumFavoriteTables' => 'validateNonNegativeNumber',
241 'LimitChars' => 'validatePositiveNumber',
242 'LoginCookieValidity' => 'validatePositiveNumber',
243 'LoginCookieStore' => 'validateNonNegativeNumber',
244 'MaxDbList' => 'validatePositiveNumber',
245 'MaxNavigationItems' => 'validatePositiveNumber',
246 'MaxCharactersInDisplayedSQL' => 'validatePositiveNumber',
247 'MaxRows' => 'validatePositiveNumber',
248 'MaxTableList' => 'validatePositiveNumber',
249 'MemoryLimit' => array(array('validateByRegex', '/^(-1|(\d+(?:[kmg])?))$/i')),
250 'NavigationTreeTableLevel' => 'validatePositiveNumber',
251 'QueryHistoryMax' => 'validatePositiveNumber',
252 'RepeatCells' => 'validateNonNegativeNumber',
253 'Server' => 'validateServer',
254 'Server_pmadb' => 'validatePMAStorage',
255 'Servers/1/port' => 'validatePortNumber',
256 'Servers/1/hide_db' => 'validateRegex',
257 'TextareaCols' => 'validatePositiveNumber',
258 'TextareaRows' => 'validatePositiveNumber',
259 'TrustedProxies' => 'validateTrustedProxies');
262 * Additional validators used for user preferences
264 $cfg_db['_userValidators'] = array(
265 'MaxDbList' => array(
266 array('validateUpperBound', 'value:MaxDbList')
268 'MaxTableList' => array(
269 array('validateUpperBound', 'value:MaxTableList')
271 'QueryHistoryMax' => array(
272 array('validateUpperBound', 'value:QueryHistoryMax')