Comments
[phpmyadmin.git] / libraries / config.values.php
blob7f81924a0cc71a92bd2a743f6e4299dbc84b28b2
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(1 => array(
24 'port' => 'integer',
25 'connect_type' => array('tcp', 'socket'),
26 'extension' => array('mysql', 'mysqli'),
27 'auth_type' => array('config', 'http', 'signon', 'cookie'),
28 'AllowDeny' => array(
29 'order' => array('', 'deny,allow', 'allow,deny', 'explicit')),
30 'only_db' => 'array'));
31 $cfg_db['RecodingEngine'] = array('auto', 'iconv', 'recode', 'none');
32 $cfg_db['OBGzip'] = array('auto', true, false);
33 $cfg_db['MemoryLimit'] = 'short_string';
34 $cfg_db['ShowTooltipAliasTB'] = array('nested', true, false);
35 $cfg_db['DisplayDatabasesList'] = array('auto', true, false);
36 $cfg_db['LeftLogoLinkWindow'] = array('main', 'new');
37 $cfg_db['LeftDefaultTabTable'] = array(
38 'tbl_structure.php', // fields list
39 'tbl_sql.php', // SQL form
40 'tbl_select.php', // search page
41 'tbl_change.php', // insert row page
42 'sql.php'); // browse page
43 $cfg_db['LeftFrameDBSeparator'] = 'short_string';
44 $cfg_db['LeftFrameTableSeparator'] = 'short_string';
45 $cfg_db['NavigationBarIconic'] = array(true => __('Yes'), false => __('No'), 'both' => __('Both'));
46 $cfg_db['Order'] = array('ASC', 'DESC', 'SMART');
47 $cfg_db['RowActionLinks'] = array('none' => __('Nowhere'), 'left' => __('Left'), 'right' => __('Right'), 'both' => __('Both'));
48 $cfg_db['ProtectBinary'] = array(false, 'blob', 'all');
49 $cfg_db['DefaultDisplay'] = array('horizontal', 'vertical', 'horizontalflipped');
50 $cfg_db['CharEditing'] = array('input', 'textarea');
51 $cfg_db['PropertiesIconic'] = array(true => __('Yes'), false => __('No'), 'both' => __('Both'));
52 $cfg_db['DefaultTabServer'] = array(
53 'main.php', // the welcome page (recommended for multiuser setups)
54 'server_databases.php', // list of databases
55 'server_status.php', // runtime information
56 'server_variables.php', // MySQL server variables
57 'server_privileges.php', // user management
58 'server_processlist.php'); // process list
59 $cfg_db['DefaultTabDatabase'] = array(
60 'db_structure.php', // tables list
61 'db_sql.php', // SQL form
62 'db_search.php', // search query
63 'db_operations.php'); // operations on database
64 $cfg_db['DefaultTabTable'] = array(
65 'tbl_structure.php', // fields list
66 'tbl_sql.php', // SQL form
67 'tbl_select.php', // search page
68 'tbl_change.php', // insert row page
69 'sql.php'); // browse page
70 $cfg_db['QueryWindowDefTab'] = array(
71 'sql', // SQL
72 'files', // Import files
73 'history', // SQL history
74 'full'); // All (SQL and SQL history)
75 $cfg_db['InitialSlidersState'] = array('open' => __('Open'), 'closed' => __('Closed'));
76 $cfg_db['Import']['format'] = array(
77 'csv', // CSV
78 'docsql', // DocSQL
79 'ldi', // CSV using LOAD DATA
80 'sql'); // SQL
81 $cfg_db['Import']['charset'] = array_merge(array(''), $GLOBALS['cfg']['AvailableCharsets']);
82 $cfg_db['Import']['sql_compatibility'] = $cfg_db['Export']['sql_compatibility'] = array(
83 'NONE', 'ANSI', 'DB2', 'MAXDB', 'MYSQL323', 'MYSQL40', 'MSSQL', 'ORACLE',
84 // removed; in MySQL 5.0.33, this produces exports that
85 // can't be read by POSTGRESQL (see our bug #1596328)
86 //'POSTGRESQL',
87 'TRADITIONAL');
88 $cfg_db['Import']['csv_terminated'] = 'short_string';
89 $cfg_db['Import']['csv_enclosed'] = 'short_string';
90 $cfg_db['Import']['csv_escaped'] = 'short_string';
91 $cfg_db['Import']['ldi_terminated'] = 'short_string';
92 $cfg_db['Import']['ldi_enclosed'] = 'short_string';
93 $cfg_db['Import']['ldi_escaped'] = 'short_string';
94 $cfg_db['Import']['ldi_local_option'] = array('auto', true, false);
95 $cfg_db['Export']['_sod_select'] = array(
96 'structure' => __('structure'),
97 'data' => __('data'),
98 'structure_and_data' => __('structure and data'));
99 $cfg_db['Export']['method'] = array(
100 'quick' => __('Quick - display only the minimal options to configure'),
101 'custom' => __('Custom - display all possible options to configure'),
102 'custom-no-form' => __('Custom - like above, but without the quick/custom choice'));
103 $cfg_db['Export']['format'] = array('codegen', 'csv', 'excel', 'htmlexcel',
104 'htmlword', 'latex', 'ods', 'odt', 'pdf', 'sql', 'texytext', 'xls', 'xml',
105 'yaml');
106 $cfg_db['Export']['compression'] = array('none', 'zip', 'gzip', 'bzip2');
107 $cfg_db['Export']['charset'] = array_merge(array(''), $GLOBALS['cfg']['AvailableCharsets']);
108 $cfg_db['Export']['codegen_format'] = array('#', 'NHibernate C# DO', 'NHibernate XML');
109 $cfg_db['Export']['csv_separator'] = 'short_string';
110 $cfg_db['Export']['csv_terminated'] = 'short_string';
111 $cfg_db['Export']['csv_enclosed'] = 'short_string';
112 $cfg_db['Export']['csv_escaped'] = 'short_string';
113 $cfg_db['Export']['csv_null'] = 'short_string';
114 $cfg_db['Export']['excel_null'] = 'short_string';
115 $cfg_db['Export']['excel_edition'] = array('win' => 'Windows',
116 'mac_excel2003' => 'Excel 2003 / Macintosh', 'mac_excel2008' => 'Excel 2008 / Macintosh');
117 $cfg_db['Export']['sql_structure_or_data'] = $cfg_db['Export']['_sod_select'];
118 $cfg_db['Export']['sql_type'] = array('INSERT', 'UPDATE', 'REPLACE');
119 $cfg_db['Export']['sql_insert_syntax'] = array(
120 'complete' => __('complete inserts'),
121 'extended' => __('extended inserts'),
122 'both' => __('both of the above'),
123 'none' => __('neither of the above'));
124 $cfg_db['Export']['xls_null'] = 'short_string';
125 $cfg_db['Export']['xlsx_null'] = 'short_string';
126 $cfg_db['Export']['htmlword_structure_or_data'] = $cfg_db['Export']['_sod_select'];
127 $cfg_db['Export']['htmlword_null'] = 'short_string';
128 $cfg_db['Export']['ods_null'] = 'short_string';
129 $cfg_db['Export']['odt_null'] = 'short_string';
130 $cfg_db['Export']['odt_structure_or_data'] = $cfg_db['Export']['_sod_select'];
131 $cfg_db['Export']['texytext_structure_or_data'] = $cfg_db['Export']['_sod_select'];
132 $cfg_db['Export']['texytext_null'] = 'short_string';
135 * Default values overrides
136 * Use only full paths
138 $cfg_db['_overrides'] = array();
139 $cfg_db['_overrides']['Servers/1/extension'] = extension_loaded('mysqli')
140 ? 'mysqli' : 'mysql';
143 * Basic validator assignments (functions from libraries/config/validate.lib.php and 'validators'
144 * object in js/config.js)
145 * Use only full paths and form ids
147 $cfg_db['_validators'] = array(
148 'CharTextareaCols' => 'validate_positive_number',
149 'CharTextareaRows' => 'validate_positive_number',
150 'DefaultPropDisplay' => array(array('validate_by_regex', '/^(?:horizontal|vertical|\d+)$/')),
151 'ExecTimeLimit' => 'validate_non_negative_number',
152 'Export/sql_max_query_size' => 'validate_positive_number',
153 'ForeignKeyMaxLimit' => 'validate_positive_number',
154 'Import/csv_enclosed' => array(array('validate_by_regex', '/^.?$/')),
155 'Import/csv_escaped' => array(array('validate_by_regex', '/^.$/')),
156 'Import/csv_terminated' => array(array('validate_by_regex', '/^.$/')),
157 'Import/ldi_enclosed' => array(array('validate_by_regex', '/^.?$/')),
158 'Import/ldi_escaped' => array(array('validate_by_regex', '/^.$/')),
159 'Import/ldi_terminated' => array(array('validate_by_regex', '/^.$/')),
160 'Import/skip_queries' => 'validate_non_negative_number',
161 'InsertRows' => 'validate_positive_number',
162 'LeftFrameTableLevel' => 'validate_positive_number',
163 'LeftRecentTable' => 'validate_non_negative_number',
164 'LimitChars' => 'validate_positive_number',
165 'LoginCookieValidity' => 'validate_positive_number',
166 'LoginCookieStore' => 'validate_non_negative_number',
167 'MaxDbList' => 'validate_positive_number',
168 'MaxCharactersInDisplayedSQL' => 'validate_positive_number',
169 'MaxRows' => 'validate_positive_number',
170 'MaxTableList' => 'validate_positive_number',
171 'MemoryLimit' => array(array('validate_by_regex', '/^\d+(?:[kmg])?$/i')),
172 'QueryHistoryMax' => 'validate_positive_number',
173 'QueryWindowWidth' => 'validate_positive_number',
174 'QueryWindowHeight' => 'validate_positive_number',
175 'RepeatCells' => 'validate_non_negative_number',
176 'Server' => 'validate_server',
177 'Server_pmadb' => 'validate_pmadb',
178 'Servers/1/port' => 'validate_port_number',
179 'Servers/1/hide_db' => 'validate_regex',
180 'TextareaCols' => 'validate_positive_number',
181 'TextareaRows' => 'validate_positive_number',
182 'TrustedProxies' => 'validate_trusted_proxies');
185 * Additional validators used for user preferences
187 $cfg_db['_userValidators'] = array(
188 'MaxDbList' => array(array('validate_upper_bound', 'value:MaxDbList')),
189 'MaxTableList' => array(array('validate_upper_bound', 'value:MaxTableList')),
190 'QueryHistoryMax' => array(array('validate_upper_bound', 'value:QueryHistoryMax')),);