Yii 1.1.16

    Released 1.1.16 release of the Yii PHP framework. You can download it at yiiframework.com/download/ .

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

    Thanks to everyone who helped us and without whom this release would not have taken place.

    Note that Yii 1.1 switched to support mode, that is, you should not wait for any new features or big changes in the future. At the moment, we are actively developing and supporting Yii 2.0, which uses the latest technology. You can follow the development of Yii 2 by putting an asterisk or clicking on the “watch” button on the project page on GitHub . Join our Twitter and Facebook .

    Next, we will talk 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 through pdo_odbc:

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


    When defining STAT relationships, you can use named parameter groups:

    publicfunctionrelations(){
        returnarray(
            'recentPostCount'=>array(self::STAT,'Post','author_id','scopes'=>'recentScope'),
        );
    }
    


    Now in relational queries, you can specify the operations applied after 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)',
            ),
        ),
    ));
    


    For more information, see the “Post-JOIN operations” section in the “Relational Active Record” chapter of the full manual. And

    were added that allow you to use the appropriate join types. It became possible to block the primary key of the model through the method, even if the table has a primary key.CDbCommand::naturalLeftJoin()CDbCommand::naturalRightJoin()

    primaryKey()

    Files



    The CFileHelpernew methods have been added:

    • createDirectory() - creates a directory, exposing rights recursively.
    • getExtensionByMimeType() - determines the file extension by type MIME.


    The definition of the MIME type has been improved using a file mime.typesfrom Apache HTTP.

    CFileHelper::removeDirectory()Now it works fine with symbolic links to directories. You can do it “as it was” by passing a key traverseSymlinkswith a value falsein an array of options.

    A CFileHelper::findFiles()new option has been added absolutePaths. If set to
    true, the method will return absolute paths. trueis the default value.

    The CFileCacheadded properties cachePathModeand cacheFileModewhich can be used to perform chmod()respective directories.

    Updates



    Several libraries used by the framework have been updated:

    • jQuery before 1.11.1.
    • jQuery UI before 1.11.2.
    • Multifile plugin used by CMultiFileUpload up to 1.48.
    • HTMLPurifier up to 4.6.0.
    • Data for i18n to CLDR23.1 , in which new locales were added, more data and there are important corrections.


    HTML5



    When we released the first version of Yii 1.1, the actual markup standard was XHTML. Now
    it’s HTML5, so we decided to update the application template generated using yiic webappHTML5 before.

    CHtmland CActiveFormgot 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 updated the framework to support them.

    • CApcCache Now compatible with APCu.
    • Yii::import()and are Yii::createComponent()now compatible with third-party class autoloaders, such as the Composer loader.
    • Yiiand YiiBasewere added to startup at composer.json.
    • Tests now work fine with PHPUnit 3.8+.


    Request



    Request learned to work with the header X-HTTP-Method-Overrideused to emulate various types of request through POST.

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

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

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

    Error processing



    Error handling has been improved.

    • The exception object is now accessible through ErrorHandler::getException(), which makes it possible to pass it to various third-party APIs.
    • Added support for logging in Syslog.
    • CClientScript now throws an exception if you try to register a nonexistent package.
    • In CActiveForm::$clientOptionsadded errorCallback. Now you can wedge into the client validation process.


    And a bit more



    • Support for SOAP headers and document / literal encoding has been added to web services.
    • CJSON is now able to use JsonSerializable.
    • CHtml::beginForm()Learned how to work with additional HTTP methods through a hidden field _method.
    • CPasswordHelper::generateSalt()now returns salt with cost = $2y$.
    CFormatterlearned to work with DateTime.

    Also popular now: