config.values.php 13 KB

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