-
Notifications
You must be signed in to change notification settings - Fork 645
/
Copy pathGeneralConfig.php
7335 lines (6978 loc) · 205 KB
/
GeneralConfig.php
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
/**
* @link https://craftcms.com/
* @copyright Copyright (c) Pixel & Tonic, Inc.
* @license https://craftcms.github.io/license/
*/
namespace craft\config;
use Closure;
use Craft;
use craft\attributes\EnvName;
use craft\helpers\ConfigHelper;
use craft\helpers\DateTimeHelper;
use craft\helpers\Localization;
use craft\helpers\StringHelper;
use craft\services\Config;
use DateInterval;
use yii\base\InvalidArgumentException;
use yii\base\InvalidConfigException;
use yii\base\UnknownPropertyException;
/**
* General config class
*
* @author Pixel & Tonic, Inc. <[email protected]>
* @since 3.0.0
*/
class GeneralConfig extends BaseConfig
{
public const IMAGE_DRIVER_AUTO = 'auto';
public const IMAGE_DRIVER_GD = 'gd';
public const IMAGE_DRIVER_IMAGICK = 'imagick';
/**
* @since 3.6.0
*/
public const CAMEL_CASE = 'camel';
/**
* @since 3.6.0
*/
public const PASCAL_CASE = 'pascal';
/**
* @since 3.6.0
*/
public const SNAKE_CASE = 'snake';
/**
* @inerhitdoc
*/
protected static array $renamedSettings = [
'activateAccountFailurePath' => 'invalidUserTokenPath',
'allowAutoUpdates' => 'allowUpdates',
'backupDbOnUpdate' => 'backupOnUpdate',
'defaultFilePermissions' => 'defaultFileMode',
'defaultFolderPermissions' => 'defaultDirMode',
'enableGraphQlCaching' => 'enableGraphqlCaching',
'environmentVariables' => 'aliases',
'isSystemOn' => 'isSystemLive',
'restoreDbOnUpdateFailure' => 'restoreOnUpdateFailure',
'useWriteFileLock' => 'useFileLocks',
'validationKey' => 'securityKey',
];
/**
* @inheritdoc
*/
protected ?string $filename = Config::CATEGORY_GENERAL;
/**
* @var array The default user accessibility preferences that should be applied to users that haven’t saved their preferences yet.
*
* The array can contain the following keys:
*
* - `alwaysShowFocusRings` - Whether focus rings should always be shown when an element has focus.
* - `useShapes` – Whether shapes should be used to represent statuses.
* - `underlineLinks` – Whether links should be underlined.
* - `notificationDuration` – How long notifications should be shown before they disappear automatically (in
* milliseconds). Set to `0` to show them indefinitely.
*
* ```php
* ->accessibilityDefaults([
* 'useShapes' => true,
* ])
* ```
*
* @group System
* @since 3.6.4
*/
public array $accessibilityDefaults = [
'alwaysShowFocusRings' => false,
'useShapes' => false,
'underlineLinks' => false,
'disableAutofocus' => false,
'notificationDuration' => 5000,
];
/**
* @var string The URI segment Craft should look for when determining if the current request should be routed to a controller action.
*
* ::: code
* ```php Static Config
* ->actionTrigger('do-it')
* ```
* ```shell Environment Override
* CRAFT_ACTION_TRIGGER=do-it
* ```
* :::
*
* @group Routing
*/
public string $actionTrigger = 'actions';
/**
* @var mixed The URI that users without access to the control panel should be redirected to after activating their account.
*
* See [[ConfigHelper::localizedValue()]] for a list of supported value types.
*
* ::: code
* ```php Static Config
* ->activateAccountSuccessPath('welcome')
* ```
* ```shell Environment Override
* CRAFT_ACTIVATE_ACCOUNT_SUCCESS_PATH=welcome
* ```
* :::
*
* @see getActivateAccountSuccessPath()
* @group Routing
*/
public mixed $activateAccountSuccessPath = '';
/**
* @var bool Whether auto-generated URLs should have trailing slashes.
*
* ::: code
* ```php Static Config
* ->addTrailingSlashesToUrls(true)
* ```
* ```shell Environment Override
* CRAFT_ADD_TRAILING_SLASHES_TO_URLS=true
* ```
* :::
*
* @group Routing
*/
public bool $addTrailingSlashesToUrls = false;
/**
* @var array<string,string|null> Any custom Yii [aliases](https://www.yiiframework.com/doc/guide/2.0/en/concept-aliases) that should be defined for every request.
*
* ```php Static Config
* ->aliases([
* '@webroot' => '/var/www/',
* ])
* ```
*
* @group Environment
*/
public array $aliases = [];
/**
* @var bool Whether admins should be allowed to make administrative changes to the system.
*
* When this is disabled, the Settings section will be hidden, the Craft edition and Craft/plugin versions will be locked,
* and the project config and Plugin Store will become read-only—though Craft and plugin licenses may still be purchased.
*
* It’s best to disable this in production environments with a deployment workflow that runs `composer install` and
* [propagates project config updates](../project-config.md#propagating-changes) on deploy.
*
* ::: warning
* Don’t disable this setting until **all** environments have been updated to Craft 3.1.0 or later.
* :::
*
* ::: code
* ```php Static Config
* ->allowAdminChanges(false)
* ```
* ```shell Environment Override
* CRAFT_ALLOW_ADMIN_CHANGES=false
* ```
* :::
*
* @group System
* @since 3.1.0
*/
public bool $allowAdminChanges = true;
/**
* @var string[]|null|false The Ajax origins that should be allowed to access the GraphQL API, if enabled.
*
* If this is set to an array, then `graphql/api` requests will only include the current request’s [[\yii\web\Request::getOrigin()|origin]]
* in the `Access-Control-Allow-Origin` response header if it’s listed here.
*
* If this is set to `false`, then the `Access-Control-Allow-Origin` response header will never be sent.
*
* ::: code
* ```php Static Config
* ->allowedGraphqlOrigins(false)
* ```
* ```shell Environment Override
* CRAFT_ALLOW_GRAPHQL_ORIGINS=false
* ```
* :::
*
* @group GraphQL
* @since 3.5.0
* @deprecated in 4.11.0. [[\craft\filters\Cors]] should be used instead.
* @see https://www.yiiframework.com/doc/api/2.0/yii-filters-cors
*/
public array|null|false $allowedGraphqlOrigins = null;
/**
* @var bool Whether Craft should allow system and plugin updates in the control panel, and plugin installation from the Plugin Store.
*
* This setting will automatically be disabled if <config5:allowAdminChanges> is disabled.
*
* ::: code
* ```php Static Config
* ->allowUpdates(false)
* ```
* ```shell Environment Override
* CRAFT_ALLOW_UPDATES=false
* ```
* :::
*
* @group System
*/
public bool $allowUpdates = true;
/**
* @var string[] The file extensions Craft should allow when a user is uploading files.
*
* ```php Static Config
* // Nothing bug GIFs!
* ->allowedFileExtensions([
* 'gif',
* ])
* ```
*
* @see extraAllowedFileExtensions
* @group Assets
*/
public array $allowedFileExtensions = [
'7z',
'aiff',
'asc',
'asf',
'avi',
'avif',
'bmp',
'cap',
'cin',
'csv',
'dfxp',
'doc',
'docx',
'dotm',
'dotx',
'fla',
'flv',
'gif',
'gz',
'gzip',
'heic',
'heif',
'hevc',
'itt',
'jp2',
'jpeg',
'jpg',
'jpx',
'js',
'json',
'lrc',
'm2t',
'm4a',
'm4v',
'mcc',
'mid',
'mov',
'mp3',
'mp4',
'mpc',
'mpeg',
'mpg',
'mpsub',
'ods',
'odt',
'ogg',
'ogv',
'pdf',
'png',
'potx',
'pps',
'ppsm',
'ppsx',
'ppt',
'pptm',
'pptx',
'ppz',
'pxd',
'qt',
'ram',
'rar',
'rm',
'rmi',
'rmvb',
'rt',
'rtf',
'sami',
'sbv',
'scc',
'sdc',
'sitd',
'smi',
'srt',
'stl',
'sub',
'svg',
'swf',
'sxc',
'sxw',
'tar',
'tds',
'tgz',
'tif',
'tiff',
'ttml',
'txt',
'vob',
'vsd',
'vtt',
'wav',
'webm',
'webp',
'wma',
'wmv',
'xls',
'xlsx',
'zip',
];
/**
* @var bool Whether users should be allowed to create similarly-named tags.
*
* ::: code
* ```php Static Config
* ->allowSimilarTags(true)
* ```
* ```shell Environment Override
* CRAFT_ALLOW_SIMILAR_TAGS=true
* ```
* :::
*
* @group System
*/
public bool $allowSimilarTags = false;
/**
* @var bool Whether uppercase letters should be allowed in slugs.
*
* ::: code
* ```php Static Config
* ->allowUppercaseInSlug(true)
* ```
* ```shell Environment Override
* CRAFT_ALLOW_UPPERCASE_IN_SLUG=true
* ```
* :::
*
* @group Routing
*/
public bool $allowUppercaseInSlug = false;
/**
* @var bool Whether users should automatically be logged in after activating their account or resetting their password.
*
* ::: code
* ```php Static Config
* ->autoLoginAfterAccountActivation(true)
* ```
* ```shell Environment Override
* CRAFT_ALLOW_AUTO_LOGIN_AFTER_ACCOUNT_ACTIVATION=true
* ```
* :::
*
* @group System
*/
public bool $autoLoginAfterAccountActivation = false;
/**
* @var bool Whether drafts should be saved automatically as they are edited.
*
* Note that drafts *will* be autosaved while Live Preview is open, regardless of this setting.
*
* ::: code
* ```shell Environment Override
* CRAFT_AUTOSAVE_DRAFTS=false
* ```
* :::
*
* @group System
* @since 3.5.6
* @deprecated in 4.0.0
*/
public bool $autosaveDrafts = true;
/**
* @var bool Whether Craft should create a database backup before applying a new system update.
*
* ::: code
* ```php Static Config
* ->backupOnUpdate(false)
* ```
* ```shell Environment Override
* CRAFT_BACKUP_ON_UPDATE=false
* ```
* :::
*
* @see backupCommand
* @group System
*/
public bool $backupOnUpdate = true;
/**
* @var string|null|false|Closure The shell command that Craft should execute to create a database backup.
*
* When set to `null` (default), Craft will run `mysqldump` or `pg_dump`, provided that those libraries are in the `$PATH` variable
* for the system user running the web server.
*
* You may provide your own command, which can include several tokens Craft will substitute at runtime:
*
* - `{file}` - the target backup file path
* - `{port}` - the current database port
* - `{server}` - the current database hostname
* - `{user}` - user that was used to connect to the database
* - `{password}` - password for the specified `{user}`
* - `{database}` - the current database name
* - `{schema}` - the current database schema (if any)
*
* This can also be set to `false` to disable database backups completely.
*
* ::: code
* ```php Static Config
* ->backupCommand(false)
* ```
* ```shell Environment Override
* CRAFT_BACKUP_COMMAND=false
* ```
* :::
*
* @group Environment
*/
public string|null|false|Closure $backupCommand = null;
/**
* @var string|null The output format that database backups should use (PostgreSQL only).
*
* This setting has no effect with MySQL databases.
*
* Valid options are `custom`, `directory`, `tar`, or `plain`.
* When set to `null` (default), `pg_restore` will default to `plain`
* @see https://www.postgresql.org/docs/current/app-pgdump.html
*
* ::: code
* ```php Static Config
* ->backupCommandFormat('custom')
* ```
* ```shell Environment Override
* CRAFT_BACKUP_COMMAND_FORMAT=custom
* ```
* :::
*
* @group Environment
* @since 5.1.0
*/
public ?string $backupCommandFormat = null;
/**
* @var string|null The base URL Craft should use when generating control panel URLs.
*
* It will be determined automatically if left blank.
*
* ::: tip
* The base control panel URL should **not** include the [control panel trigger word](config5:cpTrigger) (e.g. `/admin`).
* :::
*
* ::: code
* ```php Static Config
* ->baseCpUrl('https://cms.my-project.tld/')
* ```
* ```shell Environment Override
* CRAFT_BASE_CP_URL=https://cms.my-project.tld/
* ```
* :::
*
* @group Routing
*/
public ?string $baseCpUrl = null;
/**
* @var int The higher the cost value, the longer it takes to generate a password hash and to verify against it.
*
* Therefore, higher cost slows down a brute-force attack.
*
* For best protection against brute force attacks, set it to the highest value that is tolerable on production servers.
*
* The time taken to compute the hash doubles for every increment by one for this value.
*
* For example, if the hash takes 1 second to compute when the value is 14 then the compute time varies as
* 2^(value - 14) seconds.
*
* ::: code
* ```php Static Config
* ->blowfishHashCost(15)
* ```
* ```shell Environment Override
* CRAFT_BLOWFISH_HASH_COST=15
* ```
* :::
*
* @group Security
*/
public int $blowfishHashCost = 13;
/**
* @var string|null The server path to an image file that should be sent when responding to an image request with a
* 404 status code.
*
* This can be set to an aliased path such as `@webroot/assets/404.svg`.
*
* ::: code
* ```php Static Config
* ->brokenImagePath('@webroot/assets/404.svg')
* ```
* ```shell Environment Override
* CRAFT_BROKEN_IMAGE_PATH=@webroot/assets/404.svg
* ```
* :::
*
* @group Image Handling
* @since 3.5.0
*/
public ?string $brokenImagePath = null;
/**
* @var string|null A unique ID representing the current build of the codebase.
*
* This should be set to something unique to the deployment, e.g. a Git SHA or a deployment timestamp.
*
* ::: code
* ```php Static Config
* ->buildId(\craft\helpers\App::env('GIT_SHA'))
* ```
* ```shell Environment Override
* CRAFT_BUILD_ID=$GIT_SHA
* ```
* :::
*
* @group Environment
* @since 4.0.0
*/
public ?string $buildId = null;
/**
* @var mixed The default length of time Craft will store data, RSS feed, and template caches.
*
* If set to `0`, data and RSS feed caches will be stored indefinitely.
*
* See [[ConfigHelper::durationInSeconds()]] for a list of supported value types.
*
* ::: code
* ```php Static Config
* ->cacheDuration(0)
* ```
* ```shell Environment Override
* CRAFT_CACHE_DURATION=0
* ```
* :::
*
* @group System
* @defaultAlt 1 day
*/
public mixed $cacheDuration = 86400;
/**
* @var bool Whether uploaded filenames with non-ASCII characters should be converted to ASCII (i.e. `ñ` → `n`).
*
* ::: tip
* You can run `php craft utils/ascii-filenames` in your terminal to apply ASCII filenames to all existing assets.
* :::
*
* ::: code
* ```php Static Config
* ->convertFilenamesToAscii(false)
* ```
* ```shell Environment Override
* CRAFT_CONVERT_FILENAMES_TO_ASCII=false
* ```
* :::
*
* @group Assets
*/
public bool $convertFilenamesToAscii = false;
/**
* @var mixed The amount of time a user must wait before re-attempting to log in after their account is locked due to too many
* failed login attempts.
*
* Set to `0` to keep the account locked indefinitely, requiring an admin to manually unlock the account.
*
* See [[ConfigHelper::durationInSeconds()]] for a list of supported value types.
*
* ::: code
* ```php Static Config
* ->cooldownDuration(0)
* ```
* ```shell Environment Override
* CRAFT_COOLDOWN_DURATION=0
* ```
* :::
*
* @group Security
* @defaultAlt 5 minutes
*/
public mixed $cooldownDuration = 300;
/**
* @var array List of additional HTML tags that should be included in the `<head>` of control panel pages.
*
* Each tag can be specified as an array of the tag name and its attributes.
*
* For example, you can give the control panel a custom favicon (etc.) like this:
*
* ```php Static Config
* ->cpHeadTags([
* // Traditional favicon
* ['link', ['rel' => 'icon', 'href' => '/icons/favicon.ico']],
* // Scalable favicon for browsers that support them
* ['link', ['rel' => 'icon', 'type' => 'image/svg+xml', 'sizes' => 'any', 'href' => '/icons/favicon.svg']],
* // Touch icon for mobile devices
* ['link', ['rel' => 'apple-touch-icon', 'sizes' => '180x180', 'href' => '/icons/touch-icon.svg']],
* // Pinned tab icon for Safari
* ['link', ['rel' => 'mask-icon', 'href' => '/icons/mask-icon.svg', 'color' => '#663399']],
* ])
* ```
*
* @group System
* @since 3.5.0
*/
public array $cpHeadTags = [];
/**
* @var string|null The URI segment Craft should look for when determining if the current request should route to the control panel rather than
* the front-end website.
*
* This can be set to `null` if you have a dedicated hostname for the control panel (e.g. `cms.my-project.tld`), or you are running Craft in
* [Headless Mode](config5:headlessMode). If you do that, you will need to ensure that the control panel is being served from its own web root
* directory on your server, with an `index.php` file that defines the `CRAFT_CP` PHP constant.
*
* ```php
* define('CRAFT_CP', true);
* ```
*
* Alternatively, you can set the <config5:baseCpUrl> config setting, but then you will run the risk of losing access to portions of your
* control panel due to URI conflicts with actual folders/files in your main web root.
*
* (For example, if you have an `assets/` folder, that would conflict with the `/assets` page in the control panel.)
*
* ::: code
* ```php Static Config
* ->cpTrigger(null)
* ```
* ```shell Environment Override
* CRAFT_CP_TRIGGER=
* ```
* :::
*
* @group Routing
*/
public ?string $cpTrigger = 'admin';
/**
* @var string The name of CSRF token used for CSRF validation if <config5:enableCsrfProtection> is set to `true`.
*
* ::: code
* ```php Static Config
* ->csrfTokenName('MY_CSRF')
* ```
* ```shell Environment Override
* CRAFT_CSRF_TOKEN_NAME=MY_CSRF
* ```
* :::
*
* @group Security
* @see enableCsrfProtection
*/
public string $csrfTokenName = 'CRAFT_CSRF_TOKEN';
/**
* @var string The domain that cookies generated by Craft should be created for. If blank, it will be left up to the browser to determine
* which domain to use (almost always the current). If you want the cookies to work for all subdomains, for example, you could
* set this to `'.my-project.tld'`.
*
* ::: code
* ```php Static Config
* ->defaultCookieDomain('.my-project.tld')
* ```
* ```shell Environment Override
* CRAFT_DEFAULT_COOKIE_DOMAIN=.my-project.tld
* ```
* :::
*
* @group Environment
*/
public string $defaultCookieDomain = '';
/**
* @var string The two-letter country code that addresses will be set to by default.
*
* See <https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2> for a list of acceptable country codes.
*
* ::: code
* ```php Static Config
* ->defaultCountryCode('GB')
* ```
* ```shell Environment Override
* CRAFT_DEFAULT_COUNTRY_CODE=GB
* ```
* :::
*
* @group System
* @since 4.5.0
*/
public string $defaultCountryCode = 'US';
/**
* @var string|null The default language the control panel should use for users who haven’t set a preferred language yet.
*
* ::: code
* ```php Static Config
* ->defaultCpLanguage('en-US')
* ```
* ```shell Environment Override
* CRAFT_DEFAULT_CP_LANGUAGE=en-US
* ```
* :::
*
* @group System
*/
public ?string $defaultCpLanguage = null;
/**
* @var string|null The default locale the control panel should use for date/number formatting, for users who haven’t set
* a preferred language or formatting locale.
*
* If this is `null`, the <config5:defaultCpLanguage> config setting will determine which locale is used for date/number formatting by default.
*
* ::: code
* ```php Static Config
* ->defaultCpLocale('en-US')
* ```
* ```shell Environment Override
* CRAFT_DEFAULT_CP_LOCALE=en-US
* ```
* :::
*
* @group System
* @since 3.5.0
*/
public ?string $defaultCpLocale = null;
/**
* @var mixed The default permission to be set for newly-generated directories.
*
* If set to `null`, the permission will be determined by the current environment.
*
* ::: code
* ```php Static Config
* ->defaultDirMode(0744)
* ```
* ```shell Environment Override
* CRAFT_DEFAULT_DIR_MODE=0744
* ```
* :::
*
* @group System
*/
public mixed $defaultDirMode = 0775;
/**
* @var int|null The default permission to be set for newly-generated files.
*
* If set to `null`, the permission will be determined by the current environment.
*
* ::: code
* ```php Static Config
* ->defaultFileMode(0744)
* ```
* ```shell Environment Override
* CRAFT_DEFAULT_FILE_MODE=0744
* ```
* :::
*
* @group System
*/
public ?int $defaultFileMode = null;
/**
* @var int The quality level Craft will use when saving JPG and PNG files. Ranges from 1 (worst quality, smallest file) to
* 100 (best quality, biggest file).
*
* ::: code
* ```php Static Config
* ->defaultImageQuality(90)
* ```
* ```shell Environment Override
* CRAFT_DEFAULT_IMAGE_QUALITY=90
* ```
* :::
*
* @group Image Handling
*/
public int $defaultImageQuality = 82;
/**
* @var array The default options that should be applied to each search term.
*
* Options include:
*
* - `subLeft` – Whether to include keywords that contain the term, with additional characters before it. (`false` by default)
* - `subRight` – Whether to include keywords that contain the term, with additional characters after it. (`true` by default)
* - `exclude` – Whether search results should *exclude* records with this term. (`false` by default)
* - `exact` – Whether the term must be an exact match (only applies if the search term specifies an attribute). (`false` by default)
*
* ```php Static Config
* ->defaultSearchTermOptions([
* 'subLeft' => true,
* 'exclude' => 'secret',
* ])
* ```
*
* @group System
*/
public array $defaultSearchTermOptions = [];
/**
* @var string[] The template file extensions Craft will look for when matching a template path to a file on the front end.
*
* ::: code
* ```php Static Config
* ->defaultTemplateExtensions(['twig', 'html', 'txt'])
* ```
* ```shell Environment Override
* CRAFT_DEFAULT_TEMPLATE_EXTENSIONS=twig,html,txt
* ```
* :::
*
* @group System
*/
public array $defaultTemplateExtensions = ['twig', 'html'];
/**
* @var mixed The default amount of time tokens can be used before expiring.
*
* See [[ConfigHelper::durationInSeconds()]] for a list of supported value types.
*
* ::: code
* ```php Static Config
* // One week
* ->defaultTokenDuration(604800)
* ```
* ```shell Environment Override
* # One week
* CRAFT_DEFAULT_TOKEN_DURATION=604800
* ```
* :::
*
* @group Security
* @defaultAlt 1 day
*/
public mixed $defaultTokenDuration = 86400;
/**
* @var int The default day new users should have set as their Week Start Day.
*
* This should be set to one of the following integers:
*
* - `0` – Sunday
* - `1` – Monday
* - `2` – Tuesday
* - `3` – Wednesday
* - `4` – Thursday
* - `5` – Friday
* - `6` – Saturday
*
* ::: code
* ```php Static Config
* ->defaultWeekStartDay(0)
* ```
* ```shell Environment Override
* CRAFT_DEFAULT_WEEK_START_DAY=0
* ```
* :::
*
* @group System
* @defaultAlt Monday
*/
public int $defaultWeekStartDay = 1;
/**
* @var bool By default, Craft requires a front-end “password” field for public user registrations. Setting this to
* `true` removes that requirement for the initial registration form. Instead, new users will set their password
* once they’ve followed the link in their activation email.
*
* ::: code
* ```php Static Config
* ->deferPublicRegistrationPassword(true)
* ```
* ```shell Environment Override
* CRAFT_DEFER_PUBLIC_REGISTRATION_PASSWORD=true
* ```
* :::
*
* @group Security
*/
public bool $deferPublicRegistrationPassword = false;
/**
* @var bool Whether the system should run in [Dev Mode](https://craftcms.com/support/dev-mode).
*
* ::: code
* ```php Static Config
* ->devMode(true)
* ```
* ```shell Environment Override
* CRAFT_DEV_MODE=true
* ```
* :::
*
* @group System
*/
public bool $devMode = false;
/**
* @var bool Whether two-step verification features should be disabled.
*
* ::: code
* ```php Static Config
* ->disable2fa()
* ```
* ```shell Environment Override
* CRAFT_DISABLE_2FA=true
* ```
* :::
*
* @group Users
* @since 5.6.0
*/
#[EnvName('DISABLE_2FA')]
public bool $disable2fa = false;
/**
* @var string[]|string|null Array of plugin handles that should be disabled, regardless of what the project config says.
*
* ```php
* ->disabledPlugins([
* 'webhooks',
* ])
* ```
*
* This can also be set to `'*'` to disable **all** plugins.
*
* ```php
* ->disabledPlugins('*')
* ```
*
* ::: warning
* This should not be set on a per-environment basis, as it could result in plugin schema version mismatches
* between environments, which will prevent project config changes from getting applied.
* :::
*
* ::: code
* ```php Static Config
* ->disabledPlugins([
* 'redactor',
* 'webhooks',
* ])
* ```
* ```shell Environment Override
* CRAFT_DISABLED_PLUGINS=redactor,webhooks
* ```
* :::
*
* @group System
* @since 3.1.9
*/
public string|array|null $disabledPlugins = null;