config.values.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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.
  6. *
  7. * @package PhpMyAdmin
  8. */
  9. if (!defined('PHPMYADMIN')) {
  10. exit;
  11. }
  12. /**
  13. * Value meaning:
  14. * o array - select field, array contains allowed values
  15. * o string - type override
  16. *
  17. * Use normal array, paths won't be expanded
  18. */
  19. $cfg_db = array();
  20. $cfg_db['Servers'] = array(
  21. 1 => array(
  22. 'port' => 'integer',
  23. 'auth_type' => array('config', 'http', 'signon', 'cookie'),
  24. 'AllowDeny' => array(
  25. 'order' => array('', 'deny,allow', 'allow,deny', 'explicit')
  26. ),
  27. 'only_db' => 'array'
  28. )
  29. );
  30. $cfg_db['RecodingEngine'] = array('auto', 'iconv', 'recode', 'mb', 'none');
  31. $cfg_db['OBGzip'] = array('auto', true, false);
  32. $cfg_db['MemoryLimit'] = 'short_string';
  33. $cfg_db['NavigationLogoLinkWindow'] = array('main', 'new');
  34. $cfg_db['NavigationTreeDefaultTabTable'] = array(
  35. 'structure' => __('Structure'), // fields list
  36. 'sql' => __('SQL'), // SQL form
  37. 'search' => __('Search'), // search page
  38. 'insert' => __('Insert'), // insert row page
  39. 'browse' => __('Browse') // browse page
  40. );
  41. $cfg_db['NavigationTreeDefaultTabTable2'] = array(
  42. '' => '', //don't display
  43. 'structure' => __('Structure'), // fields list
  44. 'sql' => __('SQL'), // SQL form
  45. 'search' => __('Search'), // search page
  46. 'insert' => __('Insert'), // insert row page
  47. 'browse' => __('Browse') // browse page
  48. );
  49. $cfg_db['NavigationTreeDbSeparator'] = 'short_string';
  50. $cfg_db['NavigationTreeTableSeparator'] = 'short_string';
  51. $cfg_db['NavigationWidth'] = 'integer';
  52. $cfg_db['TableNavigationLinksMode'] = array(
  53. 'icons' => __('Icons'),
  54. 'text' => __('Text'),
  55. 'both' => __('Both')
  56. );
  57. $cfg_db['MaxRows'] = array(25, 50, 100, 250, 500);
  58. $cfg_db['Order'] = array('ASC', 'DESC', 'SMART');
  59. $cfg_db['RowActionLinks'] = array(
  60. 'none' => __('Nowhere'),
  61. 'left' => __('Left'),
  62. 'right' => __('Right'),
  63. 'both' => __('Both')
  64. );
  65. $cfg_db['TablePrimaryKeyOrder'] = array(
  66. 'NONE' => __('None'),
  67. 'ASC' => __('Ascending'),
  68. 'DESC' => __('Descending')
  69. );
  70. $cfg_db['ProtectBinary'] = array(false, 'blob', 'noblob', 'all');
  71. $cfg_db['CharEditing'] = array('input', 'textarea');
  72. $cfg_db['TabsMode'] = array(
  73. 'icons' => __('Icons'),
  74. 'text' => __('Text'),
  75. 'both' => __('Both')
  76. );
  77. $cfg_db['PDFDefaultPageSize'] = array(
  78. 'A3' => 'A3',
  79. 'A4' => 'A4',
  80. 'A5' => 'A5',
  81. 'letter' => 'letter',
  82. 'legal' => 'legal'
  83. );
  84. $cfg_db['ActionLinksMode'] = array(
  85. 'icons' => __('Icons'),
  86. 'text' => __('Text'),
  87. 'both' => __('Both')
  88. );
  89. $cfg_db['GridEditing'] = array(
  90. 'click' => __('Click'),
  91. 'double-click' => __('Double click'),
  92. 'disabled' => __('Disabled'),
  93. );
  94. $cfg_db['RelationalDisplay'] = array(
  95. 'K' => __('key'),
  96. 'D' => __('display column')
  97. );
  98. $cfg_db['DefaultTabServer'] = array(
  99. // the welcome page (recommended for multiuser setups)
  100. 'welcome' => __('Welcome'),
  101. 'databases' => __('Databases'), // list of databases
  102. 'status' => __('Status'), // runtime information
  103. 'variables' => __('Variables'), // MySQL server variables
  104. 'privileges' => __('Privileges') // user management
  105. );
  106. $cfg_db['DefaultTabDatabase'] = array(
  107. 'structure' => __('Structure'), // tables list
  108. 'sql' => __('SQL'), // SQL form
  109. 'search' => __('Search'), // search query
  110. 'operations' => __('Operations') // operations on database
  111. );
  112. $cfg_db['DefaultTabTable'] = array(
  113. 'structure' => __('Structure'), // fields list
  114. 'sql' => __('SQL'), // SQL form
  115. 'search' => __('Search'), // search page
  116. 'insert' => __('Insert'), // insert row page
  117. 'browse' => __('Browse') // browse page
  118. );
  119. $cfg_db['InitialSlidersState'] = array(
  120. 'open' => __('Open'),
  121. 'closed' => __('Closed'),
  122. 'disabled' => __('Disabled')
  123. );
  124. $cfg_db['SendErrorReports'] = array(
  125. 'ask' => __('Ask before sending error reports'),
  126. 'always' => __('Always send error reports'),
  127. 'never' => __('Never send error reports')
  128. );
  129. $cfg_db['DefaultForeignKeyChecks'] = array(
  130. 'default' => __('Server default'),
  131. 'enable' => __('Enable'),
  132. 'disable' => __('Disable')
  133. );
  134. $cfg_db['Import']['format'] = array(
  135. 'csv', // CSV
  136. 'docsql', // DocSQL
  137. 'ldi', // CSV using LOAD DATA
  138. 'sql' // SQL
  139. );
  140. $cfg_db['Import']['charset'] = array_merge(
  141. array(''),
  142. $GLOBALS['cfg']['AvailableCharsets']
  143. );
  144. $cfg_db['Import']['sql_compatibility']
  145. = $cfg_db['Export']['sql_compatibility'] = array(
  146. 'NONE', 'ANSI', 'DB2', 'MAXDB', 'MYSQL323',
  147. 'MYSQL40', 'MSSQL', 'ORACLE',
  148. // removed; in MySQL 5.0.33, this produces exports that
  149. // can't be read by POSTGRESQL (see our bug #1596328)
  150. //'POSTGRESQL',
  151. 'TRADITIONAL'
  152. );
  153. $cfg_db['Import']['csv_terminated'] = 'short_string';
  154. $cfg_db['Import']['csv_enclosed'] = 'short_string';
  155. $cfg_db['Import']['csv_escaped'] = 'short_string';
  156. $cfg_db['Import']['ldi_terminated'] = 'short_string';
  157. $cfg_db['Import']['ldi_enclosed'] = 'short_string';
  158. $cfg_db['Import']['ldi_escaped'] = 'short_string';
  159. $cfg_db['Import']['ldi_local_option'] = array('auto', true, false);
  160. $cfg_db['Export']['_sod_select'] = array(
  161. 'structure' => __('structure'),
  162. 'data' => __('data'),
  163. 'structure_and_data' => __('structure and data')
  164. );
  165. $cfg_db['Export']['method'] = array(
  166. 'quick' => __('Quick - display only the minimal options to configure'),
  167. 'custom' => __('Custom - display all possible options to configure'),
  168. 'custom-no-form' => __(
  169. 'Custom - like above, but without the quick/custom choice'
  170. ),
  171. );
  172. $cfg_db['Export']['format'] = array(
  173. 'codegen', 'csv', 'excel', 'htmlexcel','htmlword', 'latex', 'ods',
  174. 'odt', 'pdf', 'sql', 'texytext', 'xml', 'yaml'
  175. );
  176. $cfg_db['Export']['compression'] = array('none', 'zip', 'gzip');
  177. $cfg_db['Export']['charset'] = array_merge(
  178. array(''),
  179. $GLOBALS['cfg']['AvailableCharsets']
  180. );
  181. $cfg_db['Export']['codegen_format'] = array(
  182. '#', 'NHibernate C# DO', 'NHibernate XML'
  183. );
  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'
  194. );
  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')
  202. );
  203. $cfg_db['Export']['htmlword_structure_or_data'] = $cfg_db['Export']['_sod_select'];
  204. $cfg_db['Export']['htmlword_null'] = 'short_string';
  205. $cfg_db['Export']['ods_null'] = 'short_string';
  206. $cfg_db['Export']['odt_null'] = 'short_string';
  207. $cfg_db['Export']['odt_structure_or_data'] = $cfg_db['Export']['_sod_select'];
  208. $cfg_db['Export']['texytext_structure_or_data'] = $cfg_db['Export']['_sod_select'];
  209. $cfg_db['Export']['texytext_null'] = 'short_string';
  210. $cfg_db['Console']['Mode'] = array(
  211. 'info', 'show', 'collapse'
  212. );
  213. $cfg_db['Console']['OrderBy'] = ['exec', 'time', 'count'];
  214. $cfg_db['Console']['Order'] = ['asc', 'desc'];
  215. /**
  216. * Default values overrides
  217. * Use only full paths
  218. */
  219. $cfg_db['_overrides'] = array();
  220. /**
  221. * Basic validator assignments (functions from libraries/config/Validator.php
  222. * and 'validators' object in js/config.js)
  223. * Use only full paths and form ids
  224. */
  225. $cfg_db['_validators'] = array(
  226. 'Console/Height' => 'validateNonNegativeNumber',
  227. 'CharTextareaCols' => 'validatePositiveNumber',
  228. 'CharTextareaRows' => 'validatePositiveNumber',
  229. 'ExecTimeLimit' => 'validateNonNegativeNumber',
  230. 'Export/sql_max_query_size' => 'validatePositiveNumber',
  231. 'FirstLevelNavigationItems' => 'validatePositiveNumber',
  232. 'ForeignKeyMaxLimit' => 'validatePositiveNumber',
  233. 'Import/csv_enclosed' => array(array('validateByRegex', '/^.?$/')),
  234. 'Import/csv_escaped' => array(array('validateByRegex', '/^.$/')),
  235. 'Import/csv_terminated' => array(array('validateByRegex', '/^.$/')),
  236. 'Import/ldi_enclosed' => array(array('validateByRegex', '/^.?$/')),
  237. 'Import/ldi_escaped' => array(array('validateByRegex', '/^.$/')),
  238. 'Import/ldi_terminated' => array(array('validateByRegex', '/^.$/')),
  239. 'Import/skip_queries' => 'validateNonNegativeNumber',
  240. 'InsertRows' => 'validatePositiveNumber',
  241. 'NumRecentTables' => 'validateNonNegativeNumber',
  242. 'NumFavoriteTables' => 'validateNonNegativeNumber',
  243. 'LimitChars' => 'validatePositiveNumber',
  244. 'LoginCookieValidity' => 'validatePositiveNumber',
  245. 'LoginCookieStore' => 'validateNonNegativeNumber',
  246. 'MaxDbList' => 'validatePositiveNumber',
  247. 'MaxNavigationItems' => 'validatePositiveNumber',
  248. 'MaxCharactersInDisplayedSQL' => 'validatePositiveNumber',
  249. 'MaxRows' => 'validatePositiveNumber',
  250. 'MaxSizeForInputField' => 'validatePositiveNumber',
  251. 'MinSizeForInputField' => 'validateNonNegativeNumber',
  252. 'MaxTableList' => 'validatePositiveNumber',
  253. 'MemoryLimit' => array(array('validateByRegex', '/^(-1|(\d+(?:[kmg])?))$/i')),
  254. 'NavigationTreeDisplayItemFilterMinimum' => 'validatePositiveNumber',
  255. 'NavigationTreeTableLevel' => 'validatePositiveNumber',
  256. 'NavigationWidth' => 'validateNonNegativeNumber',
  257. 'QueryHistoryMax' => 'validatePositiveNumber',
  258. 'RepeatCells' => 'validateNonNegativeNumber',
  259. 'Server' => 'validateServer',
  260. 'Server_pmadb' => 'validatePMAStorage',
  261. 'Servers/1/port' => 'validatePortNumber',
  262. 'Servers/1/hide_db' => 'validateRegex',
  263. 'TextareaCols' => 'validatePositiveNumber',
  264. 'TextareaRows' => 'validatePositiveNumber',
  265. 'FontSize' => array(array('validateByRegex', '/^[0-9.]+(px|em|pt|\%)$/')),
  266. 'TrustedProxies' => 'validateTrustedProxies');
  267. /**
  268. * Additional validators used for user preferences
  269. */
  270. $cfg_db['_userValidators'] = array(
  271. 'MaxDbList' => array(
  272. array('validateUpperBound', 'value:MaxDbList')
  273. ),
  274. 'MaxTableList' => array(
  275. array('validateUpperBound', 'value:MaxTableList')
  276. ),
  277. 'QueryHistoryMax' => array(
  278. array('validateUpperBound', 'value:QueryHistoryMax')
  279. )
  280. );