📜 ⬆️ ⬇️

Yii 2.0.12

Version 2.0.12 of PHP framework Yii has been released. Installation and upgrade instructions are available here .



Version 2.0.12 is a minor release of Yii 2.0. It includes more than a hundred improvements and fixes .


The release includes several changes that may affect existing applications. These changes are described in UPGRADE.md .


Thanks to the Yii community for supporting the project!


You can follow the development of the framework by putting an asterisk on GitHub . You can also subscribe to Twitter and Facebook .


This release was delayed, because the team was busy with other things. For example, we are working on a new site and YiiConf
- Conference on Yii , which will be held very soon in Moscow.


Since Yii 2.1 is already being developed , make sure that the version in your composer.json spelled as ~2.0.12 , and not >= or * . So, with release 2.1, your project will definitely not break.


Below we look at the most interesting release changes. A complete list can be found in CHANGELOG .


Tests


Coverage tests are very important for the timely detection of problems. By the release of @ vladis84 , @boboldehampsink , @Kolyunya, and other members of the Yii community helped us extend the code coverage.


@ schmunk42 set up additional testing based on docker and deployed it to GitLab . Some tests are still falling there. Mainly due to differences in data for internationalization. This will be fixed a little later.


Database


The database layer has received several improvements in expressions. Now they can be used in \yii\db\QueryTrait::limit() , \yii\db\QueryTrait::offset() and \yii\data\Sort .


MSSQL


MSSQL support has improved significantly. The speed of reading the schema has significantly increased and the method yii\db\mssql\QueryBuilder::resetSequence() been implemented.


Security



Usability


The migration template now uses safeUp() and safeDown() by default. In the event that schema changes in a transaction are not supported (for example, MySQL), the changes are applied without transactions.


The various components of the framework have default values:



The yii cache command began to warn that it could not clear the APC cache from the console.


yii\filters\AccessRule now allows you to pass parameters to the role check function.


Performance



Any


StringHelper learned to work with URL-safe base64 through the methods encode() / decode() . This can be useful for various tokens.


yii\helpers\Html::img() now allows you to specify srcset :


 [php] echo Html::img('/base-url', [ 'srcset' => [ '100w' => '/example-100w', '500w' => '/example-500w', '1500w' => '/example-1500w', ], ]); 

For yii\widgets\LinkPager you can render the current page button as disabled. To do this, disableCurrentPageButton must be set to true.


Access control and validators began to require fewer dependencies:



')

Source: https://habr.com/ru/post/330324/


All Articles