* master: (28 commits)
test against php 7.1
use the same db connection for reading and writing data
added tests classes for db related tests
refactored database tests
improved docs about using CORS with REST controllers
fixed scalar value for IN condition
guide section about comparing dates
added errorHandler, Request and Response getter
fixed tutorial about using yii 1 with yii 2
note about JOIN syntax
added note about varying source languages
Updated language packs zh-CN and ZH-TW
Fixes#8644: Fixed trying to ENABLE/DISABLE TRIGGER ALL on a view in PostgreSQL
Fixes#11549: Fixed `ArrayHelper::getValue()` to work properly with float keys
Unit test for #11549Fixes#11739: Fixed `ArrayHelper::index()` losing precision for float keys
Fix russian translation for Data widgets page (#11776) [skip ci]
Fixes#11774: Fixed incorrect recusuive symlinks check in FileHelper
Fixed non-translation block of text (#11765)
Fixes#10422, #9574: New proposal fix for ColumnSchemaBuilder not null column
...
Conflicts:
framework/web/User.php
> Note: Większość walidatorów nie obsługuje pustych pól, jeśli ich właściwość [[yii\validators\Validator::skipOnEmpty|skipOnEmpty] przyjmuje domyślnie wartość `true`.
> Note: Większość walidatorów nie obsługuje pustych pól, jeśli ich właściwość [[yii\validators\Validator::skipOnEmpty|skipOnEmpty]] przyjmuje domyślnie wartość `true`.
> Zostaną one po prostu pominięte podczas walidacji, jeśli ich powiązany atrybut otrzyma wartość uznawaną za pustą.
> Wśród [podstawowych walidatorów](tutorial-core-validators.md), tylko walidatory `captcha`, `default`, `filter`, `required` oraz `trim` obsługują puste pola.
Além do cache no servidor que nós descrevemos nas seções anteriores, aplicações Web pode também aproveitar-se
de cache no cliente para economizar o tempo na montagem e transmissão do mesmo conteúdo de uma página.
Para usar o cache no cliente, você poderá configurar [[yii\filters\HttpCache] como um filtro de ações de um controller ao qual o resultado de sua renderização possa ser armazenado em cache no navegador do cliente. A classe [[yii\filters\HttpCache|HttpCache]] funciona apenas para requisições `GET` e `HEAD`. Ele pode manipular três tipos de cache relacionados a cabeçalhos HTTP para estas requisições:
Para usar o cache no cliente, você poderá configurar [[yii\filters\HttpCache]] como um filtro de ações de um controller ao qual o resultado de sua renderização possa ser armazenado em cache no navegador do cliente. A classe [[yii\filters\HttpCache|HttpCache]] funciona apenas para requisições `GET` e `HEAD`. Ele pode manipular três tipos de cache relacionados a cabeçalhos HTTP para estas requisições:
@ -90,7 +90,7 @@ Por padrão, [[yii\data\ActiveDataProvider]] utiliza o componente da aplicação
O [[yii\data\SqlDataProvider]] trabalha com uma instrução SQL, que é usado para obter os dados necessários. Com base nas especificações de [[yii\data\SqlDataProvider::sort|sort]] e
[[yii\data\SqlDataProvider::pagination|pagination]], o provider ajustará as cláusulas `ORDER BY` e `LIMIT` da instrução SQL em conformidade para buscar somente a página de dados solicitada na ordem desejada.
Para usar [[yii\data\SqlDataProvider]], você deve especificar a propriedade [[yii\data\SqlDataProvider::sql|sql]] bem como a propriedade [[yii\data\SqlDataProvider::totalCount|totalCount]. Por exemplo:
Para usar [[yii\data\SqlDataProvider]], você deve especificar a propriedade [[yii\data\SqlDataProvider::sql|sql]] bem como a propriedade [[yii\data\SqlDataProvider::totalCount|totalCount]]. Por exemplo:
Цели логов выгружают отфильтрованные сообщения в определенном формате. Например, цель классна [[yii\log\FileTarget]] сохранит сообщение следующего формата в файле `runtime/log/app.log`:
Цели логов выгружают отфильтрованные сообщения в определенном формате. Например, цель класса [[yii\log\FileTarget]] сохранит сообщение следующего формата в файле `runtime/log/app.log`:
> Note: При настроенном суффиксе, все URL не содержащие этот суффикс будут расценены как неизвестные URL. Такое поведение рекомендовано для SEO (поисковая оптимизация).
Иногда возникает необходимость использовать разные суффиксы для разных URL. Добиться этого можно настройкой свойства [[yii\web\UrlRule::suffix|suffix]] у каждого правила. Когда это свойство установлено, оно имеет приоритет перед общей конфигурацией компонента [[yii\web\UrlManager|URL manager]]. Например, Следующая конфигурация содержит правило URL, `.json` as its suffix instead of the global one`.html`.
Иногда возникает необходимость использовать разные суффиксы для разных URL. Добиться этого можно настройкой свойства [[yii\web\UrlRule::suffix|suffix]] у каждого правила. Когда это свойство установлено, оно имеет приоритет перед общей конфигурацией компонента [[yii\web\UrlManager|URL manager]]. Например, cледующая конфигурация содержит правило URL, которое использует `.json` в качестве суффикса вместо глобального`.html`.
`Connection`组件支持从服务器的负载均衡和故障转移,当第一次执行读查询时,会随即选择一个从服务器进行连接,如果连接失败则又选择另一个,如果所有从服务器都不可用,则会连接主服务器。你可以配置[[yii\db\Connection::serverStatusCache|server status cache]]来记住那些不能连接的从服务器,使Yii 在一段时间[[yii\db\Connection::serverRetryInterval].内不会重复尝试连接那些根本不可用的从服务器.
`Connection`组件支持从服务器的负载均衡和故障转移,当第一次执行读查询时,会随即选择一个从服务器进行连接,如果连接失败则又选择另一个,如果所有从服务器都不可用,则会连接主服务器。你可以配置[[yii\db\Connection::serverStatusCache|server status cache]]来记住那些不能连接的从服务器,使Yii 在一段时间[[yii\db\Connection::serverRetryInterval]].内不会重复尝试连接那些根本不可用的从服务器.
The Cors filtering could be tuned using the `cors` property.
Also check the section on [REST Controllers](rest-controllers.md#cors) if you want to add the CORS filter to an
[[yii\rest\ActiveController]] class in your API.
The Cors filtering could be tuned using the [[yii\filters\Cors::$cors|$cors]] property.
* `cors['Origin']`: array used to define allowed origins. Can be `['*']` (everyone) or `['http://www.myserver.net', 'http://www.myotherserver.com']`. Default to `['*']`.
* `cors['Access-Control-Request-Method']`: array of allowed verbs like `['GET', 'OPTIONS', 'HEAD']`. Default to `['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS']`.
The message translation service translates a text message from one language (usually the [[yii\base\Application::$sourceLanguage|source language]])
@ -631,7 +634,7 @@ If [[yii\i18n\MissingTranslationEvent::translatedMessage]] is set by the event h
### Using the `message` command <aname="message-command"></a>
Translations can be stored in [[yii\i18n\PhpMessageSource|php files]], [[yii\i18n\GettextMessageSource|.po files] or to [[yii\i18n\DbMessageSource|database]]. See specific classes for additional options.
Translations can be stored in [[yii\i18n\PhpMessageSource|php files]], [[yii\i18n\GettextMessageSource|.po files]] or in a [[yii\i18n\DbMessageSource|database]]. See specific classes for additional options.
First of all you need to create a configuration file. Decide where you want to store it and then issue the command
'{attribute} "{value}" has already been taken.' => '{attribute} "{value}" daha önce alınmış.',
'{attribute} cannot be blank.' => '{attribute} boş bırakılamaz.',
'{attribute} contains wrong subnet mask.' => '{attribute} yanlış alt ağ maskesi içeriyor.',
'{attribute} is invalid.' => '{attribute} geçersiz.',
'{attribute} is not a valid URL.' => '{attribute} geçerli bir URL değil.',
'{attribute} is not a valid email address.' => '{attribute} geçerli bir mail adresi değil.',
'{attribute} is not in the allowed range.' => '{attribute} izin verilen aralıkta değil.',
'{attribute} must be "{requiredValue}".' => '{attribute} {requiredValue} olmalı.',
'{attribute} must be a number.' => '{attribute} sayı olmalı.',
'{attribute} must be a string.' => '{attribute} harf olmalı.',
'{attribute} must be a valid IP address.' => '{attribute} geçerli bir IP adresi değil.',
'{attribute} must be an IP address with specified subnet.' => '{attribute} IP adresi belirtilen alt ağ ile birlikte olmalı.',
'{attribute} must be an integer.' => '{attribute} rakam olmalı.',
'{attribute} must be either "{true}" or "{false}".' => '{attribute} yanlızca {true} yada {false} olabilir.',
'{attribute} must be greater than "{compareValue}".' => '{attribute}, "{compareValue}" den büyük olmalı.',
'{attribute} must be greater than or equal to "{compareValue}".' => '{attribute}, "{compareValue}" den büyük yada eşit olmalı.',
'{attribute} must be less than "{compareValue}".' => '{attribute}, "{compareValue}" den az olmalı.',
'{attribute} must be less than or equal to "{compareValue}".' => '{attribute}, "{compareValue}" den az yada eşit olmalı.',
'{attribute} must be no greater than {max}.' => '{attribute} {max} den büyük olmamalı.',
'{attribute} must be no less than {min}.' => '{attribute} {min} den küçük olmamalı.',
'{attribute} must be repeated exactly.' => '{attribute} aynı şekilde tekrarlanmalıdır.',
'{attribute} must not be equal to "{compareValue}".' => '{attribute}, "{compareValue}" ile eşit olmamalı',
'{attribute} must be either "{true}" or "{false}".' => '{attribute} "{true}" ya da "{false}" olmalı.',
'{attribute} must be equal to "{compareValueOrAttribute}".' => '{attribute} "{compareValueOrAttribute}" değerine eşit olmalı.',
'{attribute} must be greater than "{compareValueOrAttribute}".' => '{attribute} "{compareValueOrAttribute}" değerinden büyük olmalı.',
'{attribute} must be greater than or equal to "{compareValueOrAttribute}".' => '{attribute} "{compareValueOrAttribute}" değerinden büyük veya eşit olmalı.',
'{attribute} must be less than "{compareValueOrAttribute}".' => '{attribute} "{compareValueOrAttribute}" değerinden küçük olmalı.',
'{attribute} must be less than or equal to "{compareValueOrAttribute}".' => '{attribute} "{compareValueOrAttribute}" değerinden küçük veya eşit olmalı.',
'{attribute} must be no greater than {max}.' => '{attribute} {max} değerinden büyük olamaz.',
'{attribute} must be no less than {min}.' => '{attribute} {min} değerinden küçük olamaz.',
'{attribute} must not be a subnet.' => '{attribute} alt ağ olamaz.',
'{attribute} must not be an IPv4 address.' => '{attribute} IPv4 olamaz.',
'{attribute} must not be an IPv6 address.' => '{attribute} IPv6 olamaz.',
'{attribute} must not be equal to "{compareValueOrAttribute}".' => '{attribute} "{compareValueOrAttribute}" değerine eşit olamaz.',
'{attribute} should contain at least {min, number} {min, plural, one{character} other{characters}}.' => '{attribute} en az {min, number} karakter içermeli.',
'{attribute} should contain at most {max, number} {max, plural, one{character} other{characters}}.' => '{attribute} en fazla {max, number} karakter içermeli.',
'{attribute} should contain {length, number} {length, plural, one{character} other{characters}}.' => '{attribute} {length, number} karakter içermeli.',
'The file "{file}" is not an image.' => '文件 "{file}" 不是一个图像文件。',
'The file "{file}" is too big. Its size cannot exceed {formattedLimit}.' => '文件"{file}"太大了。它的大小不能超过{formattedLimit}。',
'The file "{file}" is too small. Its size cannot be smaller than {formattedLimit}.' => '文件"{file}"太小了。它的大小不能小于{formattedLimit}。',
'The file "{file}" is too big. Its size cannot exceed {limit, number} {limit, plural, one{byte} other{bytes}}.' => '文件"{file}"太大。它的大小不能超过{limit, number}字节。',
'The file "{file}" is too small. Its size cannot be smaller than {limit, number} {limit, plural, one{byte} other{bytes}}.' => '该文件"{file}"太小。它的大小不得小于{limit, number}字节。',
'The format of {attribute} is invalid.' => '属性 {attribute} 的格式无效。',
@ -45,6 +50,7 @@ return [
'The image "{file}" is too large. The width cannot be larger than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => '图像"{file}"太大。他的宽度不得超过{limit, number}像素。',
'The image "{file}" is too small. The height cannot be smaller than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => '图像"{file}"太小。他的高度不得小于{limit, number}像素。',
'The image "{file}" is too small. The width cannot be smaller than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => '图像"{file}"太小。他的宽度不得小于{limit, number}像素。',
'The requested view "{name}" was not found.' => '所请求的视图不存在"{name}"。',
'The verification code is incorrect.' => '验证码不正确。',
'The file "{file}" is not an image.' => '檔案 "{file}" 不是一個圖片檔案。',
'The file "{file}" is too big. Its size cannot exceed {formattedLimit}.' => '檔案"{file}"太大了。它的大小不可以超過{formattedLimit}。',
'The file "{file}" is too small. Its size cannot be smaller than {formattedLimit}.' => '文件"{file}"太小了。它的大小不可以小於{formattedLimit}。',
'The file "{file}" is too big. Its size cannot exceed {limit, number} {limit, plural, one{byte} other{bytes}}.' => '檔案 "{file}" 太大。它的大小不可以超過 {limit, number} 位元組。',
'The file "{file}" is too small. Its size cannot be smaller than {limit, number} {limit, plural, one{byte} other{bytes}}.' => '檔案 "{file}" 太小。它的大小不可以小於 {limit, number} 位元組。',
'The format of {attribute} is invalid.' => '屬性 {attribute} 的格式不正確。',
@ -45,6 +50,7 @@ return [
'The image "{file}" is too large. The width cannot be larger than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => '圖像 "{file}" 太大。它的寬度不可以超過 {limit, number} 像素。',
'The image "{file}" is too small. The height cannot be smaller than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => '圖像 "{file}" 太小。它的高度不可以小於 {limit, number} 像素。',
'The image "{file}" is too small. The width cannot be smaller than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => '圖像 "{file}" 太小。它的寬度不可以小於 {limit, number} 像素。',
'The requested view "{name}" was not found.' => '所請求的視圖不存在"{name}"。',
'The verification code is incorrect.' => '驗證碼不正確。',
@ -1024,6 +1024,7 @@ abstract class QueryBuilderTest extends DatabaseTestCase
[ ['in', 'id', (new Query())->select('id')->from('users')->where(['active' => 1])], '[[id]] IN (SELECT [[id]] FROM [[users]] WHERE [[active]]=:qp0)', [':qp0' => 1] ],
[ ['not in', 'id', (new Query())->select('id')->from('users')->where(['active' => 1])], '[[id]] NOT IN (SELECT [[id]] FROM [[users]] WHERE [[active]]=:qp0)', [':qp0' => 1] ],