📜 ⬆️ ⬇️

Yii 1.1.16

Release 1.1.16 PHP framework Yii released. You can download it at yiiframework.com/download/ .

This release includes more than 120 improvements and fixes. Full list of changes can be found here . Attention : not all changes are compatible with the previous version. Read the upgrade instructions carefully.

Thanks to everyone who helped us and without whom this release would not have taken place.
')
Note that Yii 1.1 went into support mode, that is, you should not expect any new features or big changes in the future. At the moment, we are actively developing and supporting Yii 2.0, which uses fresh technologies. You can follow the development of Yii 2 by putting an asterisk or by clicking on the “watch” button on the project page on GitHub . Join our Twitter and Facebook .

Further we will tell about the main improvements.



Database and ActiveRecord



Database support is constantly improving. This time we added support for MariaDB and CUBRID .

ODBC can now be used via pdo_odbc :

 'components'=>array( ...... 'db'=>array( 'class'=>'CDbConnection' 'driverName'=>'mysql', 'connectionString'=>'odbc:Driver={MySQL};Server=127.0.0.1;Database=test', 'username'=>'', 'password'=>'', ), ), 


When specifying STAT connections, you can use named parameter groups:

 public function relations() { return array( 'recentPostCount'=>array(self::STAT,'Post','author_id','scopes'=>'recentScope'), ); } 


Now in relational queries, you can specify operations that are applied after the JOIN (that is, use | force | ignore index ()):

 $users=User::model()->findAll(array( 'select'=>'t.id,t.name', 'with'=>array( 'posts'=>array( 'alias'=>'p', 'select'=>'p.id,p.title', 'joinOptions'=>'USE INDEX(post__user)', ), ), )); 


You can read more in the Post-JOIN operations section in the Relational Active Record chapter of the full manual.

CDbCommand::naturalLeftJoin() and CDbCommand::naturalRightJoin() have been added to allow the use of appropriate join types.

It became possible to primaryKey() primary key of the model through the primaryKey() method, even if there is a primary key in the table.

Files



New methods have CFileHelper added to CFileHelper :



The MIME type definition has been improved by using the Apache HTTP mime.types file.

CFileHelper::removeDirectory() now works fine with symbolic links to directories. You can do “as it was” by passing the traverseSymlinks key to false in the options array.

A new absolutePaths option has been added to CFileHelper::findFiles() . If you put it in
true , the method will return absolute paths. true is the default value.

The CFileCache and cacheFileMode properties cachePathMode CFileCache added to cacheFileMode , which can be used to execute the chmod() corresponding directories.

Updates



Several libraries used by the framework have been updated:



HTML5



When we released the first version of Yii 1.1, the actual markup standard was XHTML. Now same
This is HTML5, so we decided to update the application template generated using yiic webapp to HTML5.

CHtml and CActiveForm received support for HTML5 input fields such as color, datetime, datetime-local, week, and search.

Compatibility



The various tools and libraries often used with Yii have been updated, so we have updated the framework to support them.



Request



Request learned how to work with the X-HTTP-Method-Override header, which is used to emulate various types of request via POST.

New methods getIsPatchRequest() , getIsPatchViaPostRequest() and getPatch() allow you to work with PATCH requests.

The framework now responds with the same version of the HTTP protocol that was contained in the request.

Request::getPreferredLanguage() can now choose the best option depending on the supported and requested languages.

Error processing



Error handling has been improved.



And a bit more



CFormatter learned to work with DateTime .

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


All Articles