-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Expand file tree
/
Copy pathSettings.php
More file actions
4596 lines (3936 loc) · 120 KB
/
Settings.php
File metadata and controls
4596 lines (3936 loc) · 120 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
declare(strict_types=1);
namespace PhpMyAdmin\Config;
use PhpMyAdmin\Config\Settings\Console;
use PhpMyAdmin\Config\Settings\Debug;
use PhpMyAdmin\Config\Settings\Export;
use PhpMyAdmin\Config\Settings\Import;
use PhpMyAdmin\Config\Settings\Schema;
use PhpMyAdmin\Config\Settings\Server;
use PhpMyAdmin\Config\Settings\SqlQueryBox;
use PhpMyAdmin\Config\Settings\Transformations;
use function array_keys;
use function count;
use function defined;
use function get_object_vars;
use function in_array;
use function is_array;
use function is_int;
use function is_string;
use function min;
use function strlen;
use const DIRECTORY_SEPARATOR;
use const ROOT_PATH;
use const TEMP_DIR;
use const VERSION_CHECK_DEFAULT;
// phpcs:disable Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
/**
* @psalm-immutable
*/
final class Settings
{
/**
* Your phpMyAdmin URL.
*
* Complete the variable below with the full URL ie
* https://example.com/path_to_your_phpMyAdmin_directory/
*
* It must contain characters that are valid for a URL, and the path is
* case sensitive on some Web servers, for example Unix-based servers.
*
* In most cases you can leave this variable empty, as the correct value
* will be detected automatically. However, we recommend that you do
* test to see that the auto-detection code works in your system. A good
* test is to browse a table, then edit a row and save it. There will be
* an error message if phpMyAdmin cannot auto-detect the correct value.
*
* @var string
*/
public $PmaAbsoluteUri;
/**
* Configure authentication logging destination
*
* @var string
*/
public $AuthLog;
/**
* Whether to log successful authentication attempts
*
* @var bool
*/
public $AuthLogSuccess;
/**
* Disable the default warning that is displayed on the DB Details Structure page if
* any of the required Tables for the configuration storage could not be found
*
* @var bool
*/
public $PmaNoRelation_DisableWarning;
/**
* Disable the default warning that is displayed if Suhosin is detected
*
* @var bool
*/
public $SuhosinDisableWarning;
/**
* Disable the default warning that is displayed if session.gc_maxlifetime
* is less than `LoginCookieValidity`
*
* @var bool
*/
public $LoginCookieValidityDisableWarning;
/**
* Disable the default warning about MySQL reserved words in column names
*
* @var bool
*/
public $ReservedWordDisableWarning;
/**
* Show warning about incomplete translations on certain threshold.
*
* @var int
*/
public $TranslationWarningThreshold;
/**
* Allows phpMyAdmin to be included from a other document in a frame;
* setting this to true is a potential security hole. Setting this to
* 'sameorigin' prevents phpMyAdmin to be included from another document
* in a frame, unless that document belongs to the same domain.
*
* @var bool|string
* @psalm-var bool|'sameorigin'
*/
public $AllowThirdPartyFraming;
/**
* The 'cookie' auth_type uses the Sodium extension to encrypt the cookies. If at least one server configuration
* uses 'cookie' auth_type, enter here a generated string of random bytes to be used as an encryption key. The
* encryption key must be 32 bytes long.
*
* @var string
*/
public $blowfish_secret;
/**
* Server(s) configuration
*
* The $cfg['Servers'] array starts with $cfg['Servers'][1]. Do not use
* $cfg['Servers'][0]. You can disable a server configuration entry by setting host
* to ''. If you want more than one server, just copy following section
* (including $i incrementation) several times. There is no need to define
* full server array, just define values you need to change.
*
* @var array<int, Server>
* @psalm-var array<int<1, max>, Server>
*/
public $Servers;
/**
* Default server (0 = no default server)
*
* If you have more than one server configured, you can set $cfg['ServerDefault']
* to any one of them to auto-connect to that server when phpMyAdmin is started,
* or set it to 0 to be given a list of servers without logging in
* If you have only one server configured, $cfg['ServerDefault'] *MUST* be
* set to that server.
*
* @var int
* @psalm-var 0|positive-int
*/
public $ServerDefault;
/**
* whether version check is active
*
* @var bool
*/
public $VersionCheck;
/**
* The url of the proxy to be used when retrieving the information about
* the latest version of phpMyAdmin or error reporting. You need this if
* the server where phpMyAdmin is installed does not have direct access to
* the internet.
* The format is: "hostname:portnumber"
*
* @var string
*/
public $ProxyUrl;
/**
* The username for authenticating with the proxy. By default, no
* authentication is performed. If a username is supplied, Basic
* Authentication will be performed. No other types of authentication
* are currently supported.
*
* @var string
*/
public $ProxyUser;
/**
* The password for authenticating with the proxy.
*
* @var string
*/
public $ProxyPass;
/**
* maximum number of db's displayed in database list
*
* @var int
* @psalm-var positive-int
*/
public $MaxDbList;
/**
* maximum number of tables displayed in table list
*
* @var int
* @psalm-var positive-int
*/
public $MaxTableList;
/**
* whether to show hint or not
*
* @var bool
*/
public $ShowHint;
/**
* maximum number of characters when a SQL query is displayed
*
* @var int
* @psalm-var positive-int
*/
public $MaxCharactersInDisplayedSQL;
/**
* use GZIP output buffering if possible (true|false|'auto')
*
* @var string|bool
* @psalm-var 'auto'|bool
*/
public $OBGzip;
/**
* use persistent connections to MySQL database
*
* @var bool
*/
public $PersistentConnections;
/**
* maximum execution time in seconds (0 for no limit)
*
* @var int
* @psalm-var 0|positive-int
*/
public $ExecTimeLimit;
/**
* Path for storing session data (session_save_path PHP parameter).
*
* @var string
*/
public $SessionSavePath;
/**
* Hosts or IPs to consider safe when checking if SSL is used or not
*
* @var string[]
*/
public $MysqlSslWarningSafeHosts;
/**
* maximum allocated bytes ('-1' for no limit, '0' for no change)
* this is a string because '16M' is a valid value; we must put here
* a string as the default value so that /setup accepts strings
*
* @var string
*/
public $MemoryLimit;
/**
* mark used tables, make possible to show locked tables (since MySQL 3.23.30)
*
* @var bool
*/
public $SkipLockedTables;
/**
* show SQL queries as run
*
* @var bool
*/
public $ShowSQL;
/**
* retain SQL input on Ajax execute
*
* @var bool
*/
public $RetainQueryBox;
/**
* use CodeMirror syntax highlighting for editing SQL
*
* @var bool
*/
public $CodemirrorEnable;
/**
* use the parser to find any errors in the query before executing
*
* @var bool
*/
public $LintEnable;
/**
* show a 'Drop database' link to normal users
*
* @var bool
*/
public $AllowUserDropDatabase;
/**
* confirm some commands that can result in loss of data
*
* @var bool
*/
public $Confirm;
/**
* sets SameSite attribute of the Set-Cookie HTTP response header
*
* @var string
* @psalm-var 'Lax'|'Strict'|'None'
*/
public $CookieSameSite;
/**
* recall previous login in cookie authentication mode or not
*
* @var bool
*/
public $LoginCookieRecall;
/**
* validity of cookie login (in seconds; 1440 matches php.ini's
* session.gc_maxlifetime)
*
* @var int
* @psalm-var positive-int
*/
public $LoginCookieValidity;
/**
* how long login cookie should be stored (in seconds)
*
* @var int
* @psalm-var 0|positive-int
*/
public $LoginCookieStore;
/**
* whether to delete all login cookies on logout
*
* @var bool
*/
public $LoginCookieDeleteAll;
/**
* whether to enable the "database search" feature or not
*
* @var bool
*/
public $UseDbSearch;
/**
* if set to true, PMA continues computing multiple-statement queries
* even if one of the queries failed
*
* @var bool
*/
public $IgnoreMultiSubmitErrors;
/**
* Define whether phpMyAdmin will encrypt sensitive data from the URL query string.
*
* @var bool
*/
public $URLQueryEncryption;
/**
* A secret key used to encrypt/decrypt the URL query string. Should be 32 bytes long.
*
* @var string
*/
public $URLQueryEncryptionSecretKey;
/**
* allow login to any user entered server in cookie based authentication
*
* @var bool
*/
public $AllowArbitraryServer;
/**
* restrict by IP (with regular expression) the MySQL servers the user can enter
* when $cfg['AllowArbitraryServer'] = true
*
* @var string
*/
public $ArbitraryServerRegexp;
/**
* To enable reCaptcha v2 checkbox mode if necessary
*
* @var string
* @psalm-var 'invisible'|'checkbox'
*/
public $CaptchaMethod;
/**
* URL for the reCaptcha v2 compatible API to use
*
* @var string
*/
public $CaptchaApi;
/**
* Content-Security-Policy snippet for the reCaptcha v2 compatible API
*
* @var string
*/
public $CaptchaCsp;
/**
* reCaptcha API's request parameter name
*
* @var string
*/
public $CaptchaRequestParam;
/**
* reCaptcha API's response parameter name
*
* @var string
*/
public $CaptchaResponseParam;
/**
* if reCaptcha is enabled it needs public key to connect with the service
*
* @var string
*/
public $CaptchaLoginPublicKey;
/**
* if reCaptcha is enabled it needs private key to connect with the service
*
* @var string
*/
public $CaptchaLoginPrivateKey;
/**
* if reCaptcha is enabled may need an URL for site verify
*
* @var string
*/
public $CaptchaSiteVerifyURL;
/**
* Enable drag and drop import
*
* @see https://github.com/phpmyadmin/phpmyadmin/issues/13155
*
* @var bool
*/
public $enable_drag_drop_import;
/**
* In the navigation panel, replaces the database tree with a selector
*
* @var bool
*/
public $ShowDatabasesNavigationAsTree;
/**
* maximum number of first level databases displayed in navigation panel
*
* @var int
* @psalm-var positive-int
*/
public $FirstLevelNavigationItems;
/**
* maximum number of items displayed in navigation panel
*
* @var int
* @psalm-var positive-int
*/
public $MaxNavigationItems;
/**
* turn the select-based light menu into a tree
*
* @var bool
*/
public $NavigationTreeEnableGrouping;
/**
* the separator to sub-tree the select-based light menu tree
*
* @var string
*/
public $NavigationTreeDbSeparator;
/**
* Which string will be used to generate table prefixes
* to split/nest tables into multiple categories
*
* @var string|string[]|false
*/
public $NavigationTreeTableSeparator;
/**
* How many sublevels should be displayed when splitting up tables
* by the above Separator
*
* @var int
* @psalm-var positive-int
*/
public $NavigationTreeTableLevel;
/**
* link with main panel by highlighting the current db/table
*
* @var bool
*/
public $NavigationLinkWithMainPanel;
/**
* display logo at top of navigation panel
*
* @var bool
*/
public $NavigationDisplayLogo;
/**
* where should logo link point to (can also contain an external URL)
*
* @var string
*/
public $NavigationLogoLink;
/**
* whether to open the linked page in the main window ('main') or
* in a new window ('new')
*
* @var string
* @psalm-var 'main'|'new'
*/
public $NavigationLogoLinkWindow;
/**
* number of recently used tables displayed in the navigation panel
*
* @var int
* @psalm-var 0|positive-int
*/
public $NumRecentTables;
/**
* number of favorite tables displayed in the navigation panel
*
* @var int
* @psalm-var 0|positive-int
*/
public $NumFavoriteTables;
/**
* display a JavaScript table filter in the navigation panel
* when more then x tables are present
*
* @var int
* @psalm-var positive-int
*/
public $NavigationTreeDisplayItemFilterMinimum;
/**
* display server choice at top of navigation panel
*
* @var bool
*/
public $NavigationDisplayServers;
/**
* server choice as links
*
* @var bool
*/
public $DisplayServersList;
/**
* display a JavaScript database filter in the navigation panel
* when more then x databases are present
*
* @var int
* @psalm-var positive-int
*/
public $NavigationTreeDisplayDbFilterMinimum;
/**
* target of the navigation panel quick access icon
*
* Possible values:
* 'structure' = fields list
* 'sql' = SQL form
* 'search' = search page
* 'insert' = insert row page
* 'browse' = browse page
*
* @var string
* @psalm-var 'structure'|'sql'|'search'|'insert'|'browse'
*/
public $NavigationTreeDefaultTabTable;
/**
* target of the navigation panel quick second access icon
*
* Possible values:
* 'structure' = fields list
* 'sql' = SQL form
* 'search' = search page
* 'insert' = insert row page
* 'browse' = browse page
* '' = no link
*
* @var string
* @psalm-var 'structure'|'sql'|'search'|'insert'|'browse'|''
*/
public $NavigationTreeDefaultTabTable2;
/**
* Enables the possibility of navigation tree expansion
*
* @var bool
*/
public $NavigationTreeEnableExpansion;
/**
* Show tables in navigation panel
*
* @var bool
*/
public $NavigationTreeShowTables;
/**
* Show views in navigation panel
*
* @var bool
*/
public $NavigationTreeShowViews;
/**
* Show functions in navigation panel
*
* @var bool
*/
public $NavigationTreeShowFunctions;
/**
* Show procedures in navigation panel
*
* @var bool
*/
public $NavigationTreeShowProcedures;
/**
* Show events in navigation panel
*
* @var bool
*/
public $NavigationTreeShowEvents;
/**
* Width of navigation panel
*
* @var int
* @psalm-var 0|positive-int
*/
public $NavigationWidth;
/**
* Automatically expands single database in navigation panel
*
* @var bool
*/
public $NavigationTreeAutoexpandSingleDb;
/**
* allow to display statistics and space usage in the pages about database
* details and table properties
*
* @var bool
*/
public $ShowStats;
/**
* show PHP info link
*
* @var bool
*/
public $ShowPhpInfo;
/**
* show MySQL server and web server information
*
* @var bool
*/
public $ShowServerInfo;
/**
* show change password link
*
* @var bool
*/
public $ShowChgPassword;
/**
* show create database form
*
* @var bool
*/
public $ShowCreateDb;
/**
* show charset column in database structure (true|false)?
*
* @var bool
*/
public $ShowDbStructureCharset;
/**
* show comment column in database structure (true|false)?
*
* @var bool
*/
public $ShowDbStructureComment;
/**
* show creation timestamp column in database structure (true|false)?
*
* @var bool
*/
public $ShowDbStructureCreation;
/**
* show last update timestamp column in database structure (true|false)?
*
* @var bool
*/
public $ShowDbStructureLastUpdate;
/**
* show last check timestamp column in database structure (true|false)?
*
* @var bool
*/
public $ShowDbStructureLastCheck;
/**
* allow hide action columns to drop down menu in database structure (true|false)?
*
* @var bool
*/
public $HideStructureActions;
/**
* Show column comments in table structure view (true|false)?
*
* @var bool
*/
public $ShowColumnComments;
/**
* Use icons instead of text for the navigation bar buttons (table browse)
* ('text'|'icons'|'both')
*
* @var string
* @psalm-var 'text'|'icons'|'both'
*/
public $TableNavigationLinksMode;
/**
* Defines whether a user should be displayed a "show all (records)"
* button in browse mode or not.
*
* @var bool
*/
public $ShowAll;
/**
* Number of rows displayed when browsing a result set. If the result
* set contains more rows, "Previous" and "Next".
* Possible values: 25,50,100,250,500
*
* @var int
* @psalm-var positive-int
*/
public $MaxRows;
/**
* default for 'ORDER BY' clause (valid values are 'ASC', 'DESC' or 'SMART' -ie
* descending order for fields of type TIME, DATE, DATETIME & TIMESTAMP,
* ascending order else-)
*
* @var string
* @psalm-var 'ASC'|'DESC'|'SMART'
*/
public $Order;
/**
* grid editing: save edited cell(s) in browse-mode at once
*
* @var bool
*/
public $SaveCellsAtOnce;
/**
* grid editing: which action triggers it, or completely disable the feature
*
* Possible values:
* 'click'
* 'double-click'
* 'disabled'
*
* @var string
* @psalm-var 'double-click'|'click'|'disabled'
*/
public $GridEditing;
/**
* Options > Relational display
*
* Possible values:
* 'K' for key value
* 'D' for display column
*
* @var string
* @psalm-var 'K'|'D'
*/
public $RelationalDisplay;
/**
* disallow editing of binary fields
* valid values are:
* false allow editing
* 'blob' allow editing except for BLOB fields
* 'noblob' disallow editing except for BLOB fields
* 'all' disallow editing
*
* @var string|false
* @psalm-var 'blob'|'noblob'|'all'|false
*/
public $ProtectBinary;
/**
* Display the function fields in edit/insert mode
*
* @var bool
*/
public $ShowFunctionFields;
/**
* Display the type fields in edit/insert mode
*
* @var bool
*/
public $ShowFieldTypesInDataEditView;
/**
* Which editor should be used for CHAR/VARCHAR fields:
* input - allows limiting of input length
* textarea - allows newlines in fields
*
* @var string
* @psalm-var 'input'|'textarea'
*/
public $CharEditing;
/**
* The minimum size for character input fields
*
* @var int
* @psalm-var 0|positive-int
*/
public $MinSizeForInputField;
/**
* The maximum size for character input fields
*
* @var int
* @psalm-var positive-int
*/
public $MaxSizeForInputField;
/**
* How many rows can be inserted at one time
*
* @var int
* @psalm-var positive-int
*/
public $InsertRows;
/**
* Sort order for items in a foreign-key drop-down list.
* 'content' is the referenced data, 'id' is the key value.
*
* @var string[]
* @psalm-var array{0: 'content-id'|'id-content', 1?: 'content-id'|'id-content'}
*/
public $ForeignKeyDropdownOrder;
/**
* A drop-down list will be used if fewer items are present
*
* @var int
* @psalm-var positive-int
*/
public $ForeignKeyMaxLimit;
/**
* Whether to disable foreign key checks while importing
*
* @var string
* @psalm-var 'default'|'enable'|'disable'
*/
public $DefaultForeignKeyChecks;
/**
* Allow for the use of zip compression (requires zip support to be enabled)
*
* @var bool
*/
public $ZipDump;
/**
* Allow for the use of gzip compression (requires zlib)
*
* @var bool
*/
public $GZipDump;
/**
* Allow for the use of bzip2 decompression (requires bz2 extension)
*
* @var bool
*/
public $BZipDump;
/**
* Will compress gzip exports on the fly without the need for much memory.
* If you encounter problems with created gzip files disable this feature.
*
* @var bool
*/
public $CompressOnFly;
/**
* How to display the menu tabs ('icons'|'text'|'both')
*
* @var string
* @psalm-var 'icons'|'text'|'both'
*/
public $TabsMode;
/**
* How to display various action links ('icons'|'text'|'both')
*
* @var string
* @psalm-var 'icons'|'text'|'both'
*/
public $ActionLinksMode;
/**
* How many columns should be used for table display of a database?
* (a value larger than 1 results in some information being hidden)
*
* @var int
* @psalm-var positive-int
*/
public $PropertiesNumColumns;
/**
* Possible values:
* 'welcome' = the welcome page (recommended for multiuser setups)
* 'databases' = list of databases
* 'status' = runtime information
* 'variables' = MySQL server variables
* 'privileges' = user management
*
* @var string
* @psalm-var 'welcome'|'databases'|'status'|'variables'|'privileges'
*/
public $DefaultTabServer;
/**
* Possible values:
* 'structure' = tables list
* 'sql' = SQL form
* 'search' = search query
* 'operations' = operations on database
*