diff --git a/framework/BaseYii.php b/framework/BaseYii.php index 3053f93799f..9d3dc781c8d 100644 --- a/framework/BaseYii.php +++ b/framework/BaseYii.php @@ -93,7 +93,7 @@ class BaseYii */ public static function getVersion() { - return '2.0.13-dev'; + return '2.0.13'; } /** diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 6d0a46dc047..502184ede83 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -12,6 +12,7 @@ Yii Framework 2 Change Log - Bug #11825: User can login by cookie only once when `autoRenewCookie` is set to false (shirase, silverfire) - Bug #12860: Fixed possible race conditions in `yii\mutex\FileMutex` (kidol) - Bug #13258: Fixed `yii\mutex\FileMutex::$autoRelease` having no effect due to missing base class initialization (kidol) +- Bug #13436: Fixed migration for MSSQL DbSession (silverfire) - Bug #13564: Fixed `yii\web\Request::getAuthUser()`, `getAuthPassword()` to respect `HTTP_AUTHORIZATION` request header (silverfire) - Bug #13720: Improve `yii\helpers\FormatConverter::convertDatePhpToIcu()` to handle escaped chars correctly (rob006) - Bug #13757: Fixed ambiguous column error in `BaseActiveRecord::refresh()` when the query adds a JOIN by default (cebe, ivankff) @@ -22,6 +23,7 @@ Yii Framework 2 Change Log - Bug #14129: Fixed console help to properly work with tricky camelcased controller names (samdark, silverfire) - Bug #14134: Fixed multiple `validateAttribute()` calls when `scenarios()` returns duplicate attributes (krukru) - Bug #14165: Set `_slave` of `Connection` to `false` instead of `null` in `close` method (rossoneri) +- Bug #14186: Forced validation in `yiiActiveForm` do not trigger `afterValidate` event (arogachev) - Bug #14192: Fixed wrong default null value for TIMESTAMP when using PostgreSQL (Tigrov) - Bug #14202: Fixed current time in (UTC) `\Yii::$app->formatter` if time not set (bscheshirwork) - Bug #14206: `MySqlMutex`, `PgsqlMutex` and `OracleMutex` now use `useMaster()` to ensure lock is aquired on the same DB server (cebe, ryusoft) @@ -40,6 +42,7 @@ Yii Framework 2 Change Log - Bug #14471: `ContentNegotiator` will always set one of the configured server response formats even if the client does not accept any of them (PowerGamer1) - Bug #14492: Fixed error handler not escaping error info in debug mode, see CVE-2017-11516 (samdark) - Bug #14493: Fixed getting permissions in `yii\rbac\Dbmanger::getPermissionsByUser` by user with id equals 0 (dmirogin) +- Bug #14510: The state of a form is always "not validated" when using forced validation in `yiiActiveForm` (arogachev) - Bug #14523: Added `yii\web\MultipartFormDataParser::$force` option allowing to enforce parsing even on 'POST' request (klimov-paul) - Bug #14525: Fixed 2.0.12 regression of loading of global fixtures trough `yii fixture/load` (michaelarnauts) - Bug #14533: Fixed `yii\validators\ExistValidator` and `yii\validators\UniqueValidator` throw exception in case they are set for `yii\db\ActiveRecord` with `$targetClass` pointing to NOSQL ActiveRecord (klimov-paul) @@ -57,9 +60,11 @@ Yii Framework 2 Change Log - Enh #6644: Added `yii\helpers\ArrayHelper::setValue()` (LAV45) - Enh #7823: Added `yii\filters\AjaxFilter` filter (dmirogin) - Enh #9438: `yii\web\DbSession` now relies on error handler to display errors (samdark) +- Enh #9703, #9709: Added `yii\i18n\Formatter::asWeight()` and `::asLength()` formatters (nineinchnick, silverfire) - Enh #11415: Added `yii\console\widgets\Table` to draw tables in console apps (pana1990, rob006, samdark, tonykor) - Enh #13254: Made `yii\helpers\StringHelper` and `yii\validators\StringValidator` independent of `Yii::$app` instance (cebe) - Enh #13378: Added `yii\behaviors\SluggableBehaviour::skipOnEmpty` option (andrewnester) +- Enh #13403: Added 'permissions' additionally to 'roles' in `yii\filters\AccessRule` in order to be able to specify these separately (thyseus) - Enh #13486: Use DI container to instantiate cookies in order to be able to set defaults (samdark) - Enh #13586: Added `$preserveNonEmptyValues` property to the `yii\behaviors\AttributeBehavior` (Kolyunya) - Enh #13780: Added support for trusted proxies in `yii\web\Request` (sammousa, cebe, silverfire) @@ -92,6 +97,7 @@ Yii Framework 2 Change Log - Enh #14877: Disabled profiling on connection opening when profiling is disabled (njasm) - Enh #14913: Assset hashing now takes asset linking into account to improve cache busting (schmunk42) - Enh #14929: Ensure trailing `;` on combining files with `asset` command to fix compiler failures (tanakahisateru) +- Enh #14958: Added options to copy stacktrace and search for error message to the exception page (cebe) - Enh #14967: Added Armenian Translations (gevorgmansuryan) - Enh #15015: Added `StringHelper::floatToString()` to safely cast float values independent of the locale, also fixes some places in the framework that use it now (cebe) - Chg #7936: Deprecate `yii\base\Object` in favor of `yii\base\BaseObject` for compatibility with PHP 7.2 (rob006, cebe, klimov-paul) @@ -99,12 +105,7 @@ Yii Framework 2 Change Log - Chg #14286: Used primary inputmask package name instead of an alias (samdark) - Chg #14321: `yii\widgets\MaskedInput` is now registering its JavaScript `clientOptions` initialization code in head section (DaveFerger) - Chg #14487: Changed i18n message error to warning (dmirogin) -- Bug #13436: Fixed migration for MSSQL DbSession (silverfire) -- Bug #14186: Forced validation in `yiiActiveForm` do not trigger `afterValidate` event (arogachev) -- Bug #14510: The state of a form is always "not validated" when using forced validation in `yiiActiveForm` (arogachev) -- Enh #13403: Added 'permissions' additionally to 'roles' in `yii\filters\AccessRule` in order to be able to specify these separately (thyseus) -- Enh #14958: Added options to copy stacktrace and search for error message to the exception page (cebe) -- Enh #9703, #9709: Added `yii\i18n\Formatter::asWeight()` and `::asLength()` formatters (nineinchnick, silverfire) + 2.0.12 June 05, 2017 -------------------- diff --git a/framework/base/Application.php b/framework/base/Application.php index d7b91c30527..7bf81104efc 100644 --- a/framework/base/Application.php +++ b/framework/base/Application.php @@ -19,8 +19,8 @@ * @property \yii\rbac\ManagerInterface $authManager The auth manager application component. Null is returned * if auth manager is not configured. This property is read-only. * @property string $basePath The root directory of the application. - * @property \yii\caching\CacheInterface $cache The cache application component. Null if the component is not enabled. - * This property is read-only. + * @property \yii\caching\CacheInterface $cache The cache application component. Null if the component is not + * enabled. This property is read-only. * @property array $container Values given in terms of name-value pairs. This property is write-only. * @property \yii\db\Connection $db The database connection. This property is read-only. * @property \yii\web\ErrorHandler|\yii\console\ErrorHandler $errorHandler The error handler application diff --git a/framework/classes.php b/framework/classes.php index 1ad1ffaddf4..85938dc781e 100644 --- a/framework/classes.php +++ b/framework/classes.php @@ -18,6 +18,7 @@ 'yii\base\ArrayAccessTrait' => YII2_PATH . '/base/ArrayAccessTrait.php', 'yii\base\Arrayable' => YII2_PATH . '/base/Arrayable.php', 'yii\base\ArrayableTrait' => YII2_PATH . '/base/ArrayableTrait.php', + 'yii\base\BaseObject' => YII2_PATH . '/base/BaseObject.php', 'yii\base\Behavior' => YII2_PATH . '/base/Behavior.php', 'yii\base\BootstrapInterface' => YII2_PATH . '/base/BootstrapInterface.php', 'yii\base\Component' => YII2_PATH . '/base/Component.php', @@ -40,10 +41,11 @@ 'yii\base\Module' => YII2_PATH . '/base/Module.php', 'yii\base\NotSupportedException' => YII2_PATH . '/base/NotSupportedException.php', 'yii\base\Object' => YII2_PATH . '/base/Object.php', - 'yii\base\BaseObject' => YII2_PATH . '/base/BaseObject.php', 'yii\base\Request' => YII2_PATH . '/base/Request.php', 'yii\base\Response' => YII2_PATH . '/base/Response.php', 'yii\base\Security' => YII2_PATH . '/base/Security.php', + 'yii\base\StaticInstanceInterface' => YII2_PATH . '/base/StaticInstanceInterface.php', + 'yii\base\StaticInstanceTrait' => YII2_PATH . '/base/StaticInstanceTrait.php', 'yii\base\Theme' => YII2_PATH . '/base/Theme.php', 'yii\base\UnknownClassException' => YII2_PATH . '/base/UnknownClassException.php', 'yii\base\UnknownMethodException' => YII2_PATH . '/base/UnknownMethodException.php', @@ -58,12 +60,14 @@ 'yii\base\WidgetEvent' => YII2_PATH . '/base/WidgetEvent.php', 'yii\behaviors\AttributeBehavior' => YII2_PATH . '/behaviors/AttributeBehavior.php', 'yii\behaviors\AttributeTypecastBehavior' => YII2_PATH . '/behaviors/AttributeTypecastBehavior.php', + 'yii\behaviors\AttributesBehavior' => YII2_PATH . '/behaviors/AttributesBehavior.php', 'yii\behaviors\BlameableBehavior' => YII2_PATH . '/behaviors/BlameableBehavior.php', 'yii\behaviors\SluggableBehavior' => YII2_PATH . '/behaviors/SluggableBehavior.php', 'yii\behaviors\TimestampBehavior' => YII2_PATH . '/behaviors/TimestampBehavior.php', 'yii\caching\ApcCache' => YII2_PATH . '/caching/ApcCache.php', 'yii\caching\ArrayCache' => YII2_PATH . '/caching/ArrayCache.php', 'yii\caching\Cache' => YII2_PATH . '/caching/Cache.php', + 'yii\caching\CacheInterface' => YII2_PATH . '/caching/CacheInterface.php', 'yii\caching\ChainedDependency' => YII2_PATH . '/caching/ChainedDependency.php', 'yii\caching\DbCache' => YII2_PATH . '/caching/DbCache.php', 'yii\caching\DbDependency' => YII2_PATH . '/caching/DbDependency.php', @@ -83,9 +87,11 @@ 'yii\captcha\CaptchaAction' => YII2_PATH . '/captcha/CaptchaAction.php', 'yii\captcha\CaptchaAsset' => YII2_PATH . '/captcha/CaptchaAsset.php', 'yii\captcha\CaptchaValidator' => YII2_PATH . '/captcha/CaptchaValidator.php', + 'yii\data\ActiveDataFilter' => YII2_PATH . '/data/ActiveDataFilter.php', 'yii\data\ActiveDataProvider' => YII2_PATH . '/data/ActiveDataProvider.php', 'yii\data\ArrayDataProvider' => YII2_PATH . '/data/ArrayDataProvider.php', 'yii\data\BaseDataProvider' => YII2_PATH . '/data/BaseDataProvider.php', + 'yii\data\DataFilter' => YII2_PATH . '/data/DataFilter.php', 'yii\data\DataProviderInterface' => YII2_PATH . '/data/DataProviderInterface.php', 'yii\data\Pagination' => YII2_PATH . '/data/Pagination.php', 'yii\data\Sort' => YII2_PATH . '/data/Sort.php', @@ -99,13 +105,19 @@ 'yii\db\AfterSaveEvent' => YII2_PATH . '/db/AfterSaveEvent.php', 'yii\db\BaseActiveRecord' => YII2_PATH . '/db/BaseActiveRecord.php', 'yii\db\BatchQueryResult' => YII2_PATH . '/db/BatchQueryResult.php', + 'yii\db\CheckConstraint' => YII2_PATH . '/db/CheckConstraint.php', 'yii\db\ColumnSchema' => YII2_PATH . '/db/ColumnSchema.php', 'yii\db\ColumnSchemaBuilder' => YII2_PATH . '/db/ColumnSchemaBuilder.php', 'yii\db\Command' => YII2_PATH . '/db/Command.php', 'yii\db\Connection' => YII2_PATH . '/db/Connection.php', + 'yii\db\Constraint' => YII2_PATH . '/db/Constraint.php', + 'yii\db\ConstraintFinderTrait' => YII2_PATH . '/db/ConstraintFinderTrait.php', 'yii\db\DataReader' => YII2_PATH . '/db/DataReader.php', + 'yii\db\DefaultValueConstraint' => YII2_PATH . '/db/DefaultValueConstraint.php', 'yii\db\Exception' => YII2_PATH . '/db/Exception.php', 'yii\db\Expression' => YII2_PATH . '/db/Expression.php', + 'yii\db\ForeignKeyConstraint' => YII2_PATH . '/db/ForeignKeyConstraint.php', + 'yii\db\IndexConstraint' => YII2_PATH . '/db/IndexConstraint.php', 'yii\db\IntegrityException' => YII2_PATH . '/db/IntegrityException.php', 'yii\db\Migration' => YII2_PATH . '/db/Migration.php', 'yii\db\MigrationInterface' => YII2_PATH . '/db/MigrationInterface.php', @@ -115,6 +127,8 @@ 'yii\db\QueryTrait' => YII2_PATH . '/db/QueryTrait.php', 'yii\db\Schema' => YII2_PATH . '/db/Schema.php', 'yii\db\SchemaBuilderTrait' => YII2_PATH . '/db/SchemaBuilderTrait.php', + 'yii\db\SqlToken' => YII2_PATH . '/db/SqlToken.php', + 'yii\db\SqlTokenizer' => YII2_PATH . '/db/SqlTokenizer.php', 'yii\db\StaleObjectException' => YII2_PATH . '/db/StaleObjectException.php', 'yii\db\TableSchema' => YII2_PATH . '/db/TableSchema.php', 'yii\db\Transaction' => YII2_PATH . '/db/Transaction.php', @@ -138,12 +152,14 @@ 'yii\db\sqlite\ColumnSchemaBuilder' => YII2_PATH . '/db/sqlite/ColumnSchemaBuilder.php', 'yii\db\sqlite\QueryBuilder' => YII2_PATH . '/db/sqlite/QueryBuilder.php', 'yii\db\sqlite\Schema' => YII2_PATH . '/db/sqlite/Schema.php', + 'yii\db\sqlite\SqlTokenizer' => YII2_PATH . '/db/sqlite/SqlTokenizer.php', 'yii\di\Container' => YII2_PATH . '/di/Container.php', 'yii\di\Instance' => YII2_PATH . '/di/Instance.php', 'yii\di\NotInstantiableException' => YII2_PATH . '/di/NotInstantiableException.php', 'yii\di\ServiceLocator' => YII2_PATH . '/di/ServiceLocator.php', 'yii\filters\AccessControl' => YII2_PATH . '/filters/AccessControl.php', 'yii\filters\AccessRule' => YII2_PATH . '/filters/AccessRule.php', + 'yii\filters\AjaxFilter' => YII2_PATH . '/filters/AjaxFilter.php', 'yii\filters\ContentNegotiator' => YII2_PATH . '/filters/ContentNegotiator.php', 'yii\filters\Cors' => YII2_PATH . '/filters/Cors.php', 'yii\filters\HostControl' => YII2_PATH . '/filters/HostControl.php', diff --git a/framework/console/ExitCode.php b/framework/console/ExitCode.php index f1d39055733..b67f3e74e73 100644 --- a/framework/console/ExitCode.php +++ b/framework/console/ExitCode.php @@ -145,6 +145,7 @@ class ExitCode self::CONFIG => 'Configuration error', ]; + /** * Returns a short reason text for the given exit code. * diff --git a/framework/console/controllers/BaseMigrateController.php b/framework/console/controllers/BaseMigrateController.php index a0f9026f504..e779ec86ace 100644 --- a/framework/console/controllers/BaseMigrateController.php +++ b/framework/console/controllers/BaseMigrateController.php @@ -31,7 +31,6 @@ abstract class BaseMigrateController extends Controller */ const BASE_MIGRATION = 'm000000_000000_base'; - /** * @var string the default command action. */ @@ -84,7 +83,6 @@ abstract class BaseMigrateController extends Controller * or a file path. */ public $templateFile; - /** * @var bool indicates whether the console output should be compacted. * If this is set to true, the individual commands ran within the migration will not be output to the console. @@ -93,6 +91,7 @@ abstract class BaseMigrateController extends Controller */ public $compact = false; + /** * @inheritdoc */ diff --git a/framework/console/controllers/MigrateController.php b/framework/console/controllers/MigrateController.php index 54e51945c7f..f411a07ec37 100644 --- a/framework/console/controllers/MigrateController.php +++ b/framework/console/controllers/MigrateController.php @@ -79,7 +79,6 @@ class MigrateController extends BaseMigrateController */ const MAX_NAME_LENGTH = 180; - /** * @var string the name of the table for keeping applied migration information. */ diff --git a/framework/console/widgets/Table.php b/framework/console/widgets/Table.php index 3c05027600f..3878c0224ad 100644 --- a/framework/console/widgets/Table.php +++ b/framework/console/widgets/Table.php @@ -40,6 +40,9 @@ * ], * ]); * + * @property string $listPrefix List prefix. This property is write-only. + * @property int $screenWidth Screen width. This property is write-only. + * * @author Daniel Gomez Pan * @since 2.0.13 */ @@ -102,6 +105,7 @@ class Table extends Widget */ private $_listPrefix = '• '; + /** * Set table headers. * diff --git a/framework/data/DataFilter.php b/framework/data/DataFilter.php index 31e60e7d0d6..4b6f20cfade 100644 --- a/framework/data/DataFilter.php +++ b/framework/data/DataFilter.php @@ -110,11 +110,13 @@ * * @see ActiveDataFilter * - * @property mixed $filter filter value. - * @property Model $searchModel model to be used for filter attributes validation. - * @property array $searchAttributeTypes search attribute type map. - * @property array $errorMessages list of error messages responding to invalid filter structure, - * in format: `[errorKey => message]`. Please refer to [[setErrorMessages()]] for details. + * @property array $errorMessages Error messages in format `[errorKey => message]`. Note that the type of this + * property differs in getter and setter. See [[getErrorMessages()]] and [[setErrorMessages()]] for details. + * @property mixed $filter Raw filter value. + * @property array $searchAttributeTypes Search attribute type map. Note that the type of this property + * differs in getter and setter. See [[getSearchAttributeTypes()]] and [[setSearchAttributeTypes()]] for details. + * @property Model $searchModel Model instance. Note that the type of this property differs in getter and + * setter. See [[getSearchModel()]] and [[setSearchModel()]] for details. * * @author Paul Klimov * @since 2.0.13 @@ -160,8 +162,8 @@ class DataFilter extends Model * ``` * * > Note: while specifying filter controls take actual data exchange format, which your API uses, in mind. - * Make sure each specified control keyword is valid for the format. For example, in XML tag name can start - * only with a letter character, thus controls like `>`, '=' or `$gt` will break the XML schema. + * > Make sure each specified control keyword is valid for the format. For example, in XML tag name can start + * > only with a letter character, thus controls like `>`, '=' or `$gt` will break the XML schema. */ public $filterControls = [ 'and' => 'AND', diff --git a/framework/db/ActiveQuery.php b/framework/db/ActiveQuery.php index c83684cfdd1..a92644b549c 100644 --- a/framework/db/ActiveQuery.php +++ b/framework/db/ActiveQuery.php @@ -66,8 +66,6 @@ * marks a relation as inverse of another relation and [[onCondition()]] which adds a condition that * is to be added to relational query join condition. * - * @property string[] $tablesUsedInFrom Table names indexed by aliases. This property is read-only. - * * @author Qiang Xue * @author Carsten Brandt * @since 2.0 diff --git a/framework/db/Command.php b/framework/db/Command.php index 61e96721e1e..167fde7346b 100644 --- a/framework/db/Command.php +++ b/framework/db/Command.php @@ -48,7 +48,7 @@ * For more details and usage information on Command, see the [guide article on Database Access Objects](guide:db-dao). * * @property string $rawSql The raw SQL with parameter values inserted into the corresponding placeholders in - * [[sql]]. This property is read-only. + * [[sql]]. * @property string $sql The SQL statement to be executed. * * @author Qiang Xue diff --git a/framework/db/Migration.php b/framework/db/Migration.php index 63345ccc2ef..a882f872a7f 100644 --- a/framework/db/Migration.php +++ b/framework/db/Migration.php @@ -65,14 +65,12 @@ class Migration extends Component implements MigrationInterface * ``` */ public $db = 'db'; - /** * @var int max number of characters of the SQL outputted. Useful for reduction of long statements and making * console output more compact. * @since 2.0.13 */ public $maxSqlOutputLength; - /** * @var bool indicates whether the console output should be compacted. * If this is set to true, the individual commands ran within the migration will not be output to the console. @@ -81,6 +79,7 @@ class Migration extends Component implements MigrationInterface */ public $compact = false; + /** * Initializes the migration. * This method will set [[db]] to be the 'db' application component, if it is `null`. @@ -543,7 +542,7 @@ public function dropCommentFromTable($table) /** * Prepares for a command to be executed, and outputs to the console. - * + * * @param string $description the description for the command, to be output to the console. * @return float the time before the command is executed, for the time elapsed to be calculated. * @since 2.0.13 @@ -558,7 +557,7 @@ protected function beginCommand($description) /** * Finalizes after the command has been executed, and outputs to the console the time elapsed. - * + * * @param float $time the time before the command was executed. * @since 2.0.13 */ diff --git a/framework/db/Query.php b/framework/db/Query.php index 0d5fea8a465..7b8df10d4a5 100644 --- a/framework/db/Query.php +++ b/framework/db/Query.php @@ -40,6 +40,8 @@ * * A more detailed usage guide on how to work with Query can be found in the [guide article on Query Builder](guide:db-query-builder). * + * @property string[] $tablesUsedInFrom Table names indexed by aliases. This property is read-only. + * * @author Qiang Xue * @author Carsten Brandt * @since 2.0 diff --git a/framework/db/Schema.php b/framework/db/Schema.php index 2cfc200f5d3..ae9daae5824 100644 --- a/framework/db/Schema.php +++ b/framework/db/Schema.php @@ -61,7 +61,6 @@ abstract class Schema extends BaseObject const TYPE_BINARY = 'binary'; const TYPE_BOOLEAN = 'boolean'; const TYPE_MONEY = 'money'; - /** * Schema cache version, to detect incompatibilities in cached values when the * data format of the cache changes. diff --git a/framework/db/sqlite/Schema.php b/framework/db/sqlite/Schema.php index 21aa30901f2..b744cb90043 100644 --- a/framework/db/sqlite/Schema.php +++ b/framework/db/sqlite/Schema.php @@ -67,6 +67,7 @@ class Schema extends \yii\db\Schema 'enum' => self::TYPE_STRING, ]; + /** * @inheritDoc */ diff --git a/framework/filters/AccessRule.php b/framework/filters/AccessRule.php index 49f2ecd53b8..c019df6e26c 100644 --- a/framework/filters/AccessRule.php +++ b/framework/filters/AccessRule.php @@ -56,7 +56,7 @@ class AccessRule extends Component * * If you are using RBAC (Role-Based Access Control), you may also specify role names. * In this case, [[User::can()]] will be called to check access. - * + * * Note that it is preferred to check for permissions instead. * * If this property is not set or empty, it means this rule applies regardless of roles. diff --git a/framework/filters/AjaxFilter.php b/framework/filters/AjaxFilter.php index f97402386ba..70d7239fe04 100644 --- a/framework/filters/AjaxFilter.php +++ b/framework/filters/AjaxFilter.php @@ -41,6 +41,7 @@ class AjaxFilter extends ActionFilter */ public $request; + /** * @inheritdoc */ diff --git a/framework/helpers/BaseArrayHelper.php b/framework/helpers/BaseArrayHelper.php index ce561a527d1..76b0c7db1b1 100644 --- a/framework/helpers/BaseArrayHelper.php +++ b/framework/helpers/BaseArrayHelper.php @@ -261,9 +261,9 @@ public static function getValue($array, $key, $default = null) * * @param array $array the array to write the value to * @param string|array|null $path the path of where do you want to write a value to `$array` - * the path can be described by a string when each key should be separated by a dot - * you can also describe the path as an array of keys - * if the path is null then `$array` will be assigned the `$value` + * the path can be described by a string when each key should be separated by a dot + * you can also describe the path as an array of keys + * if the path is null then `$array` will be assigned the `$value` * @param mixed $value the value to be written * @since 2.0.13 */ diff --git a/framework/helpers/mimeTypes.php b/framework/helpers/mimeTypes.php index 5da7ee30bdd..b6fab4f72dd 100644 --- a/framework/helpers/mimeTypes.php +++ b/framework/helpers/mimeTypes.php @@ -555,7 +555,7 @@ 'osf' => 'application/vnd.yamaha.openscoreformat', 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', 'otc' => 'application/vnd.oasis.opendocument.chart-template', - 'otf' => 'application/x-font-otf', + 'otf' => 'font/otf', 'otg' => 'application/vnd.oasis.opendocument.graphics-template', 'oth' => 'application/vnd.oasis.opendocument.text-web', 'oti' => 'application/vnd.oasis.opendocument.image-template', @@ -808,8 +808,8 @@ 'trm' => 'application/x-msterminal', 'tsd' => 'application/timestamped-data', 'tsv' => 'text/tab-separated-values', - 'ttc' => 'application/x-font-ttf', - 'ttf' => 'application/x-font-ttf', + 'ttc' => 'font/collection', + 'ttf' => 'font/ttf', 'ttl' => 'text/turtle', 'twd' => 'application/vnd.simtech-mindmapper', 'twds' => 'application/vnd.simtech-mindmapper', @@ -904,7 +904,8 @@ 'wmv' => 'video/x-ms-wmv', 'wmx' => 'video/x-ms-wmx', 'wmz' => 'application/x-msmetafile', - 'woff' => 'application/font-woff', + 'woff' => 'font/woff', + 'woff2' => 'font/woff2', 'wpd' => 'application/vnd.wordperfect', 'wpl' => 'application/vnd.ms-wpl', 'wps' => 'application/vnd.ms-works', diff --git a/framework/i18n/Formatter.php b/framework/i18n/Formatter.php index 33247bd76dc..f74b7a29f5f 100644 --- a/framework/i18n/Formatter.php +++ b/framework/i18n/Formatter.php @@ -355,6 +355,7 @@ class Formatter extends Component self::UNIT_SYSTEM_METRIC => 1000, // 1 kilogram = 1000 grams ], ]; + /** * @var bool whether the [PHP intl extension](http://php.net/manual/en/book.intl.php) is loaded. */ diff --git a/framework/log/Target.php b/framework/log/Target.php index 760d5de09f0..97693da4f53 100644 --- a/framework/log/Target.php +++ b/framework/log/Target.php @@ -26,10 +26,11 @@ * satisfying both filter conditions will be handled. Additionally, you * may specify [[except]] to exclude messages of certain categories. * + * @property Indicates $enabled Whether this log target is enabled. Defaults to true. Note that the type of + * this property differs in getter and setter. See [[getEnabled()]] and [[setEnabled()]] for details. * @property int $levels The message levels that this target is interested in. This is a bitmap of level * values. Defaults to 0, meaning all available levels. Note that the type of this property differs in getter * and setter. See [[getLevels()]] and [[setLevels()]] for details. - * @property bool $enabled Whether to enable this log target. Defaults to true. * * For more details and usage information on Target, see the [guide article on logging & targets](guide:runtime-logging). * @@ -90,7 +91,6 @@ abstract class Target extends Component * Please refer to [[Logger::messages]] for the details about the message structure. */ public $messages = []; - /** * @var bool whether to log time with microseconds. * Defaults to false. @@ -101,6 +101,7 @@ abstract class Target extends Component private $_levels = 0; private $_enabled = true; + /** * Exports log [[messages]] to a specific destination. * Child classes must implement this method. diff --git a/framework/web/Request.php b/framework/web/Request.php index d8e6b995ddc..69118404446 100644 --- a/framework/web/Request.php +++ b/framework/web/Request.php @@ -29,9 +29,12 @@ * corresponding quality score and other parameters as given in the header. * @property array $acceptableLanguages The languages ordered by the preference level. The first element * represents the most preferred language. - * @property string|null $authPassword The password sent via HTTP authentication, null if the password is not - * given. This property is read-only. - * @property string|null $authUser The username sent via HTTP authentication, null if the username is not + * @property array $authCredentials That contains exactly two elements: - 0: the username sent via HTTP + * authentication, `null` if the username is not given - 1: the password sent via HTTP authentication, `null` if + * the password is not given. This property is read-only. + * @property string|null $authPassword The password sent via HTTP authentication, `null` if the password is + * not given. This property is read-only. + * @property string|null $authUser The username sent via HTTP authentication, `null` if the username is not * given. This property is read-only. * @property string $baseUrl The relative URL for the application. * @property array $bodyParams The request parameters given in the request body. @@ -62,6 +65,8 @@ * read-only. * @property string $method Request method, such as GET, POST, HEAD, PUT, PATCH, DELETE. The value returned is * turned into upper case. This property is read-only. + * @property string|null $origin URL origin of a CORS request, `null` if not available. This property is + * read-only. * @property string $pathInfo Part of the request URL that is after the entry script and before the question * mark. Note, the returned path info is already URL-decoded. * @property int $port Port number for insecure requests. @@ -70,7 +75,8 @@ * read-only. * @property string $rawBody The request body. * @property string|null $referrer URL referrer, null if not available. This property is read-only. - * @property string|null $origin URL origin, null if not available. This property is read-only. + * @property string|null $remoteHost Remote host name, `null` if not available. This property is read-only. + * @property string|null $remoteIP Remote IP address, `null` if not available. This property is read-only. * @property string $scriptFile The entry script file path. * @property string $scriptUrl The relative URL of the entry script. * @property int $securePort Port number for secure requests. @@ -194,11 +200,11 @@ class Request extends \yii\base\Request * * Default is to trust all headers except those listed in [[secureHeaders]] from all hosts. * Matches are tried in order and searching is stopped when IP matches. - * + * * > Info: Matching is performed using [[IpValidator]]. - * See [[IpValidator::::setRanges()|IpValidator::setRanges()]] - * and [[IpValidator::networks]] for advanced matching. - * + * See [[IpValidator::::setRanges()|IpValidator::setRanges()]] + * and [[IpValidator::networks]] for advanced matching. + * * @see $secureHeaders * @since 2.0.13 */ @@ -242,6 +248,7 @@ class Request extends \yii\base\Request 'X-Forwarded-Proto' => ['https'], 'Front-End-Https' => ['on'], ]; + /** * @var CookieCollection Collection of request cookies. */ diff --git a/framework/widgets/ActiveFormAsset.php b/framework/widgets/ActiveFormAsset.php index 971606318a1..42f3d2b11c5 100644 --- a/framework/widgets/ActiveFormAsset.php +++ b/framework/widgets/ActiveFormAsset.php @@ -10,6 +10,8 @@ use yii\web\AssetBundle; /** + * The asset bundle for the [[ActiveForm]] widget. + * * @author Qiang Xue * @since 2.0 */