config.values.php 9.2 KB

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