Browse Source

Merge branches '2.1' and 'master' of github.com:yiisoft/yii2 into 2.1

Conflicts:
	framework/base/Security.php
	framework/caching/ArrayCache.php
	framework/filters/RateLimiter.php
	framework/log/Dispatcher.php
	framework/validators/BooleanValidator.php
	framework/validators/CompareValidator.php
	framework/validators/EmailValidator.php
	framework/validators/FileValidator.php
	framework/validators/FilterValidator.php
	framework/validators/ImageValidator.php
	framework/validators/IpValidator.php
	framework/validators/NumberValidator.php
	framework/validators/RangeValidator.php
	framework/validators/RegularExpressionValidator.php
	framework/validators/RequiredValidator.php
	framework/validators/StringValidator.php
	framework/validators/UrlValidator.php
	framework/widgets/MaskedInput.php
	tests/bootstrap.php
	tests/framework/base/SecurityTest.php
	tests/framework/log/DispatcherTest.php
	tests/framework/web/RequestTest.php
	tests/framework/widgets/ActiveFormTest.php
tags/3.0.0-alpha1
Klimov Paul 7 years ago
parent
commit
29ce1e8687
  1. 8
      docs/guide-ru/db-migrations.md
  2. 8
      docs/guide-ru/output-data-providers.md
  3. 6
      docs/guide-ru/output-data-widgets.md
  4. 20
      docs/guide/db-migrations.md
  5. 2
      docs/guide/input-validation.md
  6. 8
      docs/guide/output-data-providers.md
  7. 6
      docs/guide/output-data-widgets.md
  8. 1
      docs/guide/tutorial-yii-as-micro-framework.md
  9. 87
      docs/internals-ru/git-workflow.md
  10. 19
      framework/CHANGELOG.md
  11. 1
      framework/UPGRADE.md
  12. 4
      framework/base/ActionFilter.php
  13. 2
      framework/base/Application.php
  14. 82
      framework/base/ArrayableTrait.php
  15. 10
      framework/base/DynamicModel.php
  16. 42
      framework/base/ErrorHandler.php
  17. 2
      framework/behaviors/AttributeBehavior.php
  18. 4
      framework/behaviors/AttributeTypecastBehavior.php
  19. 2
      framework/behaviors/AttributesBehavior.php
  20. 6
      framework/behaviors/BlameableBehavior.php
  21. 4
      framework/behaviors/SluggableBehavior.php
  22. 6
      framework/behaviors/TimestampBehavior.php
  23. 10
      framework/caching/ArrayCache.php
  24. 2
      framework/caching/ChainedDependency.php
  25. 2
      framework/caching/TagDependency.php
  26. 4
      framework/caching/migrations/m150909_153426_cache_init.php
  27. 8
      framework/captcha/CaptchaValidator.php
  28. 4
      framework/console/Application.php
  29. 2
      framework/console/controllers/BaseMigrateController.php
  30. 4
      framework/console/controllers/FixtureController.php
  31. 4
      framework/console/controllers/MessageController.php
  32. 27
      framework/console/controllers/MigrateController.php
  33. 4
      framework/console/controllers/ServeController.php
  34. 2
      framework/data/ActiveDataFilter.php
  35. 8
      framework/data/ActiveDataProvider.php
  36. 6
      framework/data/ArrayDataProvider.php
  37. 2
      framework/data/BaseDataProvider.php
  38. 20
      framework/data/DataFilter.php
  39. 6
      framework/data/SqlDataProvider.php
  40. 8
      framework/db/ActiveQuery.php
  41. 4
      framework/db/ActiveQueryTrait.php
  42. 6
      framework/db/ActiveRecord.php
  43. 12
      framework/db/BaseActiveRecord.php
  44. 2
      framework/db/BatchQueryResult.php
  45. 32
      framework/db/Command.php
  46. 2
      framework/db/Migration.php
  47. 2
      framework/db/Query.php
  48. 37
      framework/db/QueryBuilder.php
  49. 10
      framework/db/cubrid/ColumnSchemaBuilder.php
  50. 16
      framework/db/cubrid/QueryBuilder.php
  51. 6
      framework/db/cubrid/Schema.php
  52. 20
      framework/db/mssql/QueryBuilder.php
  53. 8
      framework/db/mssql/Schema.php
  54. 10
      framework/db/mysql/ColumnSchemaBuilder.php
  55. 18
      framework/db/mysql/QueryBuilder.php
  56. 8
      framework/db/mysql/Schema.php
  57. 4
      framework/db/oci/ColumnSchemaBuilder.php
  58. 20
      framework/db/oci/QueryBuilder.php
  59. 12
      framework/db/oci/Schema.php
  60. 6
      framework/db/pgsql/QueryBuilder.php
  61. 4
      framework/db/pgsql/Schema.php
  62. 4
      framework/db/sqlite/ColumnSchemaBuilder.php
  63. 4
      framework/db/sqlite/Command.php
  64. 18
      framework/db/sqlite/QueryBuilder.php
  65. 2
      framework/db/sqlite/Schema.php
  66. 2
      framework/di/NotInstantiableException.php
  67. 4
      framework/filters/AjaxFilter.php
  68. 4
      framework/filters/ContentNegotiator.php
  69. 2
      framework/filters/Cors.php
  70. 2
      framework/filters/HostControl.php
  71. 2
      framework/filters/PageCache.php
  72. 8
      framework/filters/RateLimiter.php
  73. 6
      framework/filters/auth/AuthMethod.php
  74. 6
      framework/filters/auth/CompositeAuth.php
  75. 4
      framework/filters/auth/HttpBasicAuth.php
  76. 9
      framework/filters/auth/HttpBearerAuth.php
  77. 3
      framework/filters/auth/HttpHeaderAuth.php
  78. 2
      framework/filters/auth/QueryParamAuth.php
  79. 6
      framework/grid/ActionColumn.php
  80. 4
      framework/grid/CheckboxColumn.php
  81. 8
      framework/grid/DataColumn.php
  82. 21
      framework/grid/GridView.php
  83. 4
      framework/grid/RadioButtonColumn.php
  84. 4
      framework/grid/SerialColumn.php
  85. 2
      framework/helpers/BaseArrayHelper.php
  86. 3
      framework/helpers/BaseConsole.php
  87. 16
      framework/helpers/BaseHtml.php
  88. 2
      framework/i18n/Formatter.php
  89. 4
      framework/i18n/MessageFormatter.php
  90. 2
      framework/log/EmailTarget.php
  91. 4
      framework/log/SyslogTarget.php
  92. 3
      framework/log/Target.php
  93. 18
      framework/rbac/BaseManager.php
  94. 62
      framework/rbac/DbManager.php
  95. 2
      framework/rbac/Permission.php
  96. 64
      framework/rbac/PhpManager.php
  97. 2
      framework/rbac/Role.php
  98. 4
      framework/rbac/migrations/m140506_102106_rbac_init.php
  99. 4
      framework/rbac/migrations/m170907_052038_rbac_add_index_on_auth_assignment_user_id.php
  100. 2
      framework/rest/Action.php
  101. Some files were not shown because too many files have changed in this diff Show More

8
docs/guide-ru/db-migrations.md

@ -266,7 +266,7 @@ yii migrate/create create_post_table --fields="author_id:integer:notNull:foreign
class m160328_040430_create_post_table extends Migration
{
/**
* @inheritdoc
* {@inheritdoc}
*/
public function up()
{
@ -314,7 +314,7 @@ class m160328_040430_create_post_table extends Migration
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function down()
{
@ -465,7 +465,7 @@ yii migrate/create create_junction_table_for_post_and_tag_tables
class m160328_041642_create_junction_table_for_post_and_tag_tables extends Migration
{
/**
* @inheritdoc
* {@inheritdoc}
*/
public function up()
{
@ -512,7 +512,7 @@ class m160328_041642_create_junction_table_for_post_and_tag_tables extends Migra
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function down()
{

8
docs/guide-ru/output-data-providers.md

@ -258,7 +258,7 @@ class CsvDataProvider extends BaseDataProvider
/**
* @inheritdoc
* {@inheritdoc}
*/
public function init()
{
@ -269,7 +269,7 @@ class CsvDataProvider extends BaseDataProvider
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function prepareModels()
{
@ -298,7 +298,7 @@ class CsvDataProvider extends BaseDataProvider
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function prepareKeys($models)
{
@ -320,7 +320,7 @@ class CsvDataProvider extends BaseDataProvider
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function prepareTotalCount()
{

6
docs/guide-ru/output-data-widgets.md

@ -633,7 +633,7 @@ class UserView extends ActiveRecord
{
/**
* @inheritdoc
* {@inheritdoc}
*/
public static function tableName()
{
@ -646,7 +646,7 @@ class UserView extends ActiveRecord
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function rules()
{
@ -656,7 +656,7 @@ class UserView extends ActiveRecord
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function attributeLabels()
{

20
docs/guide/db-migrations.md

@ -211,7 +211,7 @@ generates
class m150811_220037_create_post_table extends Migration
{
/**
* @inheritdoc
* {@inheritdoc}
*/
public function up()
{
@ -221,7 +221,7 @@ class m150811_220037_create_post_table extends Migration
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function down()
{
@ -245,7 +245,7 @@ generates
class m150811_220037_create_post_table extends Migration
{
/**
* @inheritdoc
* {@inheritdoc}
*/
public function up()
{
@ -257,7 +257,7 @@ class m150811_220037_create_post_table extends Migration
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function down()
{
@ -282,7 +282,7 @@ generates
class m150811_220037_create_post_table extends Migration
{
/**
* @inheritdoc
* {@inheritdoc}
*/
public function up()
{
@ -294,7 +294,7 @@ class m150811_220037_create_post_table extends Migration
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function down()
{
@ -327,7 +327,7 @@ generates
class m160328_040430_create_post_table extends Migration
{
/**
* @inheritdoc
* {@inheritdoc}
*/
public function up()
{
@ -375,7 +375,7 @@ class m160328_040430_create_post_table extends Migration
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function down()
{
@ -540,7 +540,7 @@ generates
class m160328_041642_create_junction_table_for_post_and_tag_tables extends Migration
{
/**
* @inheritdoc
* {@inheritdoc}
*/
public function up()
{
@ -587,7 +587,7 @@ class m160328_041642_create_junction_table_for_post_and_tag_tables extends Migra
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function down()
{

2
docs/guide/input-validation.md

@ -221,7 +221,7 @@ values are stored in an attribute:
```php
['age', 'trim'],
['age', 'default', 'value' => null],
['age', 'integer', 'integerOnly' => true, 'min' => 0],
['age', 'integer', 'min' => 0],
['age', 'filter', 'filter' => 'intval', 'skipOnEmpty' => true],
```

8
docs/guide/output-data-providers.md

@ -262,7 +262,7 @@ class CsvDataProvider extends BaseDataProvider
/**
* @inheritdoc
* {@inheritdoc}
*/
public function init()
{
@ -273,7 +273,7 @@ class CsvDataProvider extends BaseDataProvider
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function prepareModels()
{
@ -302,7 +302,7 @@ class CsvDataProvider extends BaseDataProvider
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function prepareKeys($models)
{
@ -324,7 +324,7 @@ class CsvDataProvider extends BaseDataProvider
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function prepareTotalCount()
{

6
docs/guide/output-data-widgets.md

@ -656,7 +656,7 @@ class UserView extends ActiveRecord
{
/**
* @inheritdoc
* {@inheritdoc}
*/
public static function tableName()
{
@ -669,7 +669,7 @@ class UserView extends ActiveRecord
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function rules()
{
@ -679,7 +679,7 @@ class UserView extends ActiveRecord
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function attributeLabels()
{

1
docs/guide/tutorial-yii-as-micro-framework.md

@ -104,6 +104,7 @@ At this point the project structure should look like this:
```
micro-app/
├── composer.json
├── config.php
├── web/
└── index.php
└── controllers/

87
docs/internals-ru/git-workflow.md

@ -1,29 +1,29 @@
Рабочий процесс Git для разработчиков Yii 2
===========================================
Итак, вы хотите разрабатывать Yii? Хорошо! Но для того чтоб увеличить шанс принятия ваших изменений,
пожалуйста следуйте следующим шагам. Если вы новичок в git и github, вы можете сначала проверить
[github help](http://help.github.com/), [try git](https://try.github.com) или прочитать о
Итак, вы хотите разрабатывать Yii? Хорошо! Но для того, чтобы увеличить шанс принятия ваших изменений,
пожалуйста, следуйте следующим шагам. Если вы новичок в git и Github, вы можете сначала проверить
[Github help](http://help.github.com/), [try git](https://try.github.com) или прочитать о
[внутренней модели данных git](http://nfarina.com/post/9868516270/git-is-simpler).
Подготовка вашего рабочего окружения
------------------------------------
Следующие шаги будут создавать рабочее окружение для Yii, которое вы можете использовать для работы над основным кодом
Следующие шаги создадут рабочее окружение для Yii, которое вы можете использовать для работы над основным кодом
фреймворка. *Эти шаги будут нужны только в первый раз*.
### 1. [Форкаем](http://help.github.com/fork-a-repo/) репозиторий Yii на github и клонируйте ваш форк в ваше рабочее окружение.
### 1. [Сделайте форк](http://help.github.com/fork-a-repo/) репозитория Yii на Github и клонируйте этот форк в ваше рабочее окружение.
```
git clone git@github.com:YOUR-GITHUB-USERNAME/yii2.git
```
Если у вас есть проблемы с настройкой GIT для работы с GitHub в Linux, или вы получаете ошибку похожую на "Permission Denied
(publickey)", тогда вы должны настроить ваш GIT по [этой инструкции](http://help.github.com/linux-set-up-git/)
Если у вас есть проблемы с настройкой Git для работы с GitHub в Linux, или вы получаете ошибку похожую на "Permission Denied
(publickey)", тогда вы должны настроить ваш Git по [этой инструкции](http://help.github.com/linux-set-up-git/)
### 2. Добавляем главный репозиторий Yii как дополнительный внешний git репозиторий называемый "upstream"
### 2. Добавьте главный репозиторий Yii как дополнительный внешний git репозиторий называемый "upstream"
Перейдите в каталог, куда вы склонировали Yii, как правило "yii2". Затем введите следующую команду:
Перейдите в каталог куда вы склонировали Yii, как правило "yii2". Затем введите следующую команду:
```
git remote add upstream git://github.com/yiisoft/yii2.git
@ -33,11 +33,20 @@ git remote add upstream git://github.com/yiisoft/yii2.git
Следующие шаги не обязательны, если вы хотите работать только с переводом или документацией.
- выполните `composer update` для установки зависимостей (если [composer у вас установлен глобально](https://getcomposer.org/doc/00-intro.md#globally)).
- выполните `composer install` для установки зависимостей
(если [composer у вас установлен глобально](https://getcomposer.org/doc/00-intro.md#globally)).
> Note: Если вы видите такие ошибки, как `Problem 1 The requested package bower-asset/jquery could not be found in
> Note: если вы видите такие ошибки, как `Problem 1 The requested package bower-asset/jquery could not be found in
> any version, there may be a typo in the package name.`, необходимо запустить `composer global require "fxp/composer-asset-plugin:^1.4.1"`
Если вы планируете работать с Javascript:
- выполните `npm install` для установки зависимостей и программ тестирования Javascript
(если [Node.js and NPM установлен](https://nodejs.org/en/download/package-manager/)).
> Note: тесты JavaScript зависят от библиотеки jsdom, которой требуется Node.js 4 или более новый.
> Предпочтительнее использовать Node.js 6 or 7.
- выполните `php build/build dev/app basic` для клонирования базового приложения и установки его зависимостей.
Эта команда установит сторонние пакеты composer обычным образом, но создаст ссылку с репозитория yii2 на только
что загруженный репозиторий. Таким образом у вас будет только один экземпляр кода.
@ -56,13 +65,16 @@ git remote add upstream git://github.com/yiisoft/yii2.git
### Модульные тесты
Вы можете выполнить модульные тесты с помощью команды `phpunit` в корневой директории приложения. Если у вас phpunit
не установлен глобально, вы можете запустить `php vendor/bin/phpunit`.
не установлен глобально, вы можете запустить `php vendor/bin/phpunit` или `vendor/bin/phpunit.bat` в случае
использования OS Windows.
Некоторые тесты требуют дополнительно установки и настройки баз данных. Вы можете создать `tests/data/config.local.php`
для переопределения настроек, которые определены в `tests/data/config.php`.
Вы можете ограничить тестирование группой тестов, с которой вы сейчас работаете, например запускать только тесты для
валидаторов и redis. Вы можете получить список доступных групп выполнив `phpunit --list-groups`.
Вы можете ограничить тестирование группой тестов, с которой вы сейчас работаете. Например, запускать только тесты для
валидаторов и redis: `phpunit --group=validators,redis`. Вы можете получить список доступных групп выполнив `phpunit --list-groups`.
Вы можете запустить модульные тесты JavaScript с помощью команды `npm test` в корневой директории приложения.
### Расширения
@ -70,15 +82,16 @@ git remote add upstream git://github.com/yiisoft/yii2.git
сделать это:
```
php build/build dev/ext <extension-name>
php build/build dev/ext <extension-name> <fork>
```
где `<extension-name>` это имя расширения, например `redis`.
где `<extension-name>` это имя расширения, например `redis` и `<fork>` это URL вашего форка расширения, например
`git@github.com:my_nickname/yii2-redis.git`. Если вы контрибьютор ядра фреймворка, вы можете не указывать `<fork>`.
Если вы хотите протестировать расширение в одном из шаблонов приложений, просто добавьте его в `composer.json`
приложения, например добавив `"yiisoft/yii2-redis": "~2.0.0"` в секцию `require` базового приложения.
Запустите `php build/build dev/app basic` для установки расширения и его зависимостей и создания символической
ссылки на `extensions/redis` так чтоб вы работали не папке вендорных пакетов composer, а напрямую в репозиторий yii2.
ссылки на `extensions/redis` так чтоб вы работали не папке вендорных пакетов composer, а напрямую в репозитории yii2.
> Note: по умолчанию URL репозиториев git на GitHub работают через SSH. Чтобы использовать HTTPS, добавьте
> флаг `--useHttp` к команде `build`.
@ -94,21 +107,21 @@ php build/build dev/ext <extension-name>
Потратьте несколько минут на поиск существующей issue, которая соответствует вашим изменениям. Если вы найдёте её в
списке, то пожалуйста оставьте комментарий, что вы начали над ней работать. Если вы не нашли нужной issue пожалуйста
[создайте новую issue](report-an-issue.md) или создайте сразу запрос на изменения если это простые изменения.
Это позволит команде проверить ваше предложение, и обеспечивать соответствующую обратную связь.
Это позволит команде проверить ваше предложение, и обеспечить соответствующую обратную связь.
> Для небольших изменений или документации, или простых исправлений, вам нет необходимости создавать issue,
запрос на изменения в этом случае подходит лучше.
### 2. Вытягивание последнего кода из основного репозитория Yii
### 2. Получите последний код из основного репозитория Yii
```
git fetch upstream
git pull upstream
```
Вы должны начинать с этого действия работу над каждым новым предложением, убеждайтесь что вы работаете над самой
Вы должны начинать с этого действия работу над каждым новым предложением. Убедитесь, что вы работаете с самой
последней версией кода.
### 3. Создание новой ветки для ваших изменений, основанных на текущем мастере Yii
### 3. Сделайте новую ветку для ваших изменений, основанных на текущей ветке master в Yii
> Это очень важно, так как вы не сможете отправлять более одного запроса на изменения из вашего репозитория, если
будете использовать ветку master.
@ -123,7 +136,7 @@ git checkout upstream/master
git checkout -b 999-name-of-your-branch-goes-here
```
### 4. Делайте свою магию, пишите ваш код
### 4. Делайте свою магию, пишите свой код
Убедитесь, что он работает :)
@ -145,7 +158,7 @@ Enh #999: a description of the enhancement (Your Name)
Для очень маленьких исправлений, например опечаток и изменений документации, нет необходимости обновлять CHANGELOG.
### 6. Фиксация ваших изменений
### 6. Зафиксируйте изменения
Добавляем файлы/изменения которые вы хотите зафиксировать в [staging area](http://gitref.org/basic/#add)
@ -155,14 +168,14 @@ git add path/to/my/file.php
Вы можете использовать опцию `-p` для того, чтоб выбрать, какие изменения вы хотите добавить в коммит.
Фиксируйте ваши изменения с описательным сообщением. Убедитесь что в сообщение есть номер `#XXX`, так github
автоматически свяжет ваш коммит с тикетом:
Фиксируйте ваши изменения с описательным сообщением. Убедитесь, что в сообщении есть номер `#XXX`, так Github
автоматически свяжет ваш коммит с issue:
```
git commit -m "A brief description of this change which fixes #999 goes here"
```
### 7. Получение последнего кода из апстрима Yii в вашу ветку
### 7. Получите последний код из upstream Yii в вашу ветку
```
git pull upstream master
@ -172,18 +185,18 @@ git pull upstream master
какие-либо конфликты слияния, вы должны исправить их и зафиксировать изменения ещё раз. Это гарантирует, что команда Yii
сможет слить ваши изменения одним кликом.
### 8. Разрешив зависимости, отправляем код на github
### 8. Разрешив зависимости, отправьте код на Github
```
git push -u origin 999-name-of-your-branch-goes-here
```
Опция `-u` сохранит указание на ветку в github, чтобы при следующем выполнении `git push`, git знал, куда отправлять
Опция `-u` сохранит указание на ветку в Github, чтобы при следующем выполнении `git push`, git знал, куда отправлять
изменения. Это полезно, если вы хотите позже отправлять ещё коммиты в этот запрос на слияние.
### 9. Открываем [запрос на слияние](http://help.github.com/send-pull-requests/) в *upstream*.
### 9. Откройте [запрос на слияние](http://help.github.com/send-pull-requests/) в *upstream*.
Перейдите в репозиторий на github и нажмите "Pull Request", выберите ветку справа и введите больше информации
Перейдите в репозиторий на Github и нажмите "Pull Request", выберите ветку справа и введите больше информации
в поле комментариев. Чтобы связать запрос на изменение с issue, добавьте в комментарий `#999` - где 999 это номер issue.
> Обратите внимание, что каждый запрос на слияние должен исправлять единственное изменение. Для множества независимых
@ -191,10 +204,10 @@ git push -u origin 999-name-of-your-branch-goes-here
### 10. Проверка вашего кода кем-то
Кто-то будет проверять ваш код, и, возможно, вам будет предложено внести некоторые изменения, если это так, то перейдите
Кто-то будет проверять ваш код, и, возможно, вам будет предложено внести некоторые изменения. Eсли это так, то перейдите
к шагу #6 (вам не надо открывать новый запрос на слияние, если текущий ещё открыт). Если код будет принят, он будет
влит в основную ветку и станет частью следующего релиза Yii. Если нет, не унывайте, разным людям необходимы различные
функции и Yii не может реализовывать всё для всех, ваш код будет ещё доступен на github как ссылка для людей кому он
влит в основную ветку и станет частью следующего релиза Yii. Если нет - не унывайте, разным людям необходимы различные
функции и Yii не может реализовывать всё для всех, ваш код будет ещё доступен на Github как ссылка для людей кому он
может пригодится.
### 11. Очистка
@ -210,16 +223,16 @@ git push origin --delete 999-name-of-your-branch-goes-here
### Примечание
Для обнаружения регрессии как можно раньше, каждое слияние кодовой базы Yii на github будет подхвачено
Для обнаружения регрессии как можно раньше, каждое слияние кодовой базы Yii на Github будет подхвачено
[Travis CI](http://travis-ci.org) для автоматического запуска тестов. Люди из *core team* не хотят нагружать
этот сервис, поэтому добавляют текст [`[ci skip]`](http://about.travis-ci.org/docs/user/how-to-skip-a-build/) в описание
запроса на слияние, в следующих ситуациях:
* затронуты только javascript, css файлы или файлы изображений,
* затронуты только JavaScript, CSS файлы или файлы изображений,
* обновление документации,
* изменения затрагивают только строки (например обновление переводов).
Это защитит travis от запуска тестов на изменениях, которые не покрыты тестами.
Это защитит Travis CI от запуска тестов на изменениях, которые не покрыты тестами.
### Обзор команд (для продвинутых участников)

19
framework/CHANGELOG.md

@ -45,15 +45,29 @@ Yii Framework 2 Change Log
2.0.14 under development
------------------------
- Enh #13996: Added `yii\web\View::registerJsVar()` method that allows registering JavaScript variables (Eseperio, samdark)
- Enh #9771: Assign hidden input with its own set of HTML options via `$hiddenOptions` in activeFileInput `$options` (HanafiAhmat)
- Bug #15536: Fixed `yii\widgets\ActiveForm::init()` for call `parent::init()` (panchenkodv)
- Enh #14806: Added $placeFooterAfterBody option for GridView (terehru)
- Bug #14711: Fixed `yii\web\ErrorHandler` displaying exception message in non-debug mode (samdark)
- Enh #13814: MySQL unique index names can now contain spaces (df2)
- Bug #15300: Fixed "Cannot read property 'style' of undefined" error at the error screen (vitorarantes)
- Bug #15540: Fixed `yii\db\ActiveRecord::with()` unable to use relation defined via attached behavior in case `asArray` is enabled (klimov-paul)
- Enh #15426: Added abilitiy to create and drop database views (igravity, vladis84)
- Enh #10186: Use native `hash_equals` in `yii\base\Security::compareString()` if available, throw exception if non-strings are compared (aotd1, samdark)
- Bug #15122: Fixed `yii\db\Command::getRawSql()` to properly replace expressions (hiscaler, samdark)
- Enh #15496: CSRF token is now regenerated on changing identity (samdark, rhertogh)
- Enh #15417: Added `yii\validators\FileValidator::$minFiles` (vladis84)
- Bug #8983: Only truncate the original log file for rotation (matthewyang, developeruz)
- Bug #14135: Fixed `yii\web\Request::getBodyParam()` crashes on object type body params (klimov-paul)
- Bug #14157: Add support for loading default value `CURRENT_TIMESTAMP` of MySQL `datetime` field (rossoneri)
- Bug #14276: Fixed I18N format with dotted parameters (developeruz)
- Bug #14484: Fixed `yii\validators\UniqueValidator` for target classes with a default scope (laszlovl, developeruz)
- Bug #14604: Fixed `yii\validators\CompareValidator` `compareAttribute` does not work if `compareAttribute` form ID has been changed (mikk150)
- Bug #14903: Fixed route with extra dashes is executed controller while it should not (developeruz)
- Bug #14916: Fixed `yii\db\Query::each()` iterator key starts from 1 instead of 0 (Vovan-VE)
- Bug #15046: Throw an `yii\web\HeadersAlreadySentException` if headers were sent before web response (dmirogin)
- Bug #14980: Fix looping in `yii\i18n\MessageFormatter` tokenize pattern if pattern is invalid (uaoleg, developeruz)
- Bug #15142: Fixed array params replacing in `yii\helpers\BaseUrl::current()` (IceJOKER)
- Bug #15169: Fixed translating a string when NULL parameter is passed (developeruz)
- Bug #15194: Fixed `yii\db\QueryBuilder::insert()` to preserve passed params when building a `INSERT INTO ... SELECT` query for MSSQL, PostgreSQL and SQLite (sergeymakinen)
@ -74,15 +88,19 @@ Yii Framework 2 Change Log
- Bug #15432: Fixed wrong value being set in `yii\filters\RateLimiter::checkRateLimit()` resulting in wrong `X-Rate-Limit-Reset` header value (bizley)
- Bug #15440: Fixed `yii\behaviors\AttributeTypecastBehavior::$attributeTypes` auto-detection fails for rule, which specify attribute with '!' prefix (klimov-paul)
- Bug #15462: Fixed `accessChecker` configuration error (developeruz)
- Bug #15494: Fixed missing `WWW-Authenticate` header (developeruz)
- Bug #15553: Fixed `yii\validators\NumberValidator` incorrectly validate resource (developeruz)
- Enh #3087: Added `yii\helpers\BaseHtml::error()` "errorSource" option to be able to customize errors display (yanggs07, developeruz, silverfire)
- Enh #3250: Added support for events partial wildcard matching (klimov-paul)
- Enh #5515: Added default value for `yii\behaviors\BlameableBehavior` for cases when the user is guest (dmirogin)
- Enh #6844: `yii\base\ArrayableTrait::toArray()` now allows recursive `$fields` and `$expand` (bboure)
- Enh #7988: Added `\yii\helpers\Console::errorSummary()` and `\yii\helpers\Json::errorSummary()` (developeruz)
- Enh #7996: Short syntax for verb in GroupUrlRule (schojniak, developeruz)
- Enh #8752: Allow specify `$attributeNames` as a string for `yii\base\Model` `validate()` method (developeruz)
- Enh #9137: Added `Access-Control-Allow-Method` header for the OPTIONS request (developeruz)
- Enh #9253: Allow `variations` to be a string for `yii\filters\PageCache` and `yii\widgets\FragmentCache` (schojniak, developeruz)
- Enh #12623: Added `yii\helpers\StringHelper::matchWildcard()` replacing usage of `fnmatch()`, which may be unreliable (klimov-paul)
- Enh #13919: Added option to add comment for created table to migration console command (mixartemev, developeruz)
- Enh #14043: Added `yii\helpers\IpHelper` (silverfire, cebe)
- Enh #14355: Added ability to pass an empty array as a parameter in console command (developeruz)
- Enh #14568: Refactored migration templates to use `safeUp()` and `safeDown()` methods (Kolyunya)
@ -105,7 +123,6 @@ Yii Framework 2 Change Log
- Enh: Added check to `yii\base\Model::formName()` to prevent source path disclosure when form is represented by an anonymous class (silverfire)
- Chg #15420: Handle OPTIONS request in `yii\filter\Cors` so the preflight check isn't passed trough authentication filters (michaelarnauts, leandrogehlen)
2.0.13.1 November 14, 2017
--------------------------

1
framework/UPGRADE.md

@ -167,6 +167,7 @@ Upgrade from Yii 2.0.13
* Constants `IPV6_ADDRESS_LENGTH`, `IPV4_ADDRESS_LENGTH` were moved from `yii\validators\IpValidator` to `yii\helpers\IpHelper`.
If your application relies on these constants, make sure to update your code to follow the changes.
* `yii\base\Security::compareString()` is now throwing `yii\base\InvalidParamException` in case non-strings are compared.
Upgrade from Yii 2.0.12
-----------------------

4
framework/base/ActionFilter.php

@ -44,7 +44,7 @@ class ActionFilter extends Behavior
/**
* @inheritdoc
* {@inheritdoc}
*/
public function attach($owner)
{
@ -53,7 +53,7 @@ class ActionFilter extends Behavior
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function detach()
{

2
framework/base/Application.php

@ -275,7 +275,7 @@ abstract class Application extends Module
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function init()
{

82
framework/base/ArrayableTrait.php

@ -103,13 +103,19 @@ trait ArrayableTrait
* This method will first identify which fields to be included in the resulting array by calling [[resolveFields()]].
* It will then turn the model into an array with these fields. If `$recursive` is true,
* any embedded objects will also be converted into arrays.
* When embeded objects are [[Arrayable]], their respective nested fields will be extracted and passed to [[toArray()]].
*
* If the model implements the [[Linkable]] interface, the resulting array will also have a `_link` element
* which refers to a list of links as specified by the interface.
*
* @param array $fields the fields being requested. If empty, all fields as specified by [[fields()]] will be returned.
* @param array $fields the fields being requested.
* If empty or if it contains '*', all fields as specified by [[fields()]] will be returned.
* Fields can be nested, separated with dots (.). e.g.: item.field.sub-field
* `$recursive` must be true for nested fields to be extracted. If `$recursive` is false, only the root fields will be extracted.
* @param array $expand the additional fields being requested for exporting. Only fields declared in [[extraFields()]]
* will be considered.
* Expand can also be nested, separated with dots (.). e.g.: item.expand1.expand2
* `$recursive` must be true for nested expands to be extracted. If `$recursive` is false, only the root expands will be extracted.
* @param bool $recursive whether to recursively return array representation of embedded objects.
* @return array the array representation of the object
*/
@ -117,7 +123,27 @@ trait ArrayableTrait
{
$data = [];
foreach ($this->resolveFields($fields, $expand) as $field => $definition) {
$data[$field] = is_string($definition) ? $this->$definition : call_user_func($definition, $this, $field);
$attribute = is_string($definition) ? $this->$definition : call_user_func($definition, $this, $field);
if ($recursive) {
$nestedFields = $this->extractFieldsFor($fields, $field);
$nestedExpand = $this->extractFieldsFor($expand, $field);
if ($attribute instanceof Arrayable) {
$attribute = $attribute->toArray($nestedFields, $nestedExpand);
} elseif (is_array($attribute)) {
$attribute = array_map(
function ($item) use ($nestedFields, $nestedExpand) {
if ($item instanceof Arrayable) {
return $item->toArray($nestedFields, $nestedExpand);
} else {
return $item;
}
},
$attribute
);
}
}
$data[$field] = $attribute;
}
if ($this instanceof Linkable) {
@ -128,8 +154,56 @@ trait ArrayableTrait
}
/**
* Extracts the root field names from nested fields.
* Nested fields are separated with dots (.). e.g: "item.id"
* The previous example would extract "item".
*
* @param array $fields The fields requested for extraction
* @return array root fields extracted from the given nested fields
* @since 2.0.14
*/
protected function extractRootFields(array $fields)
{
$result = [];
foreach ($fields as $field) {
$result[] = current(explode(".", $field, 2));
}
if (in_array('*', $result, true)) {
$result = [];
}
return array_unique($result);
}
/**
* Extract nested fields from a fields collection for a given root field
* Nested fields are separated with dots (.). e.g: "item.id"
* The previous example would extract "id".
*
* @param array $fields The fields requested for extraction
* @param string $rootField The root field for which we want to extract the nested fields
* @return array nested fields extracted for the given field
* @since 2.0.14
*/
protected function extractFieldsFor(array $fields, $rootField)
{
$result = [];
foreach ($fields as $field) {
if (0 === strpos($field, "{$rootField}.")) {
$result[] = preg_replace("/^{$rootField}\./i", '', $field);
}
}
return array_unique($result);
}
/**
* Determines which fields can be returned by [[toArray()]].
* This method will check the requested fields against those declared in [[fields()]] and [[extraFields()]]
* This method will first extract the root fields from the given fields.
* Then it will check the requested root fields against those declared in [[fields()]] and [[extraFields()]]
* to determine which fields can be returned.
* @param array $fields the fields being requested for exporting
* @param array $expand the additional fields being requested for exporting
@ -138,6 +212,8 @@ trait ArrayableTrait
*/
protected function resolveFields(array $fields, array $expand)
{
$fields = $this->extractRootFields($fields);
$expand = $this->extractRootFields($expand);
$result = [];
foreach ($this->fields() as $field => $definition) {

10
framework/base/DynamicModel.php

@ -76,7 +76,7 @@ class DynamicModel extends Model
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function __get($name)
{
@ -88,7 +88,7 @@ class DynamicModel extends Model
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function __set($name, $value)
{
@ -100,7 +100,7 @@ class DynamicModel extends Model
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function __isset($name)
{
@ -112,7 +112,7 @@ class DynamicModel extends Model
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function __unset($name)
{
@ -193,7 +193,7 @@ class DynamicModel extends Model
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function attributes()
{

42
framework/base/ErrorHandler.php

@ -267,22 +267,36 @@ abstract class ErrorHandler extends Component
*/
public static function convertExceptionToString($exception)
{
if ($exception instanceof Exception && ($exception instanceof UserException || !YII_DEBUG)) {
$message = "{$exception->getName()}: {$exception->getMessage()}";
} elseif (YII_DEBUG) {
if ($exception instanceof Exception) {
$message = "Exception ({$exception->getName()})";
} elseif ($exception instanceof ErrorException) {
$message = "{$exception->getName()}";
} else {
$message = 'Exception';
}
$message .= " '" . get_class($exception) . "' with message '{$exception->getMessage()}' \n\nin "
. $exception->getFile() . ':' . $exception->getLine() . "\n\n"
. "Stack trace:\n" . $exception->getTraceAsString();
if ($exception instanceof UserException) {
return "{$exception->getName()}: {$exception->getMessage()}";
}
if (YII_DEBUG) {
return static::convertExceptionToVerboseString($exception);
}
return 'An internal server error occurred.';
}
/**
* Converts an exception into a string that has verbose information about the exception and its trace.
* @param \Exception|\Error $exception the exception being converted
* @return string the string representation of the exception.
*
* @since 2.0.14
*/
public static function convertExceptionToVerboseString($exception)
{
if ($exception instanceof Exception) {
$message = "Exception ({$exception->getName()})";
} elseif ($exception instanceof ErrorException) {
$message = "{$exception->getName()}";
} else {
$message = 'Error: ' . $exception->getMessage();
$message = 'Exception';
}
$message .= " '" . get_class($exception) . "' with message '{$exception->getMessage()}' \n\nin "
. $exception->getFile() . ':' . $exception->getLine() . "\n\n"
. "Stack trace:\n" . $exception->getTraceAsString();
return $message;
}

2
framework/behaviors/AttributeBehavior.php

@ -93,7 +93,7 @@ class AttributeBehavior extends Behavior
/**
* @inheritdoc
* {@inheritdoc}
*/
public function events()
{

4
framework/behaviors/AttributeTypecastBehavior.php

@ -188,7 +188,7 @@ class AttributeTypecastBehavior extends Behavior
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function attach($owner)
{
@ -294,7 +294,7 @@ class AttributeTypecastBehavior extends Behavior
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function events()
{

2
framework/behaviors/AttributesBehavior.php

@ -122,7 +122,7 @@ class AttributesBehavior extends Behavior
/**
* @inheritdoc
* {@inheritdoc}
*/
public function events()
{

6
framework/behaviors/BlameableBehavior.php

@ -67,7 +67,7 @@ class BlameableBehavior extends AttributeBehavior
*/
public $updatedByAttribute = 'updated_by';
/**
* @inheritdoc
* {@inheritdoc}
*
* In case, when the property is `null`, the value of `Yii::$app->user->id` will be used as the value.
*/
@ -80,7 +80,7 @@ class BlameableBehavior extends AttributeBehavior
public $defaultValue;
/**
* @inheritdoc
* {@inheritdoc}
*/
public function init()
{
@ -95,7 +95,7 @@ class BlameableBehavior extends AttributeBehavior
}
/**
* @inheritdoc
* {@inheritdoc}
*
* In case, when the [[value]] property is `null`, the value of [[defaultValue]] will be used as the value.
*/

4
framework/behaviors/SluggableBehavior.php

@ -124,7 +124,7 @@ class SluggableBehavior extends AttributeBehavior
/**
* @inheritdoc
* {@inheritdoc}
*/
public function init()
{
@ -140,7 +140,7 @@ class SluggableBehavior extends AttributeBehavior
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function getValue($event)
{

6
framework/behaviors/TimestampBehavior.php

@ -82,7 +82,7 @@ class TimestampBehavior extends AttributeBehavior
*/
public $updatedAtAttribute = 'updated_at';
/**
* @inheritdoc
* {@inheritdoc}
*
* In case, when the value is `null`, the result of the PHP function [time()](http://php.net/manual/en/function.time.php)
* will be used as value.
@ -91,7 +91,7 @@ class TimestampBehavior extends AttributeBehavior
/**
* @inheritdoc
* {@inheritdoc}
*/
public function init()
{
@ -106,7 +106,7 @@ class TimestampBehavior extends AttributeBehavior
}
/**
* @inheritdoc
* {@inheritdoc}
*
* In case, when the [[value]] is `null`, the result of the PHP function [time()](http://php.net/manual/en/function.time.php)
* will be used as value.

10
framework/caching/ArrayCache.php

@ -48,7 +48,7 @@ class ArrayCache extends SimpleCache
/**
* @inheritdoc
* {@inheritdoc}
*/
public function has($key)
{
@ -57,7 +57,7 @@ class ArrayCache extends SimpleCache
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function getValue($key)
{
@ -69,7 +69,7 @@ class ArrayCache extends SimpleCache
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function setValue($key, $value, $ttl)
{
@ -78,7 +78,7 @@ class ArrayCache extends SimpleCache
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function deleteValue($key)
{
@ -87,7 +87,7 @@ class ArrayCache extends SimpleCache
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function clear()
{

2
framework/caching/ChainedDependency.php

@ -58,7 +58,7 @@ class ChainedDependency extends Dependency
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function isChanged($cache)
{

2
framework/caching/TagDependency.php

@ -58,7 +58,7 @@ class TagDependency extends Dependency
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function isChanged($cache)
{

4
framework/caching/migrations/m150909_153426_cache_init.php

@ -32,7 +32,7 @@ class m150909_153426_cache_init extends Migration
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function up()
{
@ -54,7 +54,7 @@ class m150909_153426_cache_init extends Migration
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function down()
{

8
framework/captcha/CaptchaValidator.php

@ -41,7 +41,7 @@ class CaptchaValidator extends Validator
/**
* @inheritdoc
* {@inheritdoc}
*/
public function init()
{
@ -52,7 +52,7 @@ class CaptchaValidator extends Validator
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function validateValue($value)
{
@ -82,7 +82,7 @@ class CaptchaValidator extends Validator
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function clientValidateAttribute($model, $attribute, $view)
{
@ -93,7 +93,7 @@ class CaptchaValidator extends Validator
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getClientOptions($model, $attribute)
{

4
framework/console/Application.php

@ -81,7 +81,7 @@ class Application extends \yii\base\Application
/**
* @inheritdoc
* {@inheritdoc}
*/
public function __construct($config = [])
{
@ -229,7 +229,7 @@ class Application extends \yii\base\Application
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function coreComponents()
{

2
framework/console/controllers/BaseMigrateController.php

@ -93,7 +93,7 @@ abstract class BaseMigrateController extends Controller
/**
* @inheritdoc
* {@inheritdoc}
*/
public function options($actionID)
{

4
framework/console/controllers/FixtureController.php

@ -65,7 +65,7 @@ class FixtureController extends Controller
/**
* @inheritdoc
* {@inheritdoc}
*/
public function options($actionID)
{
@ -75,7 +75,7 @@ class FixtureController extends Controller
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function optionAliases()

4
framework/console/controllers/MessageController.php

@ -154,7 +154,7 @@ class MessageController extends \yii\console\Controller
/**
* @inheritdoc
* {@inheritdoc}
*/
public function options($actionID)
{
@ -181,7 +181,7 @@ class MessageController extends \yii\console\Controller
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function optionAliases()

27
framework/console/controllers/MigrateController.php

@ -84,7 +84,7 @@ class MigrateController extends BaseMigrateController
*/
public $migrationTable = '{{%migration}}';
/**
* @inheritdoc
* {@inheritdoc}
*/
public $templateFile = '@yii/views/migration.php';
/**
@ -132,10 +132,15 @@ class MigrateController extends BaseMigrateController
* for creating the object.
*/
public $db = 'db';
/**
* @var string the comment for the table being created.
* @since 2.0.14
*/
public $comment = '';
/**
* @inheritdoc
* {@inheritdoc}
*/
public function options($actionID)
{
@ -143,18 +148,19 @@ class MigrateController extends BaseMigrateController
parent::options($actionID),
['migrationTable', 'db'], // global for all actions
$actionID === 'create'
? ['templateFile', 'fields', 'useTablePrefix']
? ['templateFile', 'fields', 'useTablePrefix', 'comment']
: []
);
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function optionAliases()
{
return array_merge(parent::optionAliases(), [
'c' => 'comment',
'f' => 'fields',
'p' => 'migrationPath',
't' => 'migrationTable',
@ -197,7 +203,7 @@ class MigrateController extends BaseMigrateController
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function getMigrationHistory($limit)
{
@ -272,7 +278,7 @@ class MigrateController extends BaseMigrateController
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function addMigrationHistory($version)
{
@ -284,7 +290,7 @@ class MigrateController extends BaseMigrateController
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.13
*/
protected function truncateDatabase()
@ -310,7 +316,7 @@ class MigrateController extends BaseMigrateController
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function removeMigrationHistory($version)
{
@ -323,7 +329,7 @@ class MigrateController extends BaseMigrateController
private $_migrationNameLimit;
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.13
*/
protected function getMigrationNameLimit()
@ -340,7 +346,7 @@ class MigrateController extends BaseMigrateController
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
protected function generateMigrationSourceCode($params)
@ -437,6 +443,7 @@ class MigrateController extends BaseMigrateController
'table' => $this->generateTableName($table),
'fields' => $fields,
'foreignKeys' => $foreignKeys,
'tableComment' => $this->comment,
]));
}

4
framework/console/controllers/ServeController.php

@ -83,7 +83,7 @@ class ServeController extends Controller
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function options($actionID)
{
@ -95,7 +95,7 @@ class ServeController extends Controller
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function optionAliases()

2
framework/data/ActiveDataFilter.php

@ -66,7 +66,7 @@ class ActiveDataFilter extends DataFilter
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function buildInternal()
{

8
framework/data/ActiveDataProvider.php

@ -94,7 +94,7 @@ class ActiveDataProvider extends BaseDataProvider
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function prepareModels()
{
@ -117,7 +117,7 @@ class ActiveDataProvider extends BaseDataProvider
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function prepareKeys($models)
{
@ -158,7 +158,7 @@ class ActiveDataProvider extends BaseDataProvider
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function prepareTotalCount()
{
@ -170,7 +170,7 @@ class ActiveDataProvider extends BaseDataProvider
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function setSort($value)
{

6
framework/data/ArrayDataProvider.php

@ -74,7 +74,7 @@ class ArrayDataProvider extends BaseDataProvider
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function prepareModels()
{
@ -98,7 +98,7 @@ class ArrayDataProvider extends BaseDataProvider
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function prepareKeys($models)
{
@ -119,7 +119,7 @@ class ArrayDataProvider extends BaseDataProvider
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function prepareTotalCount()
{

2
framework/data/BaseDataProvider.php

@ -53,7 +53,7 @@ abstract class BaseDataProvider extends Component implements DataProviderInterfa
/**
* @inheritdoc
* {@inheritdoc}
*/
public function init()
{

20
framework/data/DataFilter.php

@ -427,7 +427,7 @@ class DataFilter extends Model
// Model specific:
/**
* @inheritdoc
* {@inheritdoc}
*/
public function attributes()
{
@ -437,7 +437,7 @@ class DataFilter extends Model
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function formName()
{
@ -445,7 +445,7 @@ class DataFilter extends Model
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function rules()
{
@ -455,7 +455,7 @@ class DataFilter extends Model
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function attributeLabels()
{
@ -730,7 +730,7 @@ class DataFilter extends Model
// Property access:
/**
* @inheritdoc
* {@inheritdoc}
*/
public function canGetProperty($name, $checkVars = true, $checkBehaviors = true)
{
@ -741,7 +741,7 @@ class DataFilter extends Model
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function canSetProperty($name, $checkVars = true, $checkBehaviors = true)
{
@ -752,7 +752,7 @@ class DataFilter extends Model
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function __get($name)
{
@ -764,7 +764,7 @@ class DataFilter extends Model
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function __set($name, $value)
{
@ -776,7 +776,7 @@ class DataFilter extends Model
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function __isset($name)
{
@ -788,7 +788,7 @@ class DataFilter extends Model
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function __unset($name)
{

6
framework/data/SqlDataProvider.php

@ -103,7 +103,7 @@ class SqlDataProvider extends BaseDataProvider
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function prepareModels()
{
@ -138,7 +138,7 @@ class SqlDataProvider extends BaseDataProvider
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function prepareKeys($models)
{
@ -159,7 +159,7 @@ class SqlDataProvider extends BaseDataProvider
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function prepareTotalCount()
{

8
framework/db/ActiveQuery.php

@ -134,7 +134,7 @@ class ActiveQuery extends Query implements ActiveQueryInterface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function prepare($builder)
{
@ -196,7 +196,7 @@ class ActiveQuery extends Query implements ActiveQueryInterface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function populate($rows)
{
@ -323,7 +323,7 @@ class ActiveQuery extends Query implements ActiveQueryInterface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function queryScalar($selectExpression, $db)
{
@ -802,7 +802,7 @@ class ActiveQuery extends Query implements ActiveQueryInterface
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.12
*/
public function getTablesUsedInFrom()

4
framework/db/ActiveQueryTrait.php

@ -164,7 +164,9 @@ trait ActiveQueryTrait
{
$primaryModel = reset($models);
if (!$primaryModel instanceof ActiveRecordInterface) {
$primaryModel = new $this->modelClass();
/* @var $modelClass ActiveRecordInterface */
$modelClass = $this->modelClass;
$primaryModel = $modelClass::instance();
}
$relations = $this->normalizeRelations($primaryModel, $with);
/* @var $relation ActiveQuery */

6
framework/db/ActiveRecord.php

@ -190,7 +190,7 @@ class ActiveRecord extends BaseActiveRecord
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function refresh()
{
@ -313,7 +313,7 @@ class ActiveRecord extends BaseActiveRecord
}
/**
* @inheritdoc
* {@inheritdoc}
* @return ActiveQuery the newly created [[ActiveQuery]] instance.
*/
public static function find()
@ -413,7 +413,7 @@ class ActiveRecord extends BaseActiveRecord
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public static function populateRecord($record, $row)
{

12
framework/db/BaseActiveRecord.php

@ -99,7 +99,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
/**
* @inheritdoc
* {@inheritdoc}
* @return static|null ActiveRecord instance matching the condition, or `null` if nothing matches.
*/
public static function findOne($condition)
@ -108,7 +108,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
}
/**
* @inheritdoc
* {@inheritdoc}
* @return static[] an array of ActiveRecord instances, or an empty array if nothing matches.
*/
public static function findAll($condition)
@ -232,7 +232,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function canGetProperty($name, $checkVars = true, $checkBehaviors = true)
{
@ -249,7 +249,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function canSetProperty($name, $checkVars = true, $checkBehaviors = true)
{
@ -1645,7 +1645,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
}
/**
* @inheritdoc
* {@inheritdoc}
*
* The default implementation returns the names of the columns whose values have been populated into this record.
*/
@ -1657,7 +1657,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
}
/**
* @inheritdoc
* {@inheritdoc}
*
* The default implementation returns the names of the relations that have been populated into this record.
*/

2
framework/db/BatchQueryResult.php

@ -118,7 +118,7 @@ class BatchQueryResult extends BaseObject implements \Iterator
if ($this->query->indexBy !== null) {
$this->_key = key($this->_batch);
} elseif (key($this->_batch) !== null) {
$this->_key++;
$this->_key = $this->_key === null ? 0 : $this->_key + 1;
} else {
$this->_key = null;
}

32
framework/db/Command.php

@ -211,7 +211,7 @@ class Command extends Component
$params[$name] = ($value ? 'TRUE' : 'FALSE');
} elseif ($value === null) {
$params[$name] = 'NULL';
} elseif (!is_object($value) && !is_resource($value)) {
} elseif ((!is_object($value) && !is_resource($value)) || $value instanceof Expression) {
$params[$name] = $value;
}
}
@ -981,6 +981,36 @@ class Command extends Component
}
/**
* Creates a SQL View.
*
* @param string $viewName the name of the view to be created.
* @param string|Query $subquery the select statement which defines the view.
* This can be either a string or a [[Query]] object.
* @return $this the command object itself.
* @since 2.0.14
*/
public function createView($viewName, $subquery)
{
$sql = $this->db->getQueryBuilder()->createView($viewName, $subquery);
return $this->setSql($sql)->requireTableSchemaRefresh($viewName);
}
/**
* Drops a SQL View.
*
* @param string $viewName the name of the view to be dropped.
* @return $this the command object itself.
* @since 2.0.14
*/
public function dropView($viewName)
{
$sql = $this->db->getQueryBuilder()->dropView($viewName);
return $this->setSql($sql)->requireTableSchemaRefresh($viewName);
}
/**
* Executes the SQL statement.
* This method should only be used for executing non-query SQL statement, such as `INSERT`, `DELETE`, `UPDATE` SQLs.
* No result set will be returned.

2
framework/db/Migration.php

@ -93,7 +93,7 @@ class Migration extends Component implements MigrationInterface
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.6
*/
protected function getDb()

2
framework/db/Query.php

@ -692,7 +692,7 @@ PATTERN;
*
* The `$condition` parameter should be either a string (e.g. `'id=1'`) or an array.
*
* @inheritdoc
* {@inheritdoc}
*
* @param string|array|Expression $condition the conditions that should be put in the WHERE part.
* @param array $params the parameters (name => value) to be bound to the query.

37
framework/db/QueryBuilder.php

@ -788,6 +788,43 @@ class QueryBuilder extends \yii\base\BaseObject
}
/**
* Creates a SQL View.
*
* @param string $viewName the name of the view to be created.
* @param string|Query $subQuery the select statement which defines the view.
* This can be either a string or a [[Query]] object.
* @return string the `CREATE VIEW` SQL statement.
* @since 2.0.14
*/
public function createView($viewName, $subQuery)
{
if ($subQuery instanceof Query) {
list($rawQuery, $params) = $this->build($subQuery);
array_walk(
$params,
function(&$param) {
$param = $this->db->quoteValue($param);
}
);
$subQuery = strtr($rawQuery, $params);
}
return 'CREATE VIEW ' . $this->db->quoteTableName($viewName) . ' AS ' . $subQuery;
}
/**
* Drops a SQL View.
*
* @param string $viewName the name of the view to be dropped.
* @return string the `DROP VIEW` SQL statement.
* @since 2.0.14
*/
public function dropView($viewName)
{
return 'DROP VIEW ' . $this->db->quoteTableName($viewName);
}
/**
* Converts an abstract column type into a physical column type.
*
* The conversion is done using the type map specified in [[typeMap]].

10
framework/db/cubrid/ColumnSchemaBuilder.php

@ -18,7 +18,7 @@ use yii\db\ColumnSchemaBuilder as AbstractColumnSchemaBuilder;
class ColumnSchemaBuilder extends AbstractColumnSchemaBuilder
{
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function buildUnsignedString()
{
@ -26,7 +26,7 @@ class ColumnSchemaBuilder extends AbstractColumnSchemaBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function buildAfterString()
{
@ -36,7 +36,7 @@ class ColumnSchemaBuilder extends AbstractColumnSchemaBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function buildFirstString()
{
@ -44,7 +44,7 @@ class ColumnSchemaBuilder extends AbstractColumnSchemaBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function buildCommentString()
{
@ -52,7 +52,7 @@ class ColumnSchemaBuilder extends AbstractColumnSchemaBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function __toString()
{

16
framework/db/cubrid/QueryBuilder.php

@ -46,11 +46,11 @@ class QueryBuilder extends \yii\db\QueryBuilder
];
/**
* @inheritdoc
* {@inheritdoc}
*/
protected $likeEscapeCharacter = '!';
/**
* @inheritdoc
* {@inheritdoc}
*/
protected $likeEscapingReplacements = [
'%' => '!%',
@ -90,7 +90,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function buildLimit($limit, $offset)
{
@ -111,7 +111,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function selectExists($rawSql)
@ -155,7 +155,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function addCommentOnColumn($table, $column, $comment)
@ -171,7 +171,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function addCommentOnTable($table, $comment)
@ -180,7 +180,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function dropCommentFromColumn($table, $column)
@ -189,7 +189,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function dropCommentFromTable($table)

6
framework/db/cubrid/Schema.php

@ -229,7 +229,7 @@ class Schema extends \yii\db\Schema
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function releaseSavepoint($name)
{
@ -360,7 +360,7 @@ class Schema extends \yii\db\Schema
}
/**
* @inheritdoc
* {@inheritdoc}
* @see http://www.cubrid.org/manual/91/en/sql/transaction.html#database-concurrency
*/
public function setTransactionIsolationLevel($level)
@ -384,7 +384,7 @@ class Schema extends \yii\db\Schema
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function createColumnSchemaBuilder($type, $length = null)
{

20
framework/db/mssql/QueryBuilder.php

@ -46,7 +46,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
];
/**
* @inheritdoc
* {@inheritdoc}
*/
protected $likeEscapingReplacements = [
'%' => '[%]',
@ -58,7 +58,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
/**
* @inheritdoc
* {@inheritdoc}
*/
public function buildOrderByAndLimit($sql, $orderBy, $limit, $offset, &$params)
{
@ -252,7 +252,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function addCommentOnColumn($table, $column, $comment)
@ -261,7 +261,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function addCommentOnTable($table, $comment)
@ -270,7 +270,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function dropCommentFromColumn($table, $column)
@ -279,7 +279,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function dropCommentFromTable($table)
@ -325,7 +325,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @throws NotSupportedException if `$columns` is an array
*/
protected function buildSubqueryInCondition($operator, $columns, $values, &$params)
@ -371,7 +371,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function selectExists($rawSql)
@ -402,7 +402,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function insert($table, $columns, &$params)
{
@ -410,7 +410,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function update($table, $columns, $condition, &$params)
{

8
framework/db/mssql/Schema.php

@ -248,7 +248,7 @@ SQL;
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function createSavepoint($name)
{
@ -256,7 +256,7 @@ SQL;
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function releaseSavepoint($name)
{
@ -264,7 +264,7 @@ SQL;
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function rollBackSavepoint($name)
{
@ -555,7 +555,7 @@ SQL;
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function findViewNames($schema = '')
{

10
framework/db/mysql/ColumnSchemaBuilder.php

@ -18,7 +18,7 @@ use yii\db\ColumnSchemaBuilder as AbstractColumnSchemaBuilder;
class ColumnSchemaBuilder extends AbstractColumnSchemaBuilder
{
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function buildUnsignedString()
{
@ -26,7 +26,7 @@ class ColumnSchemaBuilder extends AbstractColumnSchemaBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function buildAfterString()
{
@ -36,7 +36,7 @@ class ColumnSchemaBuilder extends AbstractColumnSchemaBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function buildFirstString()
{
@ -44,7 +44,7 @@ class ColumnSchemaBuilder extends AbstractColumnSchemaBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function buildCommentString()
{
@ -52,7 +52,7 @@ class ColumnSchemaBuilder extends AbstractColumnSchemaBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function __toString()
{

18
framework/db/mysql/QueryBuilder.php

@ -85,7 +85,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @see https://bugs.mysql.com/bug.php?id=48875
*/
public function createIndex($name, $table, $columns, $unique = false)
@ -189,7 +189,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function buildLimit($limit, $offset)
{
@ -210,7 +210,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function hasLimit($limit)
{
@ -219,7 +219,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function hasOffset($offset)
{
@ -229,7 +229,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function insert($table, $columns, &$params)
{
@ -276,7 +276,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function addCommentOnColumn($table, $column, $comment)
@ -292,7 +292,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function addCommentOnTable($table, $comment)
@ -301,7 +301,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function dropCommentFromColumn($table, $column)
@ -310,7 +310,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function dropCommentFromTable($table)

8
framework/db/mysql/Schema.php

@ -447,11 +447,11 @@ SQL;
$sql = $this->getCreateTableSql($table);
$uniqueIndexes = [];
$regexp = '/UNIQUE KEY\s+([^\(\s]+)\s*\(([^\(\)]+)\)/mi';
$regexp = '/UNIQUE KEY\s+\`(.+)\`\s*\((\`.+\`)+\)/mi';
if (preg_match_all($regexp, $sql, $matches, PREG_SET_ORDER)) {
foreach ($matches as $match) {
$indexName = str_replace('`', '', $match[1]);
$indexColumns = array_map('trim', explode(',', str_replace('`', '', $match[2])));
$indexName = $match[1];
$indexColumns = array_map('trim', explode('`,`', trim($match[2], '`')));
$uniqueIndexes[$indexName] = $indexColumns;
}
}
@ -460,7 +460,7 @@ SQL;
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function createColumnSchemaBuilder($type, $length = null)
{

4
framework/db/oci/ColumnSchemaBuilder.php

@ -19,7 +19,7 @@ use yii\db\ColumnSchemaBuilder as AbstractColumnSchemaBuilder;
class ColumnSchemaBuilder extends AbstractColumnSchemaBuilder
{
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function buildUnsignedString()
{
@ -27,7 +27,7 @@ class ColumnSchemaBuilder extends AbstractColumnSchemaBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function __toString()
{

20
framework/db/oci/QueryBuilder.php

@ -48,13 +48,13 @@ class QueryBuilder extends \yii\db\QueryBuilder
];
/**
* @inheritdoc
* {@inheritdoc}
*/
protected $likeEscapeCharacter = '!';
/**
* `\` is initialized in [[buildLikeCondition()]] method since
* we need to choose replacement value based on [[\yii\db\Schema::quoteValue()]].
* @inheritdoc
* {@inheritdoc}
*/
protected $likeEscapingReplacements = [
'%' => '!%',
@ -64,7 +64,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
/**
* @inheritdoc
* {@inheritdoc}
*/
public function buildOrderByAndLimit($sql, $orderBy, $limit, $offset, &$params)
{
@ -136,7 +136,7 @@ EOD;
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function resetSequence($table, $value = null)
{
@ -162,7 +162,7 @@ EOD;
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function addForeignKey($name, $table, $columns, $refTable, $refColumns, $delete = null, $update = null)
{
@ -182,7 +182,7 @@ EOD;
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function insert($table, $columns, &$params)
{
@ -297,7 +297,7 @@ EOD;
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function selectExists($rawSql)
@ -306,7 +306,7 @@ EOD;
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function dropCommentFromColumn($table, $column)
@ -315,7 +315,7 @@ EOD;
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function dropCommentFromTable($table)
@ -340,7 +340,7 @@ EOD;
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function buildInCondition($operator, $operands, &$params)
{

12
framework/db/oci/Schema.php

@ -44,7 +44,7 @@ class Schema extends \yii\db\Schema
/**
* @inheritdoc
* {@inheritdoc}
*/
public function init()
{
@ -232,7 +232,7 @@ SQL;
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function releaseSavepoint($name)
{
@ -240,7 +240,7 @@ SQL;
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function quoteSimpleTableName($name)
{
@ -248,7 +248,7 @@ SQL;
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function createQueryBuilder()
{
@ -256,7 +256,7 @@ SQL;
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function createColumnSchemaBuilder($type, $length = null)
{
@ -585,7 +585,7 @@ SQL;
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function insert($table, $columns)
{

6
framework/db/pgsql/QueryBuilder.php

@ -240,7 +240,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function insert($table, $columns, &$params)
{
@ -248,7 +248,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function update($table, $columns, $condition, &$params)
{
@ -283,7 +283,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function batchInsert($table, $columns, $rows)
{

4
framework/db/pgsql/Schema.php

@ -311,7 +311,7 @@ SQL;
}
/**
* @inheritdoc
* {@inheritdoc]
*/
protected function findViewNames($schema = '')
{
@ -589,7 +589,7 @@ SQL;
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function insert($table, $columns)
{

4
framework/db/sqlite/ColumnSchemaBuilder.php

@ -18,7 +18,7 @@ use yii\db\ColumnSchemaBuilder as AbstractColumnSchemaBuilder;
class ColumnSchemaBuilder extends AbstractColumnSchemaBuilder
{
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function buildUnsignedString()
{
@ -26,7 +26,7 @@ class ColumnSchemaBuilder extends AbstractColumnSchemaBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function __toString()
{

4
framework/db/sqlite/Command.php

@ -21,7 +21,7 @@ use yii\helpers\StringHelper;
class Command extends \yii\db\Command
{
/**
* @inheritdoc
* {@inheritdoc}
*/
public function execute()
{
@ -43,7 +43,7 @@ class Command extends \yii\db\Command
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function queryInternal($method, $fetchMode = null)
{

18
framework/db/sqlite/QueryBuilder.php

@ -48,7 +48,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
];
/**
* @inheritdoc
* {@inheritdoc}
*/
protected $likeEscapeCharacter = '\\';
@ -358,7 +358,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @throws NotSupportedException
* @since 2.0.8
*/
@ -368,7 +368,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @throws NotSupportedException
* @since 2.0.8
*/
@ -378,7 +378,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @throws NotSupportedException
* @since 2.0.8
*/
@ -388,7 +388,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @throws NotSupportedException
* @since 2.0.8
*/
@ -398,7 +398,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function buildLimit($limit, $offset)
{
@ -418,7 +418,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
* @throws NotSupportedException if `$columns` is an array
*/
protected function buildSubqueryInCondition($operator, $columns, $values, &$params)
@ -464,7 +464,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function build($query, $params = [])
{
@ -493,7 +493,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function buildUnion($unions, &$params)
{

2
framework/db/sqlite/Schema.php

@ -222,7 +222,7 @@ class Schema extends \yii\db\Schema
}
/**
* @inheritdoc
* {@inheritdoc}
* @return ColumnSchemaBuilder column schema builder instance
*/
public function createColumnSchemaBuilder($type, $length = null)

2
framework/di/NotInstantiableException.php

@ -19,7 +19,7 @@ use yii\base\InvalidConfigException;
class NotInstantiableException extends InvalidConfigException
{
/**
* @inheritdoc
* {@inheritdoc}
*/
public function __construct($class, $message = null, $code = 0, \Exception $previous = null)
{

4
framework/filters/AjaxFilter.php

@ -43,7 +43,7 @@ class AjaxFilter extends ActionFilter
/**
* @inheritdoc
* {@inheritdoc}
*/
public function init()
{
@ -53,7 +53,7 @@ class AjaxFilter extends ActionFilter
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function beforeAction($action)
{

4
framework/filters/ContentNegotiator.php

@ -130,7 +130,7 @@ class ContentNegotiator extends ActionFilter implements BootstrapInterface
/**
* @inheritdoc
* {@inheritdoc}
*/
public function bootstrap($app)
{
@ -138,7 +138,7 @@ class ContentNegotiator extends ActionFilter implements BootstrapInterface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function beforeAction($action)
{

2
framework/filters/Cors.php

@ -93,7 +93,7 @@ class Cors extends ActionFilter
/**
* @inheritdoc
* {@inheritdoc}
*/
public function beforeAction($action)
{

2
framework/filters/HostControl.php

@ -117,7 +117,7 @@ class HostControl extends ActionFilter
/**
* @inheritdoc
* {@inheritdoc}
*/
public function beforeAction($action)
{

2
framework/filters/PageCache.php

@ -134,7 +134,7 @@ class PageCache extends ActionFilter
/**
* @inheritdoc
* {@inheritdoc}
*/
public function init()
{

8
framework/filters/RateLimiter.php

@ -63,7 +63,7 @@ class RateLimiter extends ActionFilter
/**
* @inheritdoc
* {@inheritdoc}
*/
public function init()
{
@ -76,7 +76,7 @@ class RateLimiter extends ActionFilter
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function beforeAction($action)
{
@ -106,11 +106,11 @@ class RateLimiter extends ActionFilter
*/
public function checkRateLimit($user, $request, $response, $action)
{
$current = time();
[$limit, $window] = $user->getRateLimit($request, $action);
[$allowance, $timestamp] = $user->loadAllowance($request, $action);
$current = time();
$allowance += (int) (($current - $timestamp) * $limit / $window);
if ($allowance > $limit) {
$allowance = $limit;

6
framework/filters/auth/AuthMethod.php

@ -48,7 +48,7 @@ abstract class AuthMethod extends ActionFilter implements AuthInterface
/**
* @inheritdoc
* {@inheritdoc}
*/
public function beforeAction($action)
{
@ -79,14 +79,14 @@ abstract class AuthMethod extends ActionFilter implements AuthInterface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function challenge($response)
{
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function handleFailure($response)
{

6
framework/filters/auth/CompositeAuth.php

@ -50,7 +50,7 @@ class CompositeAuth extends AuthMethod
/**
* @inheritdoc
* {@inheritdoc}
*/
public function beforeAction($action)
{
@ -58,7 +58,7 @@ class CompositeAuth extends AuthMethod
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function authenticate($user, $request, $response)
{
@ -80,7 +80,7 @@ class CompositeAuth extends AuthMethod
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function challenge($response)
{

4
framework/filters/auth/HttpBasicAuth.php

@ -87,7 +87,7 @@ class HttpBasicAuth extends AuthMethod
/**
* @inheritdoc
* {@inheritdoc}
*/
public function authenticate($user, $request, $response)
{
@ -117,7 +117,7 @@ class HttpBasicAuth extends AuthMethod
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function challenge($response)
{

9
framework/filters/auth/HttpBearerAuth.php

@ -29,22 +29,21 @@ namespace yii\filters\auth;
class HttpBearerAuth extends HttpHeaderAuth
{
/**
* @inheritdoc
* {@inheritdoc}
*/
public $header = 'Authorization';
/**
* @inheritdoc
* {@inheritdoc}
*/
public $pattern = '/^Bearer\s+(.*?)$/';
/**
* @var string the HTTP authentication realm
*/
public $realm = 'api';
/**
* @inheritdoc
* {@inheritdoc}
*/
public function challenge($response)
{

3
framework/filters/auth/HttpHeaderAuth.php

@ -44,7 +44,7 @@ class HttpHeaderAuth extends AuthMethod
/**
* @inheritdoc
* {@inheritdoc}
*/
public function authenticate($user, $request, $response)
{
@ -56,6 +56,7 @@ class HttpHeaderAuth extends AuthMethod
}
$identity = $user->loginByAccessToken($authHeader, get_class($this));
if ($identity === null) {
$this->challenge($response);
$this->handleFailure($response);
}

2
framework/filters/auth/QueryParamAuth.php

@ -22,7 +22,7 @@ class QueryParamAuth extends AuthMethod
/**
* @inheritdoc
* {@inheritdoc}
*/
public function authenticate($user, $request, $response)
{

6
framework/grid/ActionColumn.php

@ -34,7 +34,7 @@ use yii\helpers\Url;
class ActionColumn extends Column
{
/**
* @inheritdoc
* {@inheritdoc}
*/
public $headerOptions = ['class' => 'action-column'];
/**
@ -129,7 +129,7 @@ class ActionColumn extends Column
/**
* @inheritdoc
* {@inheritdoc}
*/
public function init()
{
@ -207,7 +207,7 @@ class ActionColumn extends Column
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function renderDataCellContent($model, $key, $index)
{

4
framework/grid/CheckboxColumn.php

@ -77,7 +77,7 @@ class CheckboxColumn extends Column
/**
* @inheritdoc
* {@inheritdoc}
* @throws \yii\base\InvalidConfigException if [[name]] is not set.
*/
public function init()
@ -109,7 +109,7 @@ class CheckboxColumn extends Column
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function renderDataCellContent($model, $key, $index)
{

8
framework/grid/DataColumn.php

@ -122,7 +122,7 @@ class DataColumn extends Column
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function renderHeaderCellContent()
{
@ -144,7 +144,7 @@ class DataColumn extends Column
}
/**
* @inheritdoc
* {@inheritdoc]
* @since 2.0.8
*/
protected function getHeaderCellLabel()
@ -181,7 +181,7 @@ class DataColumn extends Column
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function renderFilterCellContent()
{
@ -242,7 +242,7 @@ class DataColumn extends Column
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function renderDataCellContent($model, $key, $index)
{

21
framework/grid/GridView.php

@ -125,6 +125,11 @@ class GridView extends BaseListView
* @var bool whether to show the footer section of the grid table.
*/
public $showFooter = false;
/**
* @var bool whether to place footer after body in DOM if $showFooter is true
* @since 2.0.14
*/
public $placeFooterAfterBody = false;
/**
* @var bool whether to show the grid view if [[dataProvider]] returns no data.
*/
@ -286,7 +291,7 @@ class GridView extends BaseListView
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function renderSection($name)
{
@ -307,13 +312,25 @@ class GridView extends BaseListView
$columnGroup = $this->renderColumnGroup();
$tableHeader = $this->showHeader ? $this->renderTableHeader() : false;
$tableBody = $this->renderTableBody();
$tableFooter = $this->showFooter ? $this->renderTableFooter() : false;
$tableFooter = false;
$tableFooterAfterBody = false;
if ($this->showFooter) {
if ($this->placeFooterAfterBody) {
$tableFooterAfterBody = $this->renderTableFooter();
} else {
$tableFooter = $this->renderTableFooter();
}
}
$content = array_filter([
$caption,
$columnGroup,
$tableHeader,
$tableFooter,
$tableBody,
$tableFooterAfterBody,
]);
return Html::tag('table', implode("\n", $content), $this->tableOptions);

4
framework/grid/RadioButtonColumn.php

@ -64,7 +64,7 @@ class RadioButtonColumn extends Column
/**
* @inheritdoc
* {@inheritdoc}
* @throws \yii\base\InvalidConfigException if [[name]] is not set.
*/
public function init()
@ -76,7 +76,7 @@ class RadioButtonColumn extends Column
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function renderDataCellContent($model, $key, $index)
{

4
framework/grid/SerialColumn.php

@ -30,13 +30,13 @@ namespace yii\grid;
class SerialColumn extends Column
{
/**
* @inheritdoc
* {@inheritdoc}
*/
public $header = '#';
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function renderDataCellContent($model, $key, $index)
{

2
framework/helpers/BaseArrayHelper.php

@ -779,7 +779,7 @@ class BaseArrayHelper
* @param array $array the array being checked
* @param bool $consecutive whether the array keys must be a consecutive sequence
* in order for the array to be treated as indexed.
* @return bool whether the array is associative
* @return bool whether the array is indexed
*/
public static function isIndexed($array, $consecutive = false)
{

3
framework/helpers/BaseConsole.php

@ -863,7 +863,8 @@ class BaseConsole
* a list of options to choose from and their explanations.
*
* @param string $prompt the prompt message
* @param array $options Key-value array of options to choose from
* @param array $options Key-value array of options to choose from. Key is what is inputed and used, value is
* what's displayed to end user by help command.
*
* @return string An option character the user chose
*/

16
framework/helpers/BaseHtml.php

@ -1430,22 +1430,29 @@ class BaseHtml
* Generates a file input tag for the given model attribute.
* This method will generate the "name" and "value" tag attributes automatically for the model attribute
* unless they are explicitly specified in `$options`.
* Additionally, if a separate set of HTML options array is defined inside `$options` with a key named `hiddenOptions`,
* it will be passed to the `activeHiddenInput` field as its own `$options` parameter.
* @param Model $model the model object
* @param string $attribute the attribute name or expression. See [[getAttributeName()]] for the format
* about attribute expression.
* @param array $options the tag options in terms of name-value pairs. These will be rendered as
* the attributes of the resulting tag. The values will be HTML-encoded using [[encode()]].
* See [[renderTagAttributes()]] for details on how attributes are being rendered.
* If `hiddenOptions` parameter which is another set of HTML options array is defined, it will be extracted
* from `$options` to be used for the hidden input.
* @return string the generated input tag
*/
public static function activeFileInput($model, $attribute, $options = [])
{
// add a hidden field so that if a model only has a file field, we can
// still use isset($_POST[$modelClass]) to detect if the input is submitted
$hiddenOptions = ['id' => null, 'value' => ''];
if (isset($options['name'])) {
$hiddenOptions['name'] = $options['name'];
}
$hiddenOptions = ArrayHelper::merge($hiddenOptions, ArrayHelper::remove($options, 'hiddenOptions', []));
// add a hidden field so that if a model only has a file field, we can
// still use isset($_POST[$modelClass]) to detect if the input is submitted.
// The hidden input will be assigned its own set of html options via `$hiddenOptions`.
// This provides the possibility to interact with the hidden field via client script.
return static::activeHiddenInput($model, $attribute, $hiddenOptions)
. static::activeInput('file', $model, $attribute, $options);
@ -1873,6 +1880,7 @@ class BaseHtml
* @return string the rendering result. If the attributes are not empty, they will be rendered
* into a string with a leading white space (so that it can be directly appended to the tag name
* in a tag. If there is no attribute, an empty string will be returned.
* @see addCssClass()
*/
public static function renderTagAttributes($attributes)
{
@ -1937,6 +1945,8 @@ class BaseHtml
*
* @param array $options the options to be modified.
* @param string|array $class the CSS class(es) to be added
* @see mergeCssClasses()
* @see removeCssClass()
*/
public static function addCssClass(&$options, $class)
{
@ -1958,6 +1968,7 @@ class BaseHtml
* @param array $existingClasses already existing CSS classes.
* @param array $additionalClasses CSS classes to be added.
* @return array merge result.
* @see addCssClass()
*/
private static function mergeCssClasses(array $existingClasses, array $additionalClasses)
{
@ -1976,6 +1987,7 @@ class BaseHtml
* Removes a CSS class from the specified options.
* @param array $options the options to be modified.
* @param string|array $class the CSS class(es) to be removed
* @see addCssClass()
*/
public static function removeCssClass(&$options, $class)
{

2
framework/i18n/Formatter.php

@ -371,7 +371,7 @@ class Formatter extends Component
/**
* @inheritdoc
* {@inheritdoc}
*/
public function init()
{

4
framework/i18n/MessageFormatter.php

@ -313,6 +313,10 @@ class MessageFormatter extends Component
$tokens[] = mb_substr($pattern, $start, $open - $start, $charset);
$start = $open;
}
if ($depth !== 0 && ($open === false || $close === false)) {
break;
}
}
if ($depth !== 0) {
return false;

2
framework/log/EmailTarget.php

@ -59,7 +59,7 @@ class EmailTarget extends Target
/**
* @inheritdoc
* {@inheritdoc}
*/
public function init()
{

4
framework/log/SyslogTarget.php

@ -50,7 +50,7 @@ class SyslogTarget extends Target
/**
* @inheritdoc
* {@inheritdoc}
*/
public function init()
{
@ -73,7 +73,7 @@ class SyslogTarget extends Target
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function formatMessage($message)
{

3
framework/log/Target.php

@ -80,6 +80,9 @@ abstract class Target extends Component
* - `var.key` - only `var[key]` key will be logged.
* - `!var.key` - `var[key]` key will be excluded.
*
* Note that if you need $_SESSION to logged regardless if session was used you have to open it right at
* the start of your request.
*
* @see \yii\helpers\ArrayHelper::filter()
*/
public $logVars = ['_GET', '_POST', '_FILES', '_COOKIE', '_SESSION', '_SERVER'];

18
framework/rbac/BaseManager.php

@ -96,7 +96,7 @@ abstract class BaseManager extends Component implements ManagerInterface
abstract protected function updateRule($name, $rule);
/**
* @inheritdoc
* {@inheritdoc}
*/
public function createRole($name)
{
@ -106,7 +106,7 @@ abstract class BaseManager extends Component implements ManagerInterface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function createPermission($name)
{
@ -116,7 +116,7 @@ abstract class BaseManager extends Component implements ManagerInterface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function add($object)
{
@ -136,7 +136,7 @@ abstract class BaseManager extends Component implements ManagerInterface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function remove($object)
{
@ -150,7 +150,7 @@ abstract class BaseManager extends Component implements ManagerInterface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function update($name, $object)
{
@ -170,7 +170,7 @@ abstract class BaseManager extends Component implements ManagerInterface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getRole($name)
{
@ -179,7 +179,7 @@ abstract class BaseManager extends Component implements ManagerInterface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getPermission($name)
{
@ -188,7 +188,7 @@ abstract class BaseManager extends Component implements ManagerInterface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getRoles()
{
@ -241,7 +241,7 @@ abstract class BaseManager extends Component implements ManagerInterface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getPermissions()
{

62
framework/rbac/DbManager.php

@ -118,7 +118,7 @@ class DbManager extends BaseManager
private $_checkAccessAssignments = [];
/**
* @inheritdoc
* {@inheritdoc}
*/
public function checkAccess($userId, $permissionName, $params = [])
{
@ -226,7 +226,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function getItem($name)
{
@ -260,7 +260,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function addItem($item)
{
@ -288,7 +288,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function removeItem($item)
{
@ -311,7 +311,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function updateItem($name, $item)
{
@ -346,7 +346,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function addRule($rule)
{
@ -371,7 +371,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function updateRule($name, $rule)
{
@ -398,7 +398,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function removeRule($rule)
{
@ -418,7 +418,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function getItems($type)
{
@ -459,7 +459,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
* The roles returned by this method include the roles assigned via [[$defaultRoles]].
*/
public function getRolesByUser($userId)
@ -483,7 +483,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getChildRoles($roleName)
{
@ -506,7 +506,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getPermissionsByRole($roleName)
{
@ -529,7 +529,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getPermissionsByUser($userId)
{
@ -632,7 +632,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getRule($name)
{
@ -656,7 +656,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getRules()
{
@ -679,7 +679,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getAssignment($roleName, $userId)
{
@ -703,7 +703,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getAssignments($userId)
{
@ -728,7 +728,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function canAddChild($parent, $child)
@ -737,7 +737,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function addChild($parent, $child)
{
@ -763,7 +763,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function removeChild($parent, $child)
{
@ -777,7 +777,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function removeChildren($parent)
{
@ -791,7 +791,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function hasChild($parent, $child)
{
@ -802,7 +802,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getChildren($name)
{
@ -840,7 +840,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function assign($role, $userId)
{
@ -862,7 +862,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function revoke($role, $userId)
{
@ -877,7 +877,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function revokeAll($userId)
{
@ -892,7 +892,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function removeAll()
{
@ -904,7 +904,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function removeAllPermissions()
{
@ -912,7 +912,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function removeAllRoles()
{
@ -950,7 +950,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function removeAllRules()
{
@ -966,7 +966,7 @@ class DbManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function removeAllAssignments()
{

2
framework/rbac/Permission.php

@ -16,7 +16,7 @@ namespace yii\rbac;
class Permission extends Item
{
/**
* @inheritdoc
* {@inheritdoc}
*/
public $type = self::TYPE_PERMISSION;
}

64
framework/rbac/PhpManager.php

@ -91,7 +91,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function checkAccess($userId, $permissionName, $params = [])
{
@ -105,7 +105,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getAssignments($userId)
{
@ -153,7 +153,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.8
*/
public function canAddChild($parent, $child)
@ -162,7 +162,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function addChild($parent, $child)
{
@ -215,7 +215,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function removeChild($parent, $child)
{
@ -229,7 +229,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function removeChildren($parent)
{
@ -243,7 +243,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function hasChild($parent, $child)
{
@ -251,7 +251,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function assign($role, $userId)
{
@ -272,7 +272,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function revoke($role, $userId)
{
@ -286,7 +286,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function revokeAll($userId)
{
@ -302,7 +302,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getAssignment($roleName, $userId)
{
@ -310,7 +310,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getItems($type)
{
@ -328,7 +328,7 @@ class PhpManager extends BaseManager
/**
* @inheritdoc
* {@inheritdoc}
*/
public function removeItem($item)
{
@ -349,7 +349,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getItem($name)
{
@ -357,7 +357,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function updateRule($name, $rule)
{
@ -370,7 +370,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getRule($name)
{
@ -378,7 +378,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getRules()
{
@ -386,7 +386,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
* The roles returned by this method include the roles assigned via [[$defaultRoles]].
*/
public function getRolesByUser($userId)
@ -403,7 +403,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getChildRoles($roleName)
{
@ -426,7 +426,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getPermissionsByRole($roleName)
{
@ -462,7 +462,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getPermissionsByUser($userId)
{
@ -520,7 +520,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getChildren($name)
{
@ -528,7 +528,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function removeAll()
{
@ -540,7 +540,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function removeAllPermissions()
{
@ -548,7 +548,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function removeAllRoles()
{
@ -596,7 +596,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function removeAllRules()
{
@ -608,7 +608,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function removeAllAssignments()
{
@ -617,7 +617,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function removeRule($rule)
{
@ -636,7 +636,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function addRule($rule)
{
@ -646,7 +646,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function updateItem($name, $item)
{
@ -685,7 +685,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
*/
protected function addItem($item)
{
@ -863,7 +863,7 @@ class PhpManager extends BaseManager
}
/**
* @inheritdoc
* {@inheritdoc}
* @since 2.0.7
*/
public function getUserIdsByRole($roleName)

2
framework/rbac/Role.php

@ -16,7 +16,7 @@ namespace yii\rbac;
class Role extends Item
{
/**
* @inheritdoc
* {@inheritdoc}
*/
public $type = self::TYPE_ROLE;
}

4
framework/rbac/migrations/m140506_102106_rbac_init.php

@ -44,7 +44,7 @@ class m140506_102106_rbac_init extends \yii\db\Migration
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function up()
{
@ -137,7 +137,7 @@ class m140506_102106_rbac_init extends \yii\db\Migration
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function down()
{

4
framework/rbac/migrations/m170907_052038_rbac_add_index_on_auth_assignment_user_id.php

@ -37,7 +37,7 @@ class m170907_052038_rbac_add_index_on_auth_assignment_user_id extends Migration
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function up()
{
@ -46,7 +46,7 @@ class m170907_052038_rbac_add_index_on_auth_assignment_user_id extends Migration
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function down()
{

2
framework/rest/Action.php

@ -60,7 +60,7 @@ class Action extends \yii\base\Action
/**
* @inheritdoc
* {@inheritdoc}
*/
public function init()
{

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save