Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync master branch to 2.2. #20024

Closed
wants to merge 92 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
60d0cbd
added pcntl to requirements check
schmunk42 Feb 27, 2023
2152c00
Fix #13920: Fixed erroneous validation for specific cases
tim-fischer-maschinensucher Jul 24, 2023
dcc0290
Fix #13920: Added my name to CHANGELOG.md
tim-fischer-maschinensucher Jul 24, 2023
ad3c2f5
Merge branch 'master' into 13920-validation-marks-valid-field-as-invalid
tim-fischer-maschinensucher Aug 10, 2023
c06b62e
Merge branch 'master' into 13920-validation-marks-valid-field-as-invalid
samdark Aug 18, 2023
cd774d7
Merge branch 'master' into 13920-validation-marks-valid-field-as-invalid
samdark Aug 26, 2023
b05ad49
trim(): Passing null to parameter #1 ($string) of type string is depr…
uaoleg Sep 11, 2023
5a48739
Merge branch 'master' into patch-2
bizley Sep 14, 2023
2995696
Added section about Unsafe Reflection in Security best practices doc …
zonia3000 Sep 19, 2023
7a260f7
Merge branch 'master' into patch-2
uaoleg Sep 19, 2023
fd5c1bb
Update CHANGELOG.md
uaoleg Sep 20, 2023
7ae255c
Merge pull request #19949 from uaoleg/patch-2
bizley Sep 20, 2023
18421ab
Fixed tests.
terabytesoftw Sep 20, 2023
81f3033
Merge pull request #19958 from terabytesoftw/fixed-tests
bizley Sep 20, 2023
9aac121
Fix #13920: Add unit test
tim-fischer-maschinensucher Sep 20, 2023
f0b970d
Merge branch 'master' into 13920-validation-marks-valid-field-as-invalid
tim-fischer-maschinensucher Sep 20, 2023
20a4b7e
Update `bower-asset/inputmask`, `bower-asset/punycode`.
terabytesoftw Sep 21, 2023
a32617e
Merge branch 'master' into feature/pcntl-req-check
schmunk42 Sep 21, 2023
eb2add3
added CHANGELOG line
schmunk42 Sep 21, 2023
33fde4b
Merge pull request #19780 from schmunk42/feature/pcntl-req-check
bizley Sep 22, 2023
a028baf
Fix order.
terabytesoftw Sep 22, 2023
7576761
Merge pull request #19963 from terabytesoftw/update-bower-inputmask-p…
bizley Sep 22, 2023
ae4399e
Merge branch 'master' into 13920-validation-marks-valid-field-as-invalid
tim-fischer-maschinensucher Sep 25, 2023
ced6d04
fix: #19978 - Mistake in Korean translation
Sep 26, 2023
17386c7
fix: keep doublequote
Sep 26, 2023
98c4bb8
Merge pull request #19982 from xicond/bugfix/19978-Mistake_in_Korean_…
bizley Sep 26, 2023
764926a
Do not duplicate log messages in memory
lubosdz Sep 28, 2023
7f3397a
Update framework/log/FileTarget.php
lubosdz Oct 1, 2023
75f37a7
Merge pull request #19984 from lubosdz/master
bizley Oct 2, 2023
aec8366
Update concept-di-container.md
Yur-ok Oct 4, 2023
cfd8c6b
Merge pull request #19989 from Yur-ok/patch-2
bizley Oct 4, 2023
48d754c
Update CHANGELOG.md
bizley Oct 5, 2023
4a1f2c6
release version 2.0.49.1
bizley Oct 5, 2023
290e03c
prepare for next release
bizley Oct 5, 2023
9f51fe3
Revert changes in `mimeTypes.php` from 4a1f2c6b9bc90427e91da73f5e8c8f…
rob006 Oct 6, 2023
53f1619
Merge pull request #19992 from rob006/mimeTypes-revert
bizley Oct 6, 2023
7665e56
update actions/checkout to v4
salehhashemi1992 Oct 7, 2023
bd296eb
Merge pull request #19997 from salehhashemi1992/ci/update-checkout-to-v4
bizley Oct 8, 2023
4addf02
Fix mime type generator
bizley Oct 8, 2023
0726714
Added note
bizley Oct 8, 2023
11d4b2c
Merge pull request #20000 from yiisoft/fix-mime-type-generator
bizley Oct 12, 2023
049e37c
Update structure-controllers.md (#20003)
Yur-ok Oct 12, 2023
33254d5
Update CHANGELOG.md
bizley Oct 12, 2023
4f17359
release version 2.0.49.2
bizley Oct 12, 2023
505fd5a
prepare for next release
bizley Oct 12, 2023
02ed808
New methods: BaseActiveRecord::loadRelations() and BaseActiveRecord::…
PowerGamer1 Jul 13, 2023
4fe40f9
Merge pull request #19893 from PowerGamer1/fix12743
bizley Oct 13, 2023
9875ae6
Fixed a bug where the yii serve command would break if a custom route…
angrybrad Oct 13, 2023
3014fa2
fix: #20002 optimize head request on serializeDataProvider
Oct 14, 2023
5a4c048
Merge pull request #20006 from angrybrad/master
bizley Oct 14, 2023
6ceb6f6
Fix `MaskedInputAsset::class`.
terabytesoftw Oct 15, 2023
87dea25
Merge branch 'master' into bugfix/20002-Superfluous_query_on_HEAD_req…
xicond Oct 16, 2023
961a952
Fix #19927: Fixed `console\controllers\MessageController` when saving…
atrandafir Oct 16, 2023
fe73d9c
Merge pull request #20009 from terabytesoftw/fix-maskedinputasset
bizley Oct 16, 2023
cba3a5e
Merge branch 'master' into 13920-validation-marks-valid-field-as-invalid
tim-fischer-maschinensucher Oct 17, 2023
4b423e4
Merge pull request #19909 from tim-fischer-maschinensucher/13920-vali…
bizley Oct 17, 2023
b9a30a8
feat: add HEAD unit test serializer
Oct 18, 2023
72e46e6
Merge branch 'master' into bugfix/20002-Superfluous_query_on_HEAD_req…
xicond Oct 18, 2023
4f2a7c5
Merge branch 'bugfix/20002-Superfluous_query_on_HEAD_request_in_seria…
Oct 18, 2023
5d8a96e
Added 'zh' into 'framework/messages/config.php' (#19995)
NabiKAZ Oct 18, 2023
c314feb
core: add changelog
Oct 18, 2023
a923481
Merge branch 'master' into bugfix/20002-Superfluous_query_on_HEAD_req…
xicond Oct 18, 2023
e11819d
fix: changelog
Oct 18, 2023
b469764
fix: changelog
Oct 18, 2023
344b0ae
core: add collectionEnvelope unit test
Oct 18, 2023
fd241de
Update the Persian translation file (#20016)
NabiKAZ Oct 19, 2023
e029988
Introduce createFormatter Static Method for Formatter Logic (#20014)
salehhashemi1992 Oct 19, 2023
f283868
Update framework/CHANGELOG.md
samdark Oct 19, 2023
833f335
Merge branch 'master' into bugfix/20002-Superfluous_query_on_HEAD_req…
samdark Oct 19, 2023
febbe0f
Use `self` to access private method in BaseFormatConverter
rob006 Oct 19, 2023
ace4a5b
fix: separate test Head Serialize DataProvider
Oct 20, 2023
75e5a08
Merge pull request #20018 from rob006/patch-1
bizley Oct 20, 2023
ce13f0f
refactor: cleanup SerializerTest
Oct 20, 2023
c1315b9
Merge branch 'master' into bugfix/20002-Superfluous_query_on_HEAD_req…
xicond Oct 20, 2023
04f5944
Merge pull request #20007 from xicond/bugfix/20002-Superfluous_query_…
bizley Oct 20, 2023
a4b5856
Fix typo in runtime-logging.md (#20019)
Yur-ok Oct 20, 2023
70a7282
Fix `yii server` and add tests.
terabytesoftw Oct 20, 2023
5eeb12f
Fix #19060: Fix `yii\widgets\Menu` bug when using Closure for active …
atrandafir Oct 20, 2023
39cf0a5
Merge branch 'master' into yii-serve-fix
terabytesoftw Oct 20, 2023
ecc6c61
Use `Mock` tests, after checking the real test.
terabytesoftw Oct 20, 2023
e726284
Fix php 5.
terabytesoftw Oct 20, 2023
c56bccd
Fix error typo.
terabytesoftw Oct 20, 2023
f8b49ce
Fix `getMockbuilder className()`.
terabytesoftw Oct 20, 2023
b748818
Merge branch 'master' into yii-serve-fix
terabytesoftw Oct 20, 2023
f58eb36
Remove `YII_ENV`.
terabytesoftw Oct 21, 2023
bee7f72
Add changelog line.
terabytesoftw Oct 21, 2023
bc56545
Merge pull request #20021 from terabytesoftw/yii-serve-fix
bizley Oct 21, 2023
5f3d36e
Extract messages (#20022)
rob006 Oct 21, 2023
088160a
Sync `master` branch to `2.2`.
terabytesoftw Oct 21, 2023
39499d8
Update tests for 2.2.
terabytesoftw Oct 21, 2023
341668c
Use `assertStringContainsString()` for `assertContains() `.
terabytesoftw Oct 21, 2023
b9859bf
Fix CHANGELOG.md`.
terabytesoftw Oct 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/guide-ru/runtime-logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ return [
Временная метка [IP-адрес][ID пользователя][ID сессии][Уровень важности][Категория] Текст сообщения
```

Этот формат может быть изменен при помощи свойства [[yii\log\Target::prefix]], которое получает анонимную функцию, возвращающую нужный префикс сообщения. Например, следующий код позволяет настроить вывод идентификатор текущего пользователя в качестве префикса для всех сообщений.
Этот формат может быть изменен при помощи свойства [[yii\log\Target::prefix]], которое получает анонимную функцию, возвращающую нужный префикс сообщения. Например, следующий код позволяет настроить вывод идентификатора текущего пользователя в качестве префикса для всех сообщений.

```php
[
Expand Down
3 changes: 3 additions & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ Yii Framework 2 Change Log
2.0.50 under development
------------------------

- Bug #20005: Fix `yii\console\controllers\ServeController` to specify the router script (terabytesoftw)
- Bug #19060: Fix `yii\widgets\Menu` bug when using Closure for active item and adding additional tests in `tests\framework\widgets\MenuTest` (atrandafir)
- Bug #13920: Fixed erroneous validation for specific cases (tim-fischer-maschinensucher)
- Bug #19927: Fixed `console\controllers\MessageController` when saving translations to database: fixed FK error when adding new string and language at the same time, checking/regenerating all missing messages and dropping messages for unused languages (atrandafir)
- Bug #20002: Fixed superfluous query on HEAD request in serializer (xicond)
- Enh #12743: Added new methods `BaseActiveRecord::loadRelations()` and `BaseActiveRecord::loadRelationsFor()` to eager load related models for existing primary model instances (PowerGamer1)


Expand Down
13 changes: 12 additions & 1 deletion framework/console/controllers/ServeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@ public function actionIndex($address = 'localhost')
}
$this->stdout("Quit the server with CTRL-C or COMMAND-C.\n");

passthru('"' . PHP_BINARY . '"' . " -S {$address} -t \"{$documentRoot}\" \"$router\"");
$command = '"' . PHP_BINARY . '"' . " -S {$address} -t \"{$documentRoot}\"";

if ($this->router !== null && $router !== '') {
$command .= " -r \"{$router}\"";
}

$this->runCommand($command);
}

/**
Expand Down Expand Up @@ -122,4 +128,9 @@ protected function isAddressTaken($address)
fclose($fp);
return true;
}

protected function runCommand($command)
{
passthru($command);
}
}
54 changes: 32 additions & 22 deletions framework/helpers/BaseFormatConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,13 @@ class BaseFormatConverter
* @param string|null $locale the locale to use for converting ICU short patterns `short`, `medium`, `long` and `full`.
* If not given, `Yii::$app->language` will be used.
* @return string The converted date format pattern.
* @throws \Exception
*/
public static function convertDateIcuToPhp($pattern, $type = 'date', $locale = null)
{
if (isset(self::$_icuShortFormats[$pattern])) {
if (extension_loaded('intl')) {
if ($locale === null) {
$locale = Yii::$app->language;
}
if ($type === 'date') {
$formatter = new IntlDateFormatter($locale, self::$_icuShortFormats[$pattern], IntlDateFormatter::NONE);
} elseif ($type === 'time') {
$formatter = new IntlDateFormatter($locale, IntlDateFormatter::NONE, self::$_icuShortFormats[$pattern]);
} else {
$formatter = new IntlDateFormatter($locale, self::$_icuShortFormats[$pattern], self::$_icuShortFormats[$pattern]);
}
$pattern = $formatter->getPattern();
$pattern = self::createFormatter($locale, $type, $pattern);
} else {
return static::$phpFallbackDatePatterns[$pattern][$type];
}
Expand Down Expand Up @@ -350,22 +341,13 @@ public static function convertDatePhpToIcu($pattern)
* @param string|null $locale the locale to use for converting ICU short patterns `short`, `medium`, `long` and `full`.
* If not given, `Yii::$app->language` will be used.
* @return string The converted date format pattern.
* @throws \Exception
*/
public static function convertDateIcuToJui($pattern, $type = 'date', $locale = null)
{
if (isset(self::$_icuShortFormats[$pattern])) {
if (extension_loaded('intl')) {
if ($locale === null) {
$locale = Yii::$app->language;
}
if ($type === 'date') {
$formatter = new IntlDateFormatter($locale, self::$_icuShortFormats[$pattern], IntlDateFormatter::NONE);
} elseif ($type === 'time') {
$formatter = new IntlDateFormatter($locale, IntlDateFormatter::NONE, self::$_icuShortFormats[$pattern]);
} else {
$formatter = new IntlDateFormatter($locale, self::$_icuShortFormats[$pattern], self::$_icuShortFormats[$pattern]);
}
$pattern = $formatter->getPattern();
$pattern = self::createFormatter($locale, $type, $pattern);
} else {
return static::$juiFallbackDatePatterns[$pattern][$type];
}
Expand Down Expand Up @@ -545,4 +527,32 @@ public static function convertDatePhpToJui($pattern)
'U' => '@', // Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
]);
}

/**
* Creates a date/time formatter based on the given parameters.
*
* @param string|null $locale The locale to be used. If null, the application's current language will be used.
* @param string $type The type of formatter ('date', 'time', etc.)
* @param string $pattern The pattern for the IntlDateFormatter.
*
* @return string The resulting pattern after formatter creation.
*
* @throws \Exception If the 'intl' extension is not loaded.
*/
private static function createFormatter($locale, $type, $pattern)
{
if ($locale === null) {
$locale = Yii::$app->language;
}

if ($type === 'date') {
$formatter = new IntlDateFormatter($locale, self::$_icuShortFormats[$pattern], IntlDateFormatter::NONE);
} elseif ($type === 'time') {
$formatter = new IntlDateFormatter($locale, IntlDateFormatter::NONE, self::$_icuShortFormats[$pattern]);
} else {
$formatter = new IntlDateFormatter($locale, self::$_icuShortFormats[$pattern], self::$_icuShortFormats[$pattern]);
}

return $formatter->getPattern();
}
}
8 changes: 5 additions & 3 deletions framework/messages/af/yii.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
' and ' => ' en ',
'"{attribute}" does not support operator "{operator}".' => '"{attribute}" ondersteun nie operateur "{operator}" nie.',
'(not set)' => '(nie gestel nie)',
'Action not found.' => '',
'Aliases available: {aliases}' => '',
'An internal server error occurred.' => '\'n Interne bediener fout het plaasgevind.',
'Are you sure you want to delete this item?' => 'Is jy seker jy wil hierdie item skrap?',
'Condition for "{attribute}" should be either a value or valid operator specification.' => 'Voorwaarde vir "{attribute}" moet óf \'n waarde, óf \'n geldige operateurspesifikasie wees.',
Expand All @@ -43,10 +45,10 @@
'Only files with these extensions are allowed: {extensions}.' => 'Slegs hierdie soort lêers word toegelaat: {extensions}.',
'Operator "{operator}" must be used with a search attribute.' => 'Operateur "{operator}" moet gebruik word met \'n soekkenmerk.',
'Operator "{operator}" requires multiple operands.' => 'Operateur "{operator}" vereis veelvuldige operande.',
'Options available: {options}' => '',
'Page not found.' => 'Bladsy nie gevind nie.',
'Please fix the following errors:' => 'Maak asseblief die volgende foute reg:',
'Please upload a file.' => 'Laai asseblief \'n lêer op.',
'Powered by {yii}' => 'Aangedryf deur {yii}',
'Showing <b>{begin, number}-{end, number}</b> of <b>{totalCount, number}</b> {totalCount, plural, one{item} other{items}}.' => '',
'The combination {values} of {attributes} has already been taken.' => 'Die kombinasie {values} van {attributes} is reeds geneem.',
'The file "{file}" is not an image.' => 'Die lêer "{file}" is nie \'n prent nie.',
Expand All @@ -68,7 +70,6 @@
'Update' => 'Opdateer',
'View' => 'Beskou',
'Yes' => 'Ja',
'Yii Framework' => 'Yii Raamwerk',
'You are not allowed to perform this action.' => 'Jy mag nie hierdie aksie uitvoer nie.',
'You can upload at most {limit, number} {limit, plural, one{file} other{files}}.' => 'Jy kan \'n maksimum van {limit, number} {limit, plural, one{lêer} other{lêers}} oplaai.',
'You should upload at least {limit, number} {limit, plural, one{file} other{files}}.' => 'Jy moet ten minste {limit, number} {limit, plural, one{lêer} other{lêers}} oplaai.',
Expand Down Expand Up @@ -108,6 +109,7 @@
'{attribute} should contain at least {min, number} {min, plural, one{character} other{characters}}.' => '{attribute} moet ten minste {min, number} {min, plural, one{karakter} other{karakters}} bevat.',
'{attribute} should contain at most {max, number} {max, plural, one{character} other{characters}}.' => '{attribute} moet hoogstens {max, number} {max, plural, one{karakter} other{karakters}} bevat.',
'{attribute} should contain {length, number} {length, plural, one{character} other{characters}}.' => '{attribute} moet {length, number} {length, plural, one{karakter} other{karakters}} bevat.',
'{compareAttribute} is invalid.' => '',
'{delta, plural, =1{1 day} other{# days}}' => '{delta, plural, =1{1 dag} other{# dae}}',
'{delta, plural, =1{1 hour} other{# hours}}' => '{delta} uur',
'{delta, plural, =1{1 minute} other{# minutes}}' => '{delta, plural, =1{1 minuut} other{# minute}}',
Expand All @@ -123,14 +125,14 @@
'{nFormatted} B' => '{nFormatted} B',
'{nFormatted} GB' => '{nFormatted} GB',
'{nFormatted} GiB' => '{nFormatted} GiB',
'{nFormatted} kB' => '{nFormatted} KB',
'{nFormatted} KiB' => '{nFormatted} KiB',
'{nFormatted} MB' => '{nFormatted} MB',
'{nFormatted} MiB' => '{nFormatted} MiB',
'{nFormatted} PB' => '{nFormatted} PB',
'{nFormatted} PiB' => '{nFormatted} PiB',
'{nFormatted} TB' => '{nFormatted} TB',
'{nFormatted} TiB' => '{nFormatted} TiB',
'{nFormatted} kB' => '{nFormatted} KB',
'{nFormatted} {n, plural, =1{byte} other{bytes}}' => '{nFormatted} {n, plural, =1{greep} other{grepe}}',
'{nFormatted} {n, plural, =1{gibibyte} other{gibibytes}}' => '{nFormatted} {n, plural, =1{gibigreep} other{gibigrepe}}',
'{nFormatted} {n, plural, =1{gigabyte} other{gigabytes}}' => '{nFormatted} {n, plural, =1{gigagreep} other{gigagrepe}}',
Expand Down
Loading