2.2.x

Software Yii
Branch 2.2.x
Status
Future
Supported
PHP versions
≥ 8.1.0
Yii 2.2.x Releases View full list

What Is New in Yii 2.2.x

Category Summary
New Features PHP 8 support, new methods for yii\helpers\BaseInflector and yii\helpers\BaseStringHelper.
Improvements Enhanced type declarations, better PostgreSQL and MSSQL support, updated dependencies.
Bug Fixes Numerous fixes across the framework, including issues with database, caching, and validation.
Security Security fixes for yii\helpers\Html and other components.
Deprecated Marked several methods and classes as deprecated in preparation for future versions.

What are the major PHP version and dependency updates?

Yii 2.2.x fully supports PHP 8.0 and later. This is a significant step forward, allowing developers to use the latest language features and performance improvements.

The framework also updated its core dependencies. This includes newer versions of libraries like cebe/markdown and ezyang/htmlpurifier. Keeping these dependencies current helps with security and compatibility with the broader PHP ecosystem.

What database-related improvements were made?

Several enhancements focus on database abstraction. Support for newer PostgreSQL driver attributes was added, ensuring better compatibility. For MSSQL users, there were fixes related to batch querying and schema reading.

Type handling in database layers saw improvements. More precise type declarations were added to methods in yii\db\ColumnSchema and related classes. This makes the code more robust and helps with static analysis.

Were there any new helper methods added?

Yes, new utility methods were introduced to common helper classes. The yii\helpers\BaseInflector class got a new humanize() method. The yii\helpers\BaseStringHelper class received a floatToString() method.

These additions provide more tools for common string manipulation and formatting tasks right out of the box, reducing the need for custom helper functions in applications.

What should I know about the security fixes?

A security fix was applied to the yii\helpers\Html class. The issue was related to the style attribute and preventing potential malicious input.

This fix reinforces the framework's commitment to secure defaults. It's a reminder to always keep your framework installation up to date to incorporate these important patches.

What has been deprecated in this version?

This release marks the beginning of the end for some older functionality. Several methods and classes have been deprecated to pave the way for Yii 3.

For example, the yii\base\ArrayableTrait and certain methods within yii\helpers\ArrayHelper are now deprecated. You should check your code for usage of these and plan for their eventual removal.

FAQ

Is Yii 2.2.x a Long-Term Support (LTS) release?
No, according to the Yii release cycle, version 2.2.x is not an LTS release. It is a regular release that receives bug fixes for one year and security fixes for one additional year after that.

Can I upgrade from Yii 2.0 directly to 2.2.x?
Yes, you can. The upgrade path from 2.0 to 2.2.x is supported. However, you should thoroughly test your application after the upgrade and pay attention to the deprecated features list to prepare for future versions.

Does Yii 2.2.x break backward compatibility?
Yii 2.2.x maintains backward compatibility with previous 2.x releases for non-deprecated features. The changes are additive (new features, improvements) or corrective (bug fixes), with some existing features marked as deprecated but not yet removed.

What is the most important reason to upgrade to 2.2.x?
Gaining official support for PHP 8.x is the most critical reason for many teams. This ensures your application remains compatible with supported and performant versions of PHP, which is crucial for security and performance.

Where can I find a detailed list of every change?
The complete and detailed list of all changes, including every commit, bug fix, and new feature, is available in the framework's CHANGELOG.md file on GitHub. This is the definitive source for all changes in every release.

Releases In Branch 2.2.x

Version Release date
No release found.