Merge branch 'QA_4_9' into QA_5_0
[phpmyadmin.git] / libraries / config.values.php
bloba74cae1172de3002e0d52aa76376619719c0b06b
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 */
9 declare(strict_types=1);
11 if (! defined('PHPMYADMIN')) {
12 exit;
15 /**
16 * Value meaning:
17 * o array - select field, array contains allowed values
18 * o string - type override
20 * Use normal array, paths won't be expanded
22 return [
23 'Servers' => [
24 1 => [
25 'port' => 'integer',
26 'auth_type' => [
27 'config',
28 'http',
29 'signon',
30 'cookie',
32 'AllowDeny' => [
33 'order' => [
34 '',
35 'deny,allow',
36 'allow,deny',
37 'explicit',
40 'only_db' => 'array',
43 'RecodingEngine' => [
44 'auto',
45 'iconv',
46 'recode',
47 'mb',
48 'none',
50 'OBGzip' => [
51 'auto',
52 true,
53 false,
55 'MemoryLimit' => 'short_string',
56 'NavigationLogoLinkWindow' => [
57 'main',
58 'new',
60 'NavigationTreeDefaultTabTable' => [
61 // fields list
62 'structure' => __('Structure'),
63 // SQL form
64 'sql' => __('SQL'),
65 // search page
66 'search' => __('Search'),
67 // insert row page
68 'insert' => __('Insert'),
69 // browse page
70 'browse' => __('Browse'),
72 'NavigationTreeDefaultTabTable2' => [
73 //don't display
74 '' => '',
75 // fields list
76 'structure' => __('Structure'),
77 // SQL form
78 'sql' => __('SQL'),
79 // search page
80 'search' => __('Search'),
81 // insert row page
82 'insert' => __('Insert'),
83 // browse page
84 'browse' => __('Browse'),
86 'NavigationTreeDbSeparator' => 'short_string',
87 'NavigationTreeTableSeparator' => 'short_string',
88 'NavigationWidth' => 'integer',
89 'TableNavigationLinksMode' => [
90 'icons' => __('Icons'),
91 'text' => __('Text'),
92 'both' => __('Both'),
94 'MaxRows' => [
95 25,
96 50,
97 100,
98 250,
99 500,
101 'Order' => [
102 'ASC',
103 'DESC',
104 'SMART',
106 'RowActionLinks' => [
107 'none' => __('Nowhere'),
108 'left' => __('Left'),
109 'right' => __('Right'),
110 'both' => __('Both'),
112 'TablePrimaryKeyOrder' => [
113 'NONE' => __('None'),
114 'ASC' => __('Ascending'),
115 'DESC' => __('Descending'),
117 'ProtectBinary' => [
118 false,
119 'blob',
120 'noblob',
121 'all',
123 'CharEditing' => [
124 'input',
125 'textarea',
127 'TabsMode' => [
128 'icons' => __('Icons'),
129 'text' => __('Text'),
130 'both' => __('Both'),
132 'PDFDefaultPageSize' => [
133 'A3' => 'A3',
134 'A4' => 'A4',
135 'A5' => 'A5',
136 'letter' => 'letter',
137 'legal' => 'legal',
139 'ActionLinksMode' => [
140 'icons' => __('Icons'),
141 'text' => __('Text'),
142 'both' => __('Both'),
144 'GridEditing' => [
145 'click' => __('Click'),
146 'double-click' => __('Double click'),
147 'disabled' => __('Disabled'),
149 'RelationalDisplay' => [
150 'K' => __('key'),
151 'D' => __('display column'),
153 'DefaultTabServer' => [
154 // the welcome page (recommended for multiuser setups)
155 'welcome' => __('Welcome'),
156 // list of databases
157 'databases' => __('Databases'),
158 // runtime information
159 'status' => __('Status'),
160 // MySQL server variables
161 'variables' => __('Variables'),
162 // user management
163 'privileges' => __('Privileges'),
165 'DefaultTabDatabase' => [
166 // tables list
167 'structure' => __('Structure'),
168 // SQL form
169 'sql' => __('SQL'),
170 // search query
171 'search' => __('Search'),
172 // operations on database
173 'operations' => __('Operations'),
175 'DefaultTabTable' => [
176 // fields list
177 'structure' => __('Structure'),
178 // SQL form
179 'sql' => __('SQL'),
180 // search page
181 'search' => __('Search'),
182 // insert row page
183 'insert' => __('Insert'),
184 // browse page
185 'browse' => __('Browse'),
187 'InitialSlidersState' => [
188 'open' => __('Open'),
189 'closed' => __('Closed'),
190 'disabled' => __('Disabled'),
192 'SendErrorReports' => [
193 'ask' => __('Ask before sending error reports'),
194 'always' => __('Always send error reports'),
195 'never' => __('Never send error reports'),
197 'DefaultForeignKeyChecks' => [
198 'default' => __('Server default'),
199 'enable' => __('Enable'),
200 'disable' => __('Disable'),
203 'Import' => [
204 'format' => [
205 // CSV
206 'csv',
207 // DocSQL
208 'docsql',
209 // CSV using LOAD DATA
210 'ldi',
211 // SQL
212 'sql',
214 'charset' => array_merge(
215 [''],
216 $GLOBALS['cfg']['AvailableCharsets']
218 'sql_compatibility' => [
219 'NONE',
220 'ANSI',
221 'DB2',
222 'MAXDB',
223 'MYSQL323',
224 'MYSQL40',
225 'MSSQL',
226 'ORACLE',
227 // removed; in MySQL 5.0.33, this produces exports that
228 // can't be read by POSTGRESQL (see our bug #1596328)
229 //'POSTGRESQL',
230 'TRADITIONAL',
232 'csv_terminated' => 'short_string',
233 'csv_enclosed' => 'short_string',
234 'csv_escaped' => 'short_string',
235 'ldi_terminated' => 'short_string',
236 'ldi_enclosed' => 'short_string',
237 'ldi_escaped' => 'short_string',
238 'ldi_local_option' => [
239 'auto',
240 true,
241 false,
245 'Export' => [
246 '_sod_select' => [
247 'structure' => __('structure'),
248 'data' => __('data'),
249 'structure_and_data' => __('structure and data'),
251 'method' => [
252 'quick' => __('Quick - display only the minimal options to configure'),
253 'custom' => __('Custom - display all possible options to configure'),
254 'custom-no-form' => __(
255 'Custom - like above, but without the quick/custom choice'
258 'format' => [
259 'codegen',
260 'csv',
261 'excel',
262 'htmlexcel',
263 'htmlword',
264 'latex',
265 'ods',
266 'odt',
267 'pdf',
268 'sql',
269 'texytext',
270 'xml',
271 'yaml',
273 'compression' => [
274 'none',
275 'zip',
276 'gzip',
278 'charset' => array_merge(
279 [''],
280 $GLOBALS['cfg']['AvailableCharsets']
282 'sql_compatibility' => [
283 'NONE',
284 'ANSI',
285 'DB2',
286 'MAXDB',
287 'MYSQL323',
288 'MYSQL40',
289 'MSSQL',
290 'ORACLE',
291 // removed; in MySQL 5.0.33, this produces exports that
292 // can't be read by POSTGRESQL (see our bug #1596328)
293 //'POSTGRESQL',
294 'TRADITIONAL',
296 'codegen_format' => [
297 '#',
298 'NHibernate C# DO',
299 'NHibernate XML',
301 'csv_separator' => 'short_string',
302 'csv_terminated' => 'short_string',
303 'csv_enclosed' => 'short_string',
304 'csv_escaped' => 'short_string',
305 'csv_null' => 'short_string',
306 'excel_null' => 'short_string',
307 'excel_edition' => [
308 'win' => 'Windows',
309 'mac_excel2003' => 'Excel 2003 / Macintosh',
310 'mac_excel2008' => 'Excel 2008 / Macintosh',
312 'sql_structure_or_data' => [
313 'structure' => __('structure'),
314 'data' => __('data'),
315 'structure_and_data' => __('structure and data'),
317 'sql_type' => [
318 'INSERT',
319 'UPDATE',
320 'REPLACE',
322 'sql_insert_syntax' => [
323 'complete' => __('complete inserts'),
324 'extended' => __('extended inserts'),
325 'both' => __('both of the above'),
326 'none' => __('neither of the above'),
328 'htmlword_structure_or_data' => [
329 'structure' => __('structure'),
330 'data' => __('data'),
331 'structure_and_data' => __('structure and data'),
333 'htmlword_null' => 'short_string',
334 'ods_null' => 'short_string',
335 'odt_null' => 'short_string',
336 'odt_structure_or_data' => [
337 'structure' => __('structure'),
338 'data' => __('data'),
339 'structure_and_data' => __('structure and data'),
341 'texytext_structure_or_data' => [
342 'structure' => __('structure'),
343 'data' => __('data'),
344 'structure_and_data' => __('structure and data'),
346 'texytext_null' => 'short_string',
349 'Console' => [
350 'Mode' => [
351 'info',
352 'show',
353 'collapse',
355 'OrderBy' => [
356 'exec',
357 'time',
358 'count',
360 'Order' => [
361 'asc',
362 'desc',
367 * Default values overrides
368 * Use only full paths
370 '_overrides' => [],
373 * Basic validator assignments (functions from libraries/config/Validator.php
374 * and 'validators' object in js/config.js)
375 * Use only full paths and form ids
377 '_validators' => [
378 'Console/Height' => 'validateNonNegativeNumber',
379 'CharTextareaCols' => 'validatePositiveNumber',
380 'CharTextareaRows' => 'validatePositiveNumber',
381 'ExecTimeLimit' => 'validateNonNegativeNumber',
382 'Export/sql_max_query_size' => 'validatePositiveNumber',
383 'FirstLevelNavigationItems' => 'validatePositiveNumber',
384 'ForeignKeyMaxLimit' => 'validatePositiveNumber',
385 'Import/csv_enclosed' => [
387 'validateByRegex',
388 '/^.?$/',
391 'Import/csv_escaped' => [
393 'validateByRegex',
394 '/^.$/',
397 'Import/csv_terminated' => [
399 'validateByRegex',
400 '/^.$/',
403 'Import/ldi_enclosed' => [
405 'validateByRegex',
406 '/^.?$/',
409 'Import/ldi_escaped' => [
411 'validateByRegex',
412 '/^.$/',
415 'Import/ldi_terminated' => [
417 'validateByRegex',
418 '/^.$/',
421 'Import/skip_queries' => 'validateNonNegativeNumber',
422 'InsertRows' => 'validatePositiveNumber',
423 'NumRecentTables' => 'validateNonNegativeNumber',
424 'NumFavoriteTables' => 'validateNonNegativeNumber',
425 'LimitChars' => 'validatePositiveNumber',
426 'LoginCookieValidity' => 'validatePositiveNumber',
427 'LoginCookieStore' => 'validateNonNegativeNumber',
428 'MaxDbList' => 'validatePositiveNumber',
429 'MaxNavigationItems' => 'validatePositiveNumber',
430 'MaxCharactersInDisplayedSQL' => 'validatePositiveNumber',
431 'MaxRows' => 'validatePositiveNumber',
432 'MaxSizeForInputField' => 'validatePositiveNumber',
433 'MinSizeForInputField' => 'validateNonNegativeNumber',
434 'MaxTableList' => 'validatePositiveNumber',
435 'MemoryLimit' => [
437 'validateByRegex',
438 '/^(-1|(\d+(?:[kmg])?))$/i',
441 'NavigationTreeDisplayItemFilterMinimum' => 'validatePositiveNumber',
442 'NavigationTreeTableLevel' => 'validatePositiveNumber',
443 'NavigationWidth' => 'validateNonNegativeNumber',
444 'QueryHistoryMax' => 'validatePositiveNumber',
445 'RepeatCells' => 'validateNonNegativeNumber',
446 'Server' => 'validateServer',
447 'Server_pmadb' => 'validatePMAStorage',
448 'Servers/1/port' => 'validatePortNumber',
449 'Servers/1/hide_db' => 'validateRegex',
450 'TextareaCols' => 'validatePositiveNumber',
451 'TextareaRows' => 'validatePositiveNumber',
452 'TrustedProxies' => 'validateTrustedProxies',
456 * Additional validators used for user preferences
458 '_userValidators' => [
459 'MaxDbList' => [
461 'validateUpperBound',
462 'value:MaxDbList',
465 'MaxTableList' => [
467 'validateUpperBound',
468 'value:MaxTableList',
471 'QueryHistoryMax' => [
473 'validateUpperBound',
474 'value:QueryHistoryMax',