bug #1233349 db search in MySQL 5.0.x on fields without a charset
[phpmyadmin/crack.git] / libraries / config_import.lib.php
blob6679f5653afdee26f10b868a8cbaa513d5d3d748
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
6 /**
7 * This file provides support for older config files.
8 */
10 /**
11 * U S A G E
13 * After having added a new directive to the config.inc.php file, you need to
14 * put some backwards compatibility code into this file.
16 * This usually looks like this:
18 * if (!isset($myNewDirective)) {
19 * $myNewDirective = 'my default value';
20 * }
22 * If the new directive is meant as a replacement for an old one, please use the
23 * following layout:
25 * if (!isset($myNewDirective)) {
26 * if (isset($myOldDirective)) {
27 * $myNewDirective = $myOldDirective;
28 * unset($myOldDirective);
29 * } else {
30 * $myNewDirective = '';
31 * }
32 * }
34 * In order to make this file readable for other developers, please try to use
35 * the same order of directives here as you do in config.inc.php.
37 * After having done all this, search libraries/common.lib.php for the
38 * following paragraph (x and y are integers):
40 * if ($cfg['FileRevision'][0] < x || $cfg['FileRevision'][1] < y) {
41 * require_once('./libraries/config_import.lib.php');
42 * }
44 * Finally, set x and y to the _new_ revision number of config.inc.php and
45 * you're done! x would be the major version, y the minor version number of the
46 * new revision, e.g. 2.34 becomes: x = 2, y = 34
49 if (!isset($cfg['PmaAbsoluteUri'])) {
50 if (isset($cfgPmaAbsoluteUri)) {
51 $cfg['PmaAbsoluteUri'] = $cfgPmaAbsoluteUri;
52 unset($cfgPmaAbsoluteUri);
53 } else {
54 $cfg['PmaAbsoluteUri'] = '';
58 if (!isset($cfg['PmaAbsoluteUri_DisableWarning'])) {
59 $cfg['PmaAbsoluteUri_DisableWarning'] = FALSE;
62 if (!isset($cfg['PmaNoRelation_DisableWarning'])) {
63 $cfg['PmaNoRelation_DisableWarning'] = FALSE;
66 // do not set a default value here!
67 if (!isset($cfg['blowfish_secret'])) {
68 $cfg['blowfish_secret'] = '';
71 if (!isset($cfg['Servers'])) {
72 if (isset($cfgServers)) {
73 $cfg['Servers'] = $cfgServers;
74 unset($cfgServers);
75 } else {
76 $server = 0;
80 if (isset($cfg['Servers'])) {
81 for ($i=1; (!empty($cfg['Servers'][$i]['host']) || (isset($cfg['Servers'][$i]['connect_type']) && $cfg['Servers'][$i]['connect_type'] == 'socket')); $i++) {
82 if (!isset($cfg['Servers'][$i]['host'])) {
83 $cfg['Servers'][$i]['host'] = '';
85 if (!isset($cfg['Servers'][$i]['port'])) {
86 $cfg['Servers'][$i]['port'] = '';
89 if (!isset($cfg['Servers'][$i]['socket'])) {
90 $cfg['Servers'][$i]['socket'] = '';
93 if (!isset($cfg['Servers'][$i]['connect_type'])) {
94 $cfg['Servers'][$i]['connect_type'] = 'tcp';
97 if (!isset($cfg['Servers'][$i]['extension'])) {
98 $cfg['Servers'][$i]['extension'] = 'mysql';
101 if (!isset($cfg['Servers'][$i]['controluser']) && isset($cfg['Servers'][$i]['stduser'])) {
102 $cfg['Servers'][$i]['controluser'] = $cfg['Servers'][$i]['stduser'];
103 $cfg['Servers'][$i]['controlpass'] = $cfg['Servers'][$i]['stdpass'];
104 unset($cfg['Servers'][$i]['stduser'], $cfg['Servers'][$i]['stdpass']);
105 } else if (!isset($cfg['Servers'][$i]['controluser'])) {
106 $cfg['Servers'][$i]['controluser'] = $cfg['Servers'][$i]['controlpass'] = '';
109 if (!isset($cfg['Servers'][$i]['auth_type'])) {
110 $cfg['Servers'][$i]['auth_type'] = (isset($cfg['Servers'][$i]['adv_auth']) && $cfg['Servers'][$i]['adv_auth'])
111 ? 'http'
112 : 'config';
113 unset($cfg['Servers'][$i]['adv_auth']);
116 // for users who use the "first" blowfish mechanism
117 if (isset($cfg['Servers'][$i]['blowfish_secret'])) {
118 if (empty($cfg['blowfish_secret'])) {
119 $cfg['blowfish_secret'] = $cfg['Servers'][$i]['blowfish_secret'];
121 unset($cfg['Servers'][$i]['blowfish_secret']);
124 if (!isset($cfg['Servers'][$i]['compress'])) {
125 $cfg['Servers'][$i]['compress'] = FALSE;
128 if (!isset($cfg['Servers'][$i]['user'])) {
129 $cfg['Servers'][$i]['user'] = 'root';
132 if (!isset($cfg['Servers'][$i]['password'])) {
133 $cfg['Servers'][$i]['password'] = '';
136 if (!isset($cfg['Servers'][$i]['only_db'])) {
137 $cfg['Servers'][$i]['only_db'] = '';
140 if (!isset($cfg['Servers'][$i]['verbose'])) {
141 $cfg['Servers'][$i]['verbose'] = '';
144 if (!isset($cfg['Servers'][$i]['pmadb'])) {
145 if (isset($cfg['Servers'][$i]['bookmarkdb'])) {
146 $cfg['Servers'][$i]['pmadb'] = $cfg['Servers'][$i]['bookmarkdb'];
147 unset($cfg['Servers'][$i]['bookmarkdb']);
148 } else {
149 $cfg['Servers'][$i]['pmadb'] = '';
153 if (!isset($cfg['Servers'][$i]['bookmarktable'])) {
154 $cfg['Servers'][$i]['bookmarktable'] = '';
157 if (!isset($cfg['Servers'][$i]['relation'])) {
158 $cfg['Servers'][$i]['relation'] = '';
161 if (!isset($cfg['Servers'][$i]['table_info'])) {
162 $cfg['Servers'][$i]['table_info'] = '';
165 if (!isset($cfg['Servers'][$i]['table_coords'])) {
166 $cfg['Servers'][$i]['table_coords'] = '';
169 if (!isset($cfg['Servers'][$i]['column_info'])) {
170 if (isset($cfg['Servers'][$i]['column_comments'])) {
171 $cfg['Servers'][$i]['column_info'] = $cfg['Servers'][$i]['column_comments'];
172 unset($cfg['Servers'][$i]['column_comments']);
173 } else {
174 $cfg['Servers'][$i]['column_info'] = '';
178 if (!isset($cfg['Servers'][$i]['pdf_pages'])) {
179 $cfg['Servers'][$i]['pdf_pages'] = '';
182 if (!isset($cfg['Servers'][$i]['history'])) {
183 $cfg['Servers'][$i]['history'] = '';
186 if (!isset($cfg['Servers'][$i]['verbose_check'])) {
187 $cfg['Servers'][$i]['verbose_check'] = TRUE;
190 if (!isset($cfg['Servers'][$i]['AllowRoot'])) {
191 $cfg['Servers'][$i]['AllowRoot'] = TRUE;
194 if (!isset($cfg['Servers'][$i]['AllowDeny'])) {
195 $cfg['Servers'][$i]['AllowDeny'] = array ('order' => '',
196 'rules' => array());
201 if (!isset($cfg['ServerDefault'])) {
202 if (isset($cfgServerDefault)) {
203 $cfg['ServerDefault'] = $cfgServerDefault;
204 unset($cfgServerDefault);
205 } else {
206 $cfg['ServerDefault'] = 1;
210 if (!isset($cfg['OBGzip'])) {
211 if (isset($cfgOBGzip)) {
212 $cfg['OBGzip'] = $cfgOBGzip;
213 unset($cfgOBGzip);
214 } else {
215 $cfg['OBGzip'] = 'auto';
219 if (!isset($cfg['PersistentConnections'])) {
220 if (isset($cfgPersistentConnections)) {
221 $cfg['PersistentConnections'] = $cfgPersistentConnections;
222 unset($cfgPersistentConnections);
223 } else {
224 $cfg['PersistentConnections'] = FALSE;
228 if (!isset($cfg['ExecTimeLimit'])) {
229 if (isset($cfgExecTimeLimit)) {
230 $cfg['ExecTimeLimit'] = $cfgExecTimeLimit;
231 unset($cfgExecTimeLimit);
232 } else {
233 $cfg['ExecTimeLimit'] = 300;
237 if (!isset($cfg['SkipLockedTables'])) {
238 if (isset($cfgSkipLockedTables)) {
239 $cfg['SkipLockedTables'] = $cfgSkipLockedTables;
240 unset($cfgSkipLockedTables);
241 } else {
242 $cfg['SkipLockedTables'] = FALSE;
246 if (!isset($cfg['ShowSQL'])) {
247 if (isset($cfgShowSQL)) {
248 $cfg['ShowSQL'] = $cfgShowSQL;
249 unset($cfgShowSQL);
250 } else {
251 $cfg['ShowSQL'] = TRUE;
255 if (!isset($cfg['AllowUserDropDatabase'])) {
256 if (isset($cfgAllowUserDropDatabase)) {
257 $cfg['AllowUserDropDatabase'] = $cfgAllowUserDropDatabase;
258 unset($cfgAllowUserDropDatabase);
259 } else {
260 $cfg['AllowUserDropDatabase'] = FALSE;
264 if (!isset($cfg['Confirm'])) {
265 if (isset($cfgConfirm)) {
266 $cfg['Confirm'] = $cfgConfirm;
267 unset($cfgConfirm);
268 } else {
269 $cfg['Confirm'] = TRUE;
273 if (!isset($cfg['LoginCookieRecall'])) {
274 if (isset($cfgLoginCookieRecall)) {
275 $cfg['LoginCookieRecall'] = $cfgLoginCookieRecall;
276 unset($cfgLoginCookieRecall);
277 } else {
278 $cfg['LoginCookieRecall'] = TRUE;
282 if (!isset($cfg['LoginCookieValidity'])) {
283 $cfg['LoginCookieValidity'] = 1800;
286 if (!isset($cfg['UseDbSearch'])) {
287 $cfg['UseDbSearch'] = TRUE;
290 if (!isset($cfg['IgnoreMultiSubmitErrors'])) {
291 $cfg['IgnoreMultiSubmitErrors'] = FALSE;
294 if (!isset($cfg['VerboseMultiSubmit'])) {
295 $cfg['VerboseMultiSubmit'] = TRUE;
298 if (!isset($cfg['AllowArbitraryServer'])) {
299 $cfg['AllowArbitraryServer'] = FALSE;
302 if (!isset($cfg['LeftFrameLight'])) {
303 if (isset($cfgLeftFrameLight)) {
304 $cfg['LeftFrameLight'] = $cfgLeftFrameLight;
305 unset($cfgLeftFrameLight);
306 } else {
307 $cfg['LeftFrameLight'] = TRUE;
311 if (!isset($cfg['LeftFrameTableSeparator'])) {
312 $cfg['LeftFrameTableSeparator'] = '__';
315 if (!isset($cfg['LeftFrameTableLevel'])) {
316 $cfg['LeftFrameTableLevel'] = '1';
319 if (!isset($cfg['LightTabs'])) {
320 $cfg['LightTabs'] = FALSE;
323 if (!isset($cfg['PropertiesIconic'])) {
324 $cfg['PropertiesIconic'] = TRUE;
327 if (!isset($cfg['PropertiesNumColumns'])) {
328 $cfg['PropertiesNumColumns'] = 1;
331 if (!isset($cfg['ShowTooltip'])) {
332 if (isset($cfgShowTooltip)) {
333 $cfg['ShowTooltip'] = $cfgShowTooltip;
334 } else {
335 $cfg['ShowTooltip'] = TRUE;
339 if (!isset($cfg['LeftDisplayLogo'])) {
340 $cfg['LeftDisplayLogo'] = TRUE;
343 if (!isset($cfg['LeftDisplayServers'])) {
344 $cfg['LeftDisplayServers'] = FALSE;
347 if (!isset($cfg['DisplayServersList'])) {
348 if (isset($cfg['LeftisplayServersList'])) {
349 $cfg['DisplayServersList'] = $cfg['LeftDisplayServersList'];
350 } else {
351 $cfg['DisplayServersList'] = FALSE;
355 if (!isset($cfg['ShowStats'])) {
356 if (isset($cfgShowStats)) {
357 $cfg['ShowStats'] = $cfgShowStats;
358 unset($cfgShowStats);
359 } else {
360 $cfg['ShowStats'] = TRUE;
364 if (!isset($cfg['ShowMysqlInfo'])) {
365 if (isset($cfgShowMysqlInfo)) {
366 $cfg['ShowMysqlInfo'] = $cfgShowMysqlInfo;
367 unset($cfgShowMysqlInfo);
368 } else {
369 $cfg['ShowMysqlInfo'] = FALSE;
373 if (!isset($cfg['ShowMysqlVars'])) {
374 if (isset($cfgShowMysqlVars)) {
375 $cfg['ShowMysqlVars'] = $cfgShowMysqlVars;
376 unset($cfgShowMysqlVars);
377 } else {
378 $cfg['ShowMysqlVars'] = FALSE;
382 if (!isset($cfg['ShowPhpInfo'])) {
383 if (isset($cfgShowPhpInfo)) {
384 $cfg['ShowPhpInfo'] = $cfgShowPhpInfo;
385 unset($cfgShowPhpInfo);
386 } else {
387 $cfg['ShowPhpInfo'] = FALSE;
391 if (!isset($cfg['ShowChgPassword'])) {
392 if (isset($cfgShowChgPassword)) {
393 $cfg['ShowChgPassword'] = $cfgShowChgPassword;
394 unset($cfgShowChgPassword);
395 } else {
396 $cfg['ShowChgPassword'] = FALSE;
400 if (!isset($cfg['SuggestDBName'])) {
401 $cfg['SuggestDBName'] = TRUE;
404 if (!isset($cfg['ShowBlob'])) {
405 if (isset($cfgShowBlob)) {
406 $cfg['ShowBlob'] = $cfgShowBlob;
407 unset($cfgShowBlob);
408 } else {
409 $cfg['ShowBlob'] = FALSE;
413 if (!isset($cfg['NavigationBarIconic'])) {
414 if (isset($cfgNavigationBarIconic)) {
415 $cfg['NavigationBarIconic'] = $cfgNavigationBarIconic;
416 unset($cfgNavigationBarIconic);
417 } else {
418 $cfg['NavigationBarIconic'] = TRUE;
422 if (!isset($cfg['ShowAll'])) {
423 if (isset($cfgShowAll)) {
424 $cfg['ShowAll'] = $cfgShowAll;
425 unset($cfgShowAll);
426 } else {
427 $cfg['ShowAll'] = FALSE;
431 if (!isset($cfg['MaxRows'])) {
432 if (isset($cfgMaxRows)) {
433 $cfg['MaxRows'] = $cfgMaxRows;
434 unset($cfgMaxRows);
435 } else {
436 $cfg['MaxRows'] = 30;
440 if (!isset($cfg['Order'])) {
441 if (isset($cfgOrder)) {
442 $cfg['Order'] = $cfgOrder;
443 unset($cfgOrder);
444 } else {
445 $cfg['Order'] = 'ASC';
449 if (!isset($cfg['ProtectBinary'])) {
450 if (isset($cfgProtectBinary)) {
451 $cfg['ProtectBinary'] = $cfgProtectBinary;
452 unset($cfgProtectBinary);
453 } else if (isset($cfg['ProtectBlob'])) {
454 $cfg['ProtectBinary'] = ($cfg['ProtectBlob'] ? 'blob' : FALSE);
455 unset($cfg['ProtectBlob']);
456 } else if (isset($cfgProtectBlob)) {
457 $cfg['ProtectBinary'] = ($cfgProtectBlob ? 'blob' : FALSE);
458 unset($cfgProtectBlob);
459 } else {
460 $cfg['ProtectBinary'] = 'blob';
464 if (!isset($cfg['ShowFunctionFields'])) {
465 if (isset($cfgShowFunctionFields)) {
466 $cfg['ShowFunctionFields'] = $cfgShowFunctionFields;
467 unset($cfgShowFunctionFields);
468 } else {
469 $cfg['ShowFunctionFields'] = TRUE;
473 if (!isset($cfg['CharEditing'])) {
474 $cfg['CharEditing'] = 'input';
477 if (!isset($cfg['InsertRows'])) {
478 $cfg['InsertRows'] = 2;
481 if (!isset($cfg['ZipDump'])) {
482 if (isset($cfgZipDump)) {
483 $cfg['ZipDump'] = $cfgZipDump;
484 unset($cfgZipDump);
485 } else {
486 $cfg['ZipDump'] = TRUE;
490 if (!isset($cfg['GZipDump'])) {
491 if (isset($cfgGZipDump)) {
492 $cfg['GZipDump'] = $cfgGZipDump;
493 unset($cfgGZipDump);
494 } else {
495 $cfg['GZipDump'] = TRUE;
499 if (!isset($cfg['BZipDump'])) {
500 if (isset($cfgBZipDump)) {
501 $cfg['BZipDump'] = $cfgBZipDump;
502 unset($cfgBZipDump);
503 } else {
504 $cfg['BZipDump'] = TRUE;
507 if (!isset($cfg['CompressOnFly'])) {
508 $cfg['CompressOnFly'] = TRUE;
511 if (!isset($cfg['DefaultTabServer'])) {
512 $cfg['DefaultTabServer'] = 'main.php';
515 if (!isset($cfg['DefaultTabDatabase'])
516 // rabus: config.inc.php rev. 1.112 had this default value.
517 || $cfg['DefaultTabDatabase'] == 'Structure') {
518 $cfg['DefaultTabDatabase'] = 'db_details_structure.php';
521 if (!isset($cfg['DefaultTabTable'])
522 // rabus: config.inc.php rev. 1.112 had this default value.
523 || $cfg['DefaultTabTable'] == 'Structure') {
524 $cfg['DefaultTabTable'] = 'tbl_properties_structure.php';
527 if (!isset($cfg['MySQLManualBase'])) {
528 if (isset($cfgManualBaseShort)) {
529 $cfg['MySQLManualBase'] = $cfgManualBaseShort;
530 $cfg['MySQLManualType'] = 'old';
531 unset($cfgManualBaseShort);
532 } else if (isset($cfg['ManualBaseShort'])) {
533 $cfg['MySQLManualBase'] = $cfg['ManualBaseShort'];
534 $cfg['MySQLManualType'] = 'old';
535 unset($cfg['ManualBaseShort']);
536 } else {
537 $cfg['MySQLManualBase'] = 'http://dev.mysql.com/doc/mysql/en';
538 $cfg['MySQLManualType'] = 'searchable';
542 if (!isset($cfg['MySQLManualType'])) {
543 $cfg['MySQLManualType'] = 'none';
546 if (!isset($cfg['DefaultLang'])) {
547 if (isset($cfgDefaultLang)) {
548 $cfg['DefaultLang'] = $cfgDefaultLang;
549 unset($cfgDefaultLang);
550 } else {
551 $cfg['DefaultLang'] = 'en-iso-8859-1';
555 if (!isset($cfg['DefaultCharset'])) {
556 $cfg['DefaultCharset'] = 'iso-8859-1';
559 if (!isset($cfg['AllowAnywhereRecoding'])) {
560 $cfg['AllowAnywhereRecoding'] = FALSE;
563 if (!isset($cfg['RecodingEngine'])) {
564 $cfg['RecodingEngine'] = 'auto';
567 if (!isset($cfg['IconvExtraParams'])) {
568 $cfg['IconvExtraParams'] = '';
571 if (!isset($cfg['Lang']) &&isset($cfgLang)) {
572 $cfg['Lang'] = $cfgLang;
573 unset($cfgLang);
576 if (!isset($cfg['LeftPointerEnable'])) {
577 $cfg['LeftPointerEnable'] = TRUE;
580 if (!isset($cfg['BrowsePointerEnable'])) {
581 $cfg['BrowsePointerEnable'] = TRUE;
585 if (!isset($cfg['BrowseMarkerEnable'])) {
586 $cfg['BrowseMarkerEnable'] = TRUE;
589 if (!isset($cfg['TextareaCols'])) {
590 if (isset($cfgTextareaCols)) {
591 $cfg['TextareaCols'] = $cfgTextareaCols;
592 unset($cfgTextareaCols);
593 } else {
594 $cfg['TextareaCols'] = 40;
598 if (!isset($cfg['LongtextDoubleTextarea'])) {
599 $cfg['LongtextDoubleTextarea'] = TRUE;
602 if (!isset($cfg['TextareaRows'])) {
603 if (isset($cfgTextareaRows)) {
604 $cfg['TextareaRows'] = $cfgTextareaRows;
605 unset($cfgTextareaRows);
606 } else {
607 $cfg['TextareaRows'] = 7;
611 if (!isset($cfg['TextareaAutoSelect'])) {
612 $cfg['TextareaAutoSelect'] = TRUE;
615 if (!isset($cfg['CharTextareaCols'])) {
616 $cfg['CharTextareaCols'] = 40;
619 if (!isset($cfg['CharTextareaRows'])) {
620 $cfg['CharTextareaRows'] = 2;
623 if (!isset($cfg['LimitChars'])) {
624 if (isset($cfgLimitChars)) {
625 $cfg['LimitChars'] = $cfgLimitChars;
626 unset($cfgLimitChars);
627 } else {
628 $cfg['LimitChars'] = 50;
632 if (!isset($cfg['ModifyDeleteAtLeft'])) {
633 if (isset($cfgModifyDeleteAtLeft)) {
634 $cfg['ModifyDeleteAtLeft'] = $cfgModifyDeleteAtLeft;
635 unset($cfgModifyDeleteAtLeft);
636 } else {
637 $cfg['ModifyDeleteAtLeft'] = TRUE;
641 if (!isset($cfg['ModifyDeleteAtRight'])) {
642 if (isset($cfgModifyDeleteAtRight)) {
643 $cfg['ModifyDeleteAtRight'] = $cfgModifyDeleteAtRight;
644 unset($cfgModifyDeleteAtRight);
645 } else {
646 $cfg['ModifyDeleteAtRight'] = FALSE;
650 if (!isset($cfg['DefaultDisplay'])) {
651 if (isset($cfgDefaultDisplay)) {
652 $cfg['DefaultDisplay'] = $cfgDefaultDisplay;
653 unset($cfgDefaultDisplay);
654 } else {
655 $cfg['DefaultDisplay'] = 'horizontal';
658 if (!isset($cfg['DefaultPropDisplay'])) {
659 $cfg['DefaultPropDisplay'] = 'horizontal';
662 if (!isset($cfg['RepeatCells'])) {
663 if (isset($cfgRepeatCells)) {
664 $cfg['RepeatCells'] = $cfgRepeatCells;
665 unset($cfgRepeatCells);
666 } else {
667 $cfg['RepeatCells'] = 100;
671 if (!isset($cfg['HeaderFlipType'])) {
672 $cfg['HeaderFlipType'] = 'css';
675 if (!isset($cfg['ShowBrowseComments'])) {
676 $cfg['ShowBrowseComments'] = TRUE;
679 if (!isset($cfg['ShowPropertyComments'])) {
680 $cfg['ShowPropertyComments'] = TRUE;
683 if (!isset($cfg['QueryFrame'])) {
684 $cfg['QueryFrame'] = TRUE;
687 if (!isset($cfg['QueryFrameJS'])) {
688 $cfg['QueryFrameJS'] = TRUE;
691 if (!isset($cfg['QueryWindowWidth'])) {
692 $cfg['QueryWindowWidth'] = 550;
695 if (!isset($cfg['QueryWindowHeight'])) {
696 $cfg['QueryWindowHeight'] = 310;
699 if (!isset($cfg['QueryHistoryMax'])) {
700 $cfg['QueryHistoryMax'] = 25;
703 if (!isset($cfg['QueryHistoryDB'])) {
704 $cfg['QueryHistoryDB'] = FALSE;
707 if (!isset($cfg['QueryWindowDefTab'])) {
708 $cfg['QueryWindowDefTab'] = 'sql';
711 if (!isset($cfg['BrowseMIME'])) {
712 $cfg['BrowseMIME'] = TRUE;
715 if (!isset($cfg['MaxExactCount'])) {
716 $cfg['MaxExactCount'] = 20000;
719 if (!isset($cfg['WYSIWYG-PDF'])) {
720 $cfg['WYSIWYG-PDF'] = TRUE;
723 if (!isset($cfg['NaturalOrder'])) {
724 $cfg['NaturalOrder'] = TRUE;
727 if (!isset($cfg['ShowHttpHostTitle'])) {
728 $cfg['ShowHttpHostTitle'] = FALSE;
731 if (!isset($cfg['SetHttpHostTitle'])) {
732 $cfg['SetHttpHostTitle'] = '';
735 if (!isset($cfg['ErrorIconic'])) {
736 $cfg['ErrorIconic'] = TRUE;
739 if (!isset($cfg['MainPageIconic'])) {
740 $cfg['MainPageIconic'] = TRUE;
743 if (!isset($cfg['ReplaceHelpImg'])) {
744 $cfg['ReplaceHelpImg'] = TRUE;
747 if (!isset($cfg['ThemePath'])) {
748 $cfg['ThemePath'] = './themes';
749 $cfg['ThemeDefault'] = 'original';
750 $cfg['ThemeManager'] = TRUE;
751 } else {
752 if (!isset($cfg['ThemeDefault'])){
753 $cfg['ThemeDefault'] = 'original';
755 if (!isset($cfg['ThemeManager'])){
756 $cfg['ThemeManager'] = TRUE;
760 if (!isset($cfg['DefaultQueryTable'])) {
761 $cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1';
764 if (!isset($cfg['DefaultQueryDatabase'])) {
765 $cfg['DefaultQueryDatabase']= '';
768 if (!isset($cfg['ShowTooltipAliasDB'])) {
769 $cfg['ShowTooltipAliasDB'] = FALSE;
772 if (!isset($cfg['ShowTooltipAliasTB'])) {
773 $cfg['ShowTooltipAliasTB'] = FALSE;
776 if (!isset($cfg['SQLQuery']['Edit'])) {
777 $cfg['SQLQuery']['Edit'] = TRUE;
780 if (!isset($cfg['SQLQuery']['Explain'])) {
781 $cfg['SQLQuery']['Explain'] = TRUE;
784 if (!isset($cfg['SQLQuery']['ShowAsPHP'])) {
785 $cfg['SQLQuery']['ShowAsPHP'] = TRUE;
788 if (!isset($cfg['SQLQuery']['Validate'])) {
789 $cfg['SQLQuery']['Validate'] = FALSE;
792 if (!isset($cfg['SQLQuery']['Refresh'])) {
793 $cfg['SQLQuery']['Refresh'] = TRUE;
796 if (!isset($cfg['UploadDir'])) {
797 $cfg['UploadDir'] = '';
800 if (!isset($cfg['SaveDir'])) {
801 $cfg['SaveDir'] = '';
804 if (!isset($cfg['docSQLDir'])) {
805 $cfg['docSQLDir'] = '';
808 if (!isset($cfg['TempDir'])) {
809 $cfg['TempDir'] = '';
813 if (!isset($cfg['SQLValidator']['use'])) {
814 $cfg['SQLValidator']['use'] = FALSE;
817 if (!isset($cfg['SQLValidator']['username'])) {
818 $cfg['SQLValidator']['username'] = '';
821 if (!isset($cfg['SQLValidator']['password'])) {
822 $cfg['SQLValidator']['password'] = '';
825 if (!isset($cfg['DBG']['enable'])) {
826 $cfg['DBG']['enable'] = FALSE;
829 if (!isset($cfg['DBG']['profile']['enable'])) {
830 $cfg['DBG']['profile']['enable'] = FALSE;
833 if (!isset($cfg['DBG']['profile']['threshold'])) {
834 $cfg['DBG']['profile']['threshold'] = 0.5;
837 if (!isset($cfg['SQP']['fmtType'])) {
838 $cfg['SQP']['fmtType'] = 'html';
841 if (!isset($cfg['SQP']['fmtInd'])) {
842 $cfg['SQP']['fmtInd'] = '1';
845 if (!isset($cfg['SQP']['fmtIndUnit'])) {
846 $cfg['SQP']['fmtIndUnit'] = 'em';
849 if (!isset($cfg['AvailableCharsets'])) {
850 $cfg['AvailableCharsets'] = array(
851 'iso-8859-1',
852 'iso-8859-2',
853 'iso-8859-3',
854 'iso-8859-4',
855 'iso-8859-5',
856 'iso-8859-6',
857 'iso-8859-7',
858 'iso-8859-8',
859 'iso-8859-9',
860 'iso-8859-10',
861 'iso-8859-11',
862 'iso-8859-12',
863 'iso-8859-13',
864 'iso-8859-14',
865 'iso-8859-15',
866 'windows-1250',
867 'windows-1251',
868 'windows-1252',
869 'windows-1256',
870 'windows-1257',
871 'koi8-r',
872 'big5',
873 'gb2312',
874 'gbk',
875 'utf-8',
876 'utf-7',
877 'x-user-defined',
878 'euc-jp',
879 'ks_c_5601-1987',
880 'tis-620',
881 'SHIFT_JIS'
885 if (!isset($cfg['ColumnTypes'])) {
886 if (isset($cfgColumnTypes)) {
887 $cfg['ColumnTypes'] = $cfgColumnTypes;
888 unset($cfgColumnTypes);
889 } else {
890 $cfg['ColumnTypes'] = array(
891 'VARCHAR',
892 'TINYINT',
893 'TEXT',
894 'DATE',
895 'SMALLINT',
896 'MEDIUMINT',
897 'INT',
898 'BIGINT',
899 'FLOAT',
900 'DOUBLE',
901 'DECIMAL',
902 'DATETIME',
903 'TIMESTAMP',
904 'TIME',
905 'YEAR',
906 'CHAR',
907 'TINYBLOB',
908 'TINYTEXT',
909 'BLOB',
910 'MEDIUMBLOB',
911 'MEDIUMTEXT',
912 'LONGBLOB',
913 'LONGTEXT',
914 'ENUM',
915 'SET'
920 if (!isset($cfg['AttributeTypes'])) {
921 if (isset($cfgAttributeTypes)) {
922 $cfg['AttributeTypes'] = $cfgAttributeTypes;
923 unset($cfgAttributeTypes);
924 } else {
925 $cfg['AttributeTypes'] = array(
927 'BINARY',
928 'UNSIGNED',
929 'UNSIGNED ZEROFILL'
934 if ($cfg['ShowFunctionFields']) {
935 if (!isset($cfg['Functions'])) {
936 if (isset($cfgFunctions)) {
937 $cfg['Functions'] = $cfgFunctions;
938 } else {
939 $cfg['Functions'] = array(
940 'ASCII',
941 'CHAR',
942 'SOUNDEX',
943 'LCASE',
944 'UCASE',
945 'NOW',
946 'OLD_PASSWORD',
947 'PASSWORD',
948 'MD5',
949 'SHA1',
950 'ENCRYPT',
951 'RAND',
952 'LAST_INSERT_ID',
953 'COUNT',
954 'AVG',
955 'SUM',
956 'CURDATE',
957 'CURTIME',
958 'FROM_DAYS',
959 'FROM_UNIXTIME',
960 'PERIOD_ADD',
961 'PERIOD_DIFF',
962 'TO_DAYS',
963 'UNIX_TIMESTAMP',
964 'USER',
965 'WEEKDAY',
966 'CONCAT'
970 // Which column types will be mapped to which Group?
971 $cfg['RestrictColumnTypes'] = array(
972 'VARCHAR' => 'FUNC_CHAR',
973 'TINYINT' => 'FUNC_NUMBER',
974 'TEXT' => 'FUNC_CHAR',
975 'DATE' => 'FUNC_DATE',
976 'SMALLINT' => 'FUNC_NUMBER',
977 'MEDIUMINT' => 'FUNC_NUMBER',
978 'INT' => 'FUNC_NUMBER',
979 'BIGINT' => 'FUNC_NUMBER',
980 'FLOAT' => 'FUNC_NUMBER',
981 'DOUBLE' => 'FUNC_NUMBER',
982 'DECIMAL' => 'FUNC_NUMBER',
983 'DATETIME' => 'FUNC_DATE',
984 'TIMESTAMP' => 'FUNC_DATE',
985 'TIME' => 'FUNC_DATE',
986 'YEAR' => 'FUNC_DATE',
987 'CHAR' => 'FUNC_CHAR',
988 'TINYBLOB' => 'FUNC_CHAR',
989 'TINYTEXT' => 'FUNC_CHAR',
990 'BLOB' => 'FUNC_CHAR',
991 'MEDIUMBLOB' => 'FUNC_CHAR',
992 'MEDIUMTEXT' => 'FUNC_CHAR',
993 'LONGBLOB' => 'FUNC_CHAR',
994 'LONGTEXT' => 'FUNC_CHAR',
995 'ENUM' => '',
996 'SET' => ''
999 // Map above defined groups to any function
1000 $cfg['RestrictFunctions'] = array(
1001 'FUNC_CHAR' => array(
1002 'ASCII',
1003 'CHAR',
1004 'SOUNDEX',
1005 'LCASE',
1006 'UCASE',
1007 'OLD_PASSWORD',
1008 'PASSWORD',
1009 'MD5',
1010 'SHA1',
1011 'ENCRYPT',
1012 'LAST_INSERT_ID',
1013 'USER',
1014 'CONCAT'
1017 'FUNC_DATE' => array(
1018 'NOW',
1019 'CURDATE',
1020 'CURTIME',
1021 'FROM_DAYS',
1022 'FROM_UNIXTIME',
1023 'PERIOD_ADD',
1024 'PERIOD_DIFF',
1025 'TO_DAYS',
1026 'UNIX_TIMESTAMP',
1027 'WEEKDAY'
1030 'FUNC_NUMBER' => array(
1031 'ASCII',
1032 'CHAR',
1033 'MD5',
1034 'SHA1',
1035 'ENCRYPT',
1036 'RAND',
1037 'LAST_INSERT_ID',
1038 'UNIX_TIMESTAMP',
1039 'COUNT',
1040 'AVG',
1041 'SUM'
1046 if (!isset($cfg['DefaultFunctions'])) {
1047 $cfg['DefaultFunctions'] = array(
1048 'FUNC_CHAR' => '',
1049 'FUNC_DATE' => '',
1050 'FUNC_NUMBER' => '',
1051 'first_timestamp' => 'NOW'
1056 if (!isset($cfg['NumOperators'])) {
1057 $cfg['NumOperators'] = array(
1058 '=',
1059 '>',
1060 '>=',
1061 '<',
1062 '<=',
1063 '!=',
1064 'LIKE',
1065 'NOT LIKE'
1069 if (!isset($cfg['TextOperators'])) {
1070 $cfg['TextOperators'] = array(
1071 'LIKE',
1072 'LIKE %...%',
1073 'NOT LIKE',
1074 '=',
1075 '!=',
1076 'REGEXP',
1077 'NOT REGEXP'
1081 if (!isset($cfg['EnumOperators'])) {
1082 $cfg['EnumOperators'] = array(
1083 '=',
1084 '!='
1088 if (!isset($cfg['NullOperators'])) {
1089 $cfg['NullOperators'] = array(
1090 'IS NULL',
1091 'IS NOT NULL'
1095 if (!isset($cfg['UnaryOperators'])) {
1096 $cfg['UnaryOperators'] = array(
1097 'IS NULL' => 1,
1098 'IS NOT NULL' => 1
1102 if (!isset($cfg['GD2Available'])) {
1103 $cfg['GD2Available'] = 'auto';
1105 if (!isset($cfg['PDFPageSizes'])) {
1106 $cfg['PDFPageSizes'] = array('A3', 'A4', 'A5', 'letter', 'legal');
1108 if (!isset($cfg['PDFDefaultPageSize'])) {
1109 $cfg['PDFDefaultPageSize'] = 'A4';
1111 if (!isset($cfg['CtrlArrowsMoving'])) {
1112 $cfg['CtrlArrowsMoving'] = TRUE;
1115 if (!isset($cfg['Export'])) {
1116 $cfg['Export'] = array();
1119 if (!isset($cfg['Export']['format'])) {
1120 $cfg['Export']['format'] = 'sql';
1121 } // sql/latex/excel/csv/xml/xls/htmlexcel/htmlword
1122 if (!isset($cfg['Export']['compression'])) {
1123 $cfg['Export']['compression'] = 'none';
1124 } // none/zip/gzip/bzip2
1126 if (!isset($cfg['Export']['asfile'])) {
1127 $cfg['Export']['asfile'] = FALSE;
1129 if (!isset($cfg['Export']['onserver'])) {
1130 $cfg['Export']['onserver'] = FALSE;
1132 if (!isset($cfg['Export']['onserver_overwrite'])) {
1133 $cfg['Export']['onserver_overwrite'] = FALSE;
1135 if (!isset($cfg['Export']['remember_file_template'])) {
1136 $cfg['Export']['remember_file_template'] = TRUE;
1138 if (!isset($cfg['Export']['file_template_table'])) {
1139 $cfg['Export']['file_template_table'] = '__TABLE__';
1141 if (!isset($cfg['Export']['file_template_database'])) {
1142 $cfg['Export']['file_template_database'] = '__DB__';
1144 if (!isset($cfg['Export']['file_template_server'])) {
1145 $cfg['Export']['file_template_server'] = '__SERVER__';
1147 if (!isset($cfg['Export']['csv_null'])) {
1148 $cfg['Export']['csv_null'] = 'NULL';
1150 if (!isset($cfg['Export']['csv_columns'])) {
1151 $cfg['Export']['csv_columns'] = FALSE;
1153 if (!isset($cfg['Export']['htmlexcel_null'])) {
1154 $cfg['Export']['htmlexcel_null'] = 'NULL';
1156 if (!isset($cfg['Export']['htmlexcel_columns'])) {
1157 $cfg['Export']['htmlexcel_columns'] = FALSE;
1159 if (!isset($cfg['Export']['htmlword_structure'])) {
1160 $cfg['Export']['htmlword_structure'] = TRUE;
1162 if (!isset($cfg['Export']['htmlword_data'])) {
1163 $cfg['Export']['htmlword_data'] = TRUE;
1165 if (!isset($cfg['Export']['htmlword_null'])) {
1166 $cfg['Export']['htmlword_null'] = 'NULL';
1168 if (!isset($cfg['Export']['htmlword_columns'])) {
1169 $cfg['Export']['htmlword_columns'] = FALSE;
1171 if (!isset($cfg['Export']['xls_null'])) {
1172 $cfg['Export']['xls_null'] = 'NULL';
1174 if (!isset($cfg['Export']['xls_columns'])) {
1175 $cfg['Export']['xls_columns'] = FALSE;
1177 if (!isset($cfg['Export']['excel_null'])) {
1178 $cfg['Export']['excel_null'] = 'NULL';
1180 if (!isset($cfg['Export']['excel_columns'])) {
1181 $cfg['Export']['excel_columns'] = FALSE;
1183 if (!isset($cfg['Export']['excel_edition'])) {
1184 $cfg['Export']['excel_edition'] = 'win';
1186 if (!isset($cfg['Export']['latex_null'])) {
1187 $cfg['Export']['latex_null'] = '\textit{NULL}';
1189 if (!isset($cfg['Export']['csv_separator'])) {
1190 $cfg['Export']['csv_separator'] = ';';
1192 if (!isset($cfg['Export']['csv_enclosed'])) {
1193 $cfg['Export']['csv_enclosed'] = '&quot;';
1195 if (!isset($cfg['Export']['csv_escaped'])) {
1196 $cfg['Export']['csv_escaped'] = '\\';
1198 if (!isset($cfg['Export']['csv_terminated'])) {
1199 $cfg['Export']['csv_terminated'] = 'AUTO';
1202 if (!isset($cfg['Export']['latex_structure'])) {
1203 $cfg['Export']['latex_structure'] = TRUE;
1205 if (!isset($cfg['Export']['latex_data'])) {
1206 $cfg['Export']['latex_data'] = TRUE;
1208 if (!isset($cfg['Export']['latex_columns'])) {
1209 $cfg['Export']['latex_columns'] = TRUE;
1211 if (!isset($cfg['Export']['latex_relation'])) {
1212 $cfg['Export']['latex_relation'] = TRUE;
1214 if (!isset($cfg['Export']['latex_comments'])) {
1215 $cfg['Export']['latex_comments'] = TRUE;
1217 if (!isset($cfg['Export']['latex_mime'])) {
1218 $cfg['Export']['latex_mime'] = TRUE;
1220 if (!isset($cfg['Export']['latex_caption'])) {
1221 $cfg['Export']['latex_caption'] = TRUE;
1223 if (!isset($cfg['Export']['latex_data_label'])) {
1224 $cfg['Export']['latex_data_label'] = 'tab:__TABLE__-data';
1226 if (!isset($cfg['Export']['latex_structure_label'])) {
1227 $cfg['Export']['latex_structure_label'] = 'tab:__TABLE__-structure';
1230 if (!isset($cfg['Export']['sql_drop_database'])) {
1231 $cfg['Export']['sql_drop_database'] = FALSE;
1233 if (!isset($cfg['Export']['sql_disable_fk'])) {
1234 $cfg['Export']['sql_disable_fk'] = FALSE;
1236 if (!isset($cfg['Export']['sql_use_transaction'])) {
1237 $cfg['Export']['sql_use_transaction'] = FALSE;
1239 if (!isset($cfg['Export']['sql_drop_table'])) {
1240 $cfg['Export']['sql_drop_table'] = FALSE;
1242 if (!isset($cfg['Export']['sql_if_not_exists'])) {
1243 $cfg['Export']['sql_if_not_exists'] = FALSE;
1245 if (!isset($cfg['Export']['sql_auto_increment'])) {
1246 $cfg['Export']['sql_auto_increment'] = TRUE;
1248 if (!isset($cfg['Export']['sql_structure'])) {
1249 $cfg['Export']['sql_structure'] = TRUE;
1251 if (!isset($cfg['Export']['sql_data'])) {
1252 $cfg['Export']['sql_data'] = TRUE;
1254 if (!isset($cfg['Export']['sql_compat'])) {
1255 $cfg['Export']['sql_compat'] = 'NONE';
1257 if (!isset($cfg['Export']['sql_backquotes'])) {
1258 $cfg['Export']['sql_backquotes'] = TRUE;
1260 if (!isset($cfg['Export']['sql_dates'])) {
1261 $cfg['Export']['sql_dates'] = FALSE;
1263 if (!isset($cfg['Export']['sql_relation'])) {
1264 $cfg['Export']['sql_relation'] = FALSE;
1266 if (!isset($cfg['Export']['sql_columns'])) {
1267 $cfg['Export']['sql_columns'] = FALSE;
1269 if (!isset($cfg['Export']['sql_delayed'])) {
1270 $cfg['Export']['sql_delayed'] = FALSE;
1272 if (!isset($cfg['Export']['sql_ignore'])) {
1273 $cfg['Export']['sql_ignore'] = FALSE;
1275 if (!isset($cfg['Export']['sql_hex_for_binary'])) {
1276 $cfg['Export']['sql_hex_for_binary'] = TRUE;
1278 if (!isset($cfg['Export']['sql_type'])) {
1279 $cfg['Export']['sql_type'] = 'insert';
1281 if (!isset($cfg['Export']['sql_extended'])) {
1282 $cfg['Export']['sql_extended'] = FALSE;
1284 if (!isset($cfg['Export']['sql_comments'])) {
1285 $cfg['Export']['sql_comments'] = FALSE;
1287 if (!isset($cfg['Export']['sql_mime'])) {
1288 $cfg['Export']['sql_mime'] = FALSE;
1290 if (!isset($cfg['Export']['sql_header_comment'])) {
1291 $cfg['Export']['sql_header_comment'] = '';