-
Notifications
You must be signed in to change notification settings - Fork 611
/
CpAsset.php
706 lines (666 loc) · 25.3 KB
/
CpAsset.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
<?php
/**
* @link https://craftcms.com/
* @copyright Copyright (c) Pixel & Tonic, Inc.
* @license https://craftcms.github.io/license/
*/
namespace craft\web\assets\cp;
use Craft;
use craft\base\ElementInterface;
use craft\base\FieldInterface;
use craft\config\GeneralConfig;
use craft\elements\User;
use craft\enums\CmsEdition;
use craft\helpers\Assets;
use craft\helpers\Cp;
use craft\helpers\DateTimeHelper;
use craft\helpers\Html;
use craft\helpers\Json;
use craft\helpers\StringHelper;
use craft\helpers\UrlHelper;
use craft\i18n\Locale;
use craft\models\Section;
use craft\services\Sites;
use craft\validators\UserPasswordValidator;
use craft\web\AssetBundle;
use craft\web\assets\axios\AxiosAsset;
use craft\web\assets\d3\D3Asset;
use craft\web\assets\datepickeri18n\DatepickerI18nAsset;
use craft\web\assets\elementresizedetector\ElementResizeDetectorAsset;
use craft\web\assets\fabric\FabricAsset;
use craft\web\assets\fileupload\FileUploadAsset;
use craft\web\assets\garnish\GarnishAsset;
use craft\web\assets\iframeresizer\IframeResizerAsset;
use craft\web\assets\jquerypayment\JqueryPaymentAsset;
use craft\web\assets\jquerytouchevents\JqueryTouchEventsAsset;
use craft\web\assets\jqueryui\JqueryUiAsset;
use craft\web\assets\picturefill\PicturefillAsset;
use craft\web\assets\selectize\SelectizeAsset;
use craft\web\assets\tailwindreset\TailwindResetAsset;
use craft\web\assets\velocity\VelocityAsset;
use craft\web\assets\xregexp\XregexpAsset;
use craft\web\View;
use yii\web\JqueryAsset;
/**
* Asset bundle for the control panel
*/
class CpAsset extends AssetBundle
{
/**
* @inheritdoc
*/
public $sourcePath = __DIR__ . '/dist';
/**
* @inheritdoc
*/
public $depends = [
TailwindResetAsset::class,
AxiosAsset::class,
D3Asset::class,
ElementResizeDetectorAsset::class,
GarnishAsset::class,
JqueryAsset::class,
JqueryTouchEventsAsset::class,
JqueryUiAsset::class,
JqueryPaymentAsset::class,
DatepickerI18nAsset::class,
PicturefillAsset::class,
SelectizeAsset::class,
VelocityAsset::class,
FileUploadAsset::class,
XregexpAsset::class,
FabricAsset::class,
IframeResizerAsset::class,
];
/**
* @inheritdoc
*/
public $css = [
'css/cp.css',
];
/**
* @inheritdoc
*/
public $js = [
'cp.js',
];
/**
* @inheritdoc
*/
public function registerAssetFiles($view): void
{
parent::registerAssetFiles($view);
if ($view instanceof View) {
$this->_registerTranslations($view);
}
// Define the Craft object
$craftJson = Json::encode($this->_craftData());
$js = <<<JS
window.Craft = $craftJson;
JS;
$view->registerJs($js, View::POS_HEAD);
}
/**
* @param View $view
*/
private function _registerTranslations(View $view): void
{
$view->registerTranslations('app', [
'(blank)',
'<span class="visually-hidden">Characters left:</span> {chars, number}',
'A server error occurred.',
'Actions',
'Add',
'Add…',
'All',
'Announcements',
'Any changes will be lost if you leave this page.',
'Apply this to the {number} remaining conflicts?',
'Apply',
'Are you sure you want to close the editor? Any changes will be lost.',
'Are you sure you want to close this screen? Any changes will be lost.',
'Are you sure you want to delete this image?',
'Are you sure you want to delete “{name}”?',
'Are you sure you want to discard your changes?',
'Are you sure you want to transfer your license to this domain?',
'Ascending',
'Assets',
'Breadcrumbs',
'Buy {name}',
'Cancel',
'Change',
'Changes saved.',
'Check your email for instructions to reset your password.',
'Choose a page',
'Choose a user',
'Choose which sites this source should be visible for.',
'Choose which table columns should be visible for this source by default.',
'Choose which user groups should have access to this source.',
'Clear search',
'Clear',
'Close Preview',
'Close',
'Color hex value',
'Color picker',
'Content',
'Continue',
'Copied to clipboard.',
'Copy the URL',
'Copy the reference tag',
'Copy to clipboard',
'Could not save due to validation errors.',
'Couldn’t delete “{name}”.',
'Couldn’t reorder items.',
'Couldn’t save new order.',
'Create',
'Customize sources',
'Default Sort',
'Default Table Columns',
'Delete custom source',
'Delete folder',
'Delete heading',
'Delete their content',
'Delete them',
'Delete {num, plural, =1{user} other{users}} and content',
'Delete {num, plural, =1{user} other{users}}',
'Delete',
'Descending',
'Desktop',
'Device type',
'Discard changes',
'Discard',
'Display as thumbnails',
'Display in a structured table',
'Display in a table',
'Done',
'Don’t show in element cards',
'Don’t use for element thumbnails',
'Draft Name',
'Edit draft settings',
'Edit {type}',
'Edit',
'Edited',
'Element',
'Elements',
'Enabled for all sites',
'Enabled',
'Enter the name of the folder',
'Enter your password to log back in.',
'Error',
'Export Type',
'Export',
'Export…',
'Failed',
'Fields',
'Folder actions',
'Folder created.',
'Folder created.',
'Folder deleted.',
'Folder deleted.',
'Folder renamed.',
'Folder renamed.',
'Format',
'Found {num, number} {num, plural, =1{error} other{errors}} in this tab.',
'From {date}',
'From',
'Give your tab a name.',
'Handle',
'Heading',
'Height unit',
'Hide sidebar',
'Hide',
'Incorrect password.',
'Information',
'Instructions',
'Invalid email.',
'Invalid username or email.',
'Items reordered.',
'Keep both',
'Keep me signed in',
'Keep them',
'Label',
'Landscape',
'Level {num}',
'License transferred.',
'Limit',
'Loading',
'Make not required',
'Make optional',
'Make required',
'Merge the folder (any conflicting files will be replaced)',
'Missing or empty {items}',
'Missing {items}',
'Mobile',
'More info',
'More items',
'More',
'More…',
'Move backward',
'Move down',
'Move folder',
'Move forward',
'Move to the left',
'Move to the right',
'Move to',
'Move up',
'Move',
'Name',
'New category in the {group} category group',
'New category, choose a category group',
'New child',
'New custom source',
'New entry in the {section} section',
'New entry, choose a section',
'New field',
'New heading',
'New order saved.',
'New position saved.',
'New position saved.',
'New subfolder',
'New {group} category',
'New {section} entry',
'New {type}',
'Next Page',
'No limit',
'Notes',
'Notice',
'OK',
'Open in a new tab',
'Options',
'Password',
'Past year',
'Past {num} days',
'Pay {price}',
'Pending',
'Phone',
'Portrait',
'Preview file',
'Preview',
'Previewing {type} device in {orientation}',
'Previewing {type} device',
'Previous Page',
'Really delete folder “{folder}”?',
'Recent Activity',
'Refresh',
'Reload',
'Remove {label}',
'Remove',
'Rename folder',
'Rename',
'Reorder',
'Replace it',
'Replace the folder (all existing files will be deleted)',
'Required',
'Rotate',
'Row could not be added. Maximum number of rows reached.',
'Row could not be deleted. Minimum number of rows reached.',
'Save as a new asset',
'Save',
'Saved {timestamp} by {creator}',
'Saved {timestamp}',
'Saving',
'Score',
'Search in subfolders',
'Search',
'Select all',
'Select element',
'Select transform',
'Select {element}',
'Select',
'Settings',
'Show in element cards',
'Show nav',
'Show nested sources',
'Show sidebar',
'Show {title} children',
'Show',
'Show/hide children',
'Showing your unsaved changes.',
'Showing {first, number}-{last, number} of {total, number} {total, plural, =1{{item}} other{{items}}}',
'Showing {total, number} {total, plural, =1{{item}} other{{items}}}',
'Sign out now',
'Sites',
'Skip to {title}',
'Sort ascending',
'Sort attribute',
'Sort by',
'Sort descending',
'Sort direction',
'Source settings saved',
'Source settings',
'Source',
'Structure',
'Submit',
'Success',
'Switching sites will lose unsaved changes. Are you sure you want to switch sites?',
'Table Columns',
'Tablet',
'The draft could not be saved.',
'The draft has been saved.',
'The following {items} could not be found or are empty. Should they be deleted from the index?',
'The following {items} could not be found. Should they be deleted from the index?',
'This can be left blank if you just want an unlabeled separator.',
'This field has been modified.',
'This month',
'This tab is conditional',
'This week',
'This year',
'This {type} has been updated.',
'Tip',
'Title',
'To {date}',
'To',
'Today',
'Top of preview',
'Transfer it to:',
'Try again',
'Try another way',
'Undo',
'Unread announcements',
'Update {type}',
'Upload a file',
'Upload failed for “{filename}”.',
'Upload failed.',
'Upload files',
'Use defaults',
'Use for element thumbnails',
'User Groups',
'View in a new tab',
'View',
'Volume path',
'Warning',
'What do you want to do with their content?',
'What do you want to do?',
'Width unit',
'You must specify a tab name.',
'Your changes could not be stored.',
'Your changes have been stored.',
'Your session will expire in {time}.',
'by {creator}',
'category',
'day',
'days',
'draft',
'element',
'entry',
'files',
'folders',
'global set',
'hour',
'hours',
'minute',
'minutes',
'second',
'seconds',
'week',
'weeks',
'{ctrl}C to copy.',
'{element} pagination',
'{first, number}-{last, number} of {total, number} {total, plural, =1{{item}} other{{items}}}',
'{first}-{last} of {total}',
'{name} active, more info',
'{name} folder',
'{name} sorted by {attribute}, {direction}',
'{num, number} {num, plural, =1{Available Update} other{Available Updates}}',
'{num, number} {num, plural, =1{degree} other{degrees}}',
'{num, number} {num, plural, =1{notification} other{notifications}}',
'{pct} width',
'{total, number} {total, plural, =1{error} other{errors}} found in {num, number} {num, plural, =1{tab} other{tabs}}.',
'{total, number} {total, plural, =1{{item}} other{{items}}}',
'{totalItems, plural, =1{Item} other{Items}} moved.',
'{type} Criteria',
'{type} saved.',
'“{name}” deleted.',
]);
$view->registerTranslations('yii', [
'{attribute} should contain at least {min, number} {min, plural, one{character} other{characters}}.',
'{attribute} should contain at most {max, number} {max, plural, one{character} other{characters}}.',
]);
}
private function _craftData(): array
{
$upToDate = Craft::$app->getIsInstalled() && !Craft::$app->getUpdates()->getAreMigrationsPending();
$request = Craft::$app->getRequest();
$generalConfig = Craft::$app->getConfig()->getGeneral();
$sitesService = Craft::$app->getSites();
$formattingLocale = Craft::$app->getFormattingLocale();
$locale = Craft::$app->getLocale();
$orientation = $locale->getOrientation();
$userSession = Craft::$app->getUser();
$currentUser = $userSession->getIdentity();
$primarySite = $upToDate ? $sitesService->getPrimarySite() : null;
$data = [
'Pro' => CmsEdition::Pro->value,
'Team' => CmsEdition::Team->value,
'Solo' => CmsEdition::Solo->value,
'actionTrigger' => $generalConfig->actionTrigger,
'actionUrl' => UrlHelper::actionUrl(),
'announcements' => $upToDate ? Craft::$app->getAnnouncements()->get() : [],
'asciiCharMap' => StringHelper::asciiCharMap(true, Craft::$app->language),
'baseApiUrl' => Craft::$app->baseApiUrl,
'baseCpUrl' => UrlHelper::cpUrl(),
'baseSiteUrl' => UrlHelper::siteUrl(),
'baseUrl' => UrlHelper::url(),
'clientOs' => $request->getClientOs(),
'cpTrigger' => $generalConfig->cpTrigger,
'datepickerOptions' => $this->_datepickerOptions($formattingLocale, $locale, $currentUser, $generalConfig),
'defaultCookieOptions' => $this->_defaultCookieOptions(),
'fileKinds' => Assets::getFileKinds(),
'language' => Craft::$app->language,
'left' => $orientation === 'ltr' ? 'left' : 'right',
'maxPasswordLength' => UserPasswordValidator::MAX_PASSWORD_LENGTH,
'minPasswordLength' => UserPasswordValidator::MIN_PASSWORD_LENGTH,
'omitScriptNameInUrls' => $generalConfig->omitScriptNameInUrls,
'orientation' => $orientation,
'pageNum' => $request->getPageNum(),
'pageTrigger' => 'p',
'path' => $request->getPathInfo(),
'pathParam' => $generalConfig->pathParam,
'registeredAssetBundles' => [], // force encode as JS object
'registeredJsFiles' => [], // force encode as JS object
'resourceBaseUrl' => Craft::$app->getAssetManager()->baseUrl,
'right' => $orientation === 'ltr' ? 'right' : 'left',
'scriptName' => basename($request->getScriptFile()),
'systemUid' => Craft::$app->getSystemUid(),
'timepickerOptions' => $this->_timepickerOptions($formattingLocale, $orientation),
'timezone' => Craft::$app->getTimeZone(),
'tokenParam' => $generalConfig->tokenParam,
'translations' => ['' => ''], // force encode as JS object
'useEmailAsUsername' => $generalConfig->useEmailAsUsername,
'usePathInfo' => $generalConfig->usePathInfo,
];
if ($generalConfig->enableCsrfProtection) {
$data['csrfTokenName'] = $request->csrfParam;
$data['csrfTokenValue'] = $request->getCsrfToken();
}
// If no one's logged in yet, leave it at that
if (!$currentUser) {
return $data;
}
$elementTypeNames = [];
foreach (Craft::$app->getElements()->getAllElementTypes() as $elementType) {
/** @var string|ElementInterface $elementType */
/** @phpstan-var class-string<ElementInterface>|ElementInterface $elementType */
$elementTypeNames[$elementType] = [
$elementType::displayName(),
$elementType::pluralDisplayName(),
$elementType::lowerDisplayName(),
$elementType::pluralLowerDisplayName(),
];
}
$data += [
'allowAdminChanges' => $generalConfig->allowAdminChanges,
'allowUpdates' => $generalConfig->allowUpdates,
'allowUppercaseInSlug' => $generalConfig->allowUppercaseInSlug,
'apiParams' => Craft::$app->apiParams,
'appId' => Craft::$app->id,
'autofocusPreferred' => $currentUser->getAutofocusPreferred(),
'autosaveDrafts' => $generalConfig->autosaveDrafts,
'canAccessQueueManager' => $userSession->checkPermission('utility:queue-manager'),
'dataAttributes' => Html::$dataAttributes,
'defaultIndexCriteria' => [],
'disableAutofocus' => (bool)($currentUser->getPreference('disableAutofocus') ?? false),
'editableCategoryGroups' => $upToDate ? $this->_editableCategoryGroups() : [],
'edition' => Craft::$app->edition->value,
'elementTypeNames' => $elementTypeNames,
'elevatedSessionDuration' => $generalConfig->elevatedSessionDuration,
'fieldsWithoutContent' => array_map(fn(FieldInterface $field) => $field->handle, Craft::$app->getFields()->getFieldsWithoutContent(false)),
'handleCasing' => $generalConfig->handleCasing,
'httpProxy' => $this->_httpProxy($generalConfig),
'isImagick' => Craft::$app->getImages()->getIsImagick(),
'isMultiSite' => Craft::$app->getIsMultiSite(),
'limitAutoSlugsToAscii' => $generalConfig->limitAutoSlugsToAscii,
'maxUploadSize' => Assets::getMaxUploadSize(),
'notificationDuration' => (int)($currentUser->getPreference('notificationDuration') ?? 5000),
'previewIframeResizerOptions' => $this->_previewIframeResizerOptions($generalConfig),
'primarySiteId' => $primarySite ? (int)$primarySite->id : null,
'primarySiteLanguage' => $primarySite->language ?? null,
'publishableSections' => $upToDate ? $this->_publishableSections($currentUser) : [],
'remainingSessionTime' => !in_array($request->getSegment(1), ['updates', 'manualupdate'], true) ? $userSession->getRemainingSessionTime() : 0,
'runQueueAutomatically' => $generalConfig->runQueueAutomatically,
'siteId' => $upToDate ? (Cp::requestedSite()->id ?? $sitesService->getCurrentSite()->id) : null,
'sites' => $this->_sites($sitesService),
'siteToken' => $generalConfig->siteToken,
'slugWordSeparator' => $generalConfig->slugWordSeparator,
'userEmail' => $currentUser->email,
'userHasPasskeys' => Craft::$app->getAuth()->hasPasskeys($currentUser),
'userIsAdmin' => $currentUser->admin,
'username' => $currentUser->username,
];
return $data;
}
private function _datepickerOptions(Locale $formattingLocale, Locale $locale, ?User $currentUser, GeneralConfig $generalConfig): array
{
return [
'constrainInput' => false,
'dateFormat' => $formattingLocale->getDateFormat(Locale::LENGTH_SHORT, Locale::FORMAT_JUI),
'dayNames' => $locale->getWeekDayNames(Locale::LENGTH_FULL),
'dayNamesMin' => $locale->getWeekDayNames(Locale::LENGTH_ABBREVIATED),
'dayNamesShort' => $locale->getWeekDayNames(Locale::LENGTH_SHORT),
'firstDay' => DateTimeHelper::firstWeekDay(),
'monthNames' => $locale->getMonthNames(Locale::LENGTH_FULL),
'monthNamesShort' => $locale->getMonthNames(Locale::LENGTH_ABBREVIATED),
'nextText' => Craft::t('app', 'Next'),
'prevText' => Craft::t('app', 'Prev'),
];
}
private function _defaultCookieOptions(): array
{
$config = Craft::cookieConfig();
return [
'path' => $config['path'] ?? '/',
'domain' => $config['domain'] ?? null,
'secure' => $config['secure'] ?? false,
'sameSite' => $config['sameSite'] ?? 'strict',
];
}
private function _editableCategoryGroups(): array
{
$groups = [];
foreach (Craft::$app->getCategories()->getEditableGroups() as $group) {
$groups[] = [
'handle' => $group->handle,
'id' => (int)$group->id,
'name' => Craft::t('site', $group->name),
'uid' => $group->uid,
];
}
return $groups;
}
/**
* @param GeneralConfig $generalConfig
* @return array|null
*/
private function _httpProxy(GeneralConfig $generalConfig): ?array
{
if (!$generalConfig->httpProxy) {
return null;
}
$parsed = parse_url($generalConfig->httpProxy);
return array_filter([
'host' => $parsed['host'],
'port' => $parsed['port'] ?? strtolower($parsed['scheme']) === 'http' ? 80 : 443,
'auth' => array_filter([
'username' => $parsed['user'] ?? null,
'password' => $parsed['pass'] ?? null,
]),
'protocol' => $parsed['scheme'],
]);
}
/**
* @param GeneralConfig $generalConfig
* @return array|null|false
*/
private function _previewIframeResizerOptions(GeneralConfig $generalConfig): array|null|false
{
if (!$generalConfig->useIframeResizer) {
return false;
}
// Treat false as [] as well now that useIframeResizer exists
if (empty($generalConfig->previewIframeResizerOptions)) {
return null;
}
return $generalConfig->previewIframeResizerOptions;
}
private function _publishableSections(User $currentUser): array
{
$sections = [];
foreach (Craft::$app->getEntries()->getEditableSections() as $section) {
if ($section->type !== Section::TYPE_SINGLE && $currentUser->can("createEntries:$section->uid")) {
$sections[] = [
'entryTypes' => $this->_entryTypes($section),
'handle' => $section->handle,
'id' => (int)$section->id,
'name' => Craft::t('site', $section->name),
'sites' => $section->getSiteIds(),
'type' => $section->type,
'uid' => $section->uid,
'canSave' => $currentUser->can("saveEntries:$section->uid"),
];
}
}
return $sections;
}
private function _entryTypes(Section $section): array
{
$types = [];
foreach ($section->getEntryTypes() as $type) {
$types[] = [
'handle' => $type->handle,
'id' => (int)$type->id,
'name' => Craft::t('site', $type->name),
];
}
return $types;
}
private function _sites(Sites $sitesService): array
{
$sites = [];
foreach ($sitesService->getAllSites() as $site) {
$sites[] = [
'handle' => $site->handle,
'id' => (int)$site->id,
'uid' => (string)$site->uid,
'name' => Craft::t('site', $site->getName()),
];
}
return $sites;
}
private function _timepickerOptions(Locale $formattingLocale, string $orientation): array
{
// normalize the AM/PM names consistently with time2int() in jQuery Timepicker
$am = preg_replace('/[\s.]/', '', $formattingLocale->getAMName());
$pm = preg_replace('/[\s.]/', '', $formattingLocale->getPMName());
return [
'closeOnWindowScroll' => false,
'lang' => [
'AM' => $am,
'am' => mb_strtolower($am),
'PM' => $pm,
'pm' => mb_strtolower($pm),
],
'orientation' => $orientation[0],
'timeFormat' => $formattingLocale->getTimeFormat(Locale::LENGTH_SHORT, Locale::FORMAT_PHP),
];
}
}