config.values.php 13 KB

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