Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/yiisoft/yii into 1381-sta…
Browse files Browse the repository at this point in the history
…t-relation-select

* 'master' of https://github.com/yiisoft/yii: (144 commits)
  Fixes yiisoft#1567 Added filterSelector to CGridView
  Renamed the CONTRIBUTING file to CONTRIBUTING.md so that GitHub effectively uses the Markdown syntax already present in the file when presenting it.
  Fixes yiisoft#1694 - doc fix
  Added issue number
  fixed whitespace issues introduced with yiisoft#851
  Updated CHANGELOG
  Fixes yiisoft#1584 same fix for CListView as already done for CGridView
  Fixes yiisoft#1344 same fix for CListView as already done in CGridView
  Fixes yiisoft#1104 same fix for CListView as already done for CGridView
  Fixes yiisoft#1676 - proper grouping when no group field is specified
  Added addPrimaryKey and dropPrimaryKey commands to CDbMigration class in response to enh req yiisoft#848
  [messages/ja] yii.php updated
  csfix - thx @resurtm
  typo in changelog
  Reverted PR yiisoft#1467 (Issue yiisoft#1465, fixes related issue yiisoft#1661)
  Reverted PR yiisoft#1662
  Better naming
  small update to documentation of filterAjaxOnly()
  Coding style fix
  Fixing bug yiisoft#1661
  ...

Conflicts:
	CHANGELOG
  • Loading branch information
cebe committed Nov 14, 2012
2 parents 7037484 + 940836b commit 174a069
Show file tree
Hide file tree
Showing 187 changed files with 1,980 additions and 670 deletions.
30 changes: 28 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,41 @@ Version 1.1.13 work in progress
- Bug #837: Fixed method CDbCriteria::__wakeup(), allowing to keep custom names for params and update all string parts for automatic params (klimov-paul)
- Bug #959: Bug where non-lowercase keys cannot be found in CConsoleApplication::$commandMap fixed (resurtm)
- Bug #962: Fixed handling of negative timestamps in CDateFormatter::format() (johnmendonca)
- Bug #1094: CListView with enabled history used to clear page title in case sorting or paging performed (Opera and Firefox only) (mdomba, resurtm)
- Bug #1095: Added missing retry_interval parameter of addServer function call in CMemCache (Lisio)
- Bug #1181: Fixed can read but not save binary data e.g. BYTEA on PostgreSQL (karmakaze)
- Bug #1212: Added missing .gitignore files to the application generated by WebAppCommand (resurtm)
- Bug #1249: CHttpRequest::sendFile() outputs malformed file content in some specific circumstances (andyhu)
- Bug #1330: SQLite column default value was incorrect for column of type string and DEFAULT NULL (cebe)
- Bug #1344: Fixed URL problem in CGridView when enableHistory was true and unicode chars where used (mdomba, Redjik)
- Bug #1344: Fixed URL problem in CGridView and CListView when enableHistory was true and unicode chars where used (mdomba, Redjik)
- Bug #1347: CDbTestCase: table name in fixtures list enclosed into double curly brackets (e.g. 'tasks'=>':{{task}}') didn't worked properly (resurtm)
- Bug #1351: CClientScript::registerMetaTag() now allows to register multiple meta tags with the same set of attributes (klimov-paul)
- Bug #1364: Empty CHtml::$errorCss cause class attribute rendering errors (creocoder)
- Bug #1381: Ignore select given by criteria or scope on stat relation (cebe)
- Bug #1407: CDbCommandBuilder::createCountCommand() used to bind parameters for unused ORDER clause and unused SELECT part (resurtm)
- Bug #1444: Fixed CGoogleApi::register call to registerScriptFile (mdomba)
- Bug #1465: Fixed CHtml::beginForm() when CActiveForm with method GET and ajaxButton is used (mdomba)
- Bug #1485: CSort does not quote table alias when using CDbCriteria (undsoft)
- Enh #104: Added CWebLogRoute::$collapsedInFireBug property to control whether the log should be collapsed by default in Firebug (marcovtwout)
- Bug #1499: Fixed CVarDumper highlighting "\" (antoncpu)
- Bug #1552: Fixed potential vulnerability in CJavaScript::encode(): $safe parameter didn't used to be passed to the recursive method calls (resurtm)
- Bug #1584: Fixed CGridView and CListView urls when enableHistory was used with "path" urlFormat (mdomba)
- Bug #1622: CLocale::getTerritory() used to return invalid territory name when locales (language tags) were specified without territory part (e.g. 'de', 'fr') (resurtm)
- Bug #1624: Requirements page now tries all other preferred languages when the most preferred one is missing (ArtVal)
- Bug #1628: Active HTTP sessions overwrote the Cache-Control header set by CHttpCacheFilter (DaSourcerer)
- Bug #1646: CLocale::getTerritory() used to return invalid territory name when locales (language tags) were specified with script part (e.g. 'zh-Hans-CN', 'zh-Hant-HK') (resurtm)
- Bug #1652: Fixed incorrect syntax of CDbSchema::renameTable() for SQLite, added CSqliteSchema::renameTable() method (Sarke)
- Bug #1676: Fixed listData() grouping when no group was specified (mdomba)
- Bug: Table schema is refreshed on Gii model generation when schemaCachingDuration is used (SonkoDmitry)
- Bug: CDbCommand::setFetchMode wasn't accepting additional arguments needed for PDO::FETCH_CLASS (samdark)
- Enh #84: Log route categories are now accepted in form of array. Added CLogRoute::except and parameter to CLogRoute::getLogs that allows you to exclude specific categories (paystey)
- Enh #104: Added CWebLogRoute::$collapsedInFireBug property to control whether the log should be collapsed by default in Firebug (marcovtwout)
- Enh #117: Added CPhpMessageSource::$extensionPaths to allow extensions, that do not have a base class to use as category prefix, to register message source (rcoelho, cebe)
- Enh #259: CHttpRequest::getRestParams is now public (samdark)
- Enh #291: CFormatter::formatDate and formatDateTime now also accept strings in strtotime() format (francis_tm, cebe)
- Enh #486: CHttpSession::$gCProbability and CDbHttpSession::$gCProbability are floats now. Minimal possible $gCProbability value has been changed to the ≈0.00000005% (1/2147483647), was integer 1% before, default value left unchanged (1%) (resurtm)
- Enh #556: CDbColumnSchema::$comment property has been added. It stores comment for the table column, comment retrieving is working for MySQL, PgSQL and Oracle (resurtm)
- Enh #724: Third argument of CHtml::listData() now receives anonymous function as calculator of the text field value, PHP 5.3+ only (resurtm)
- Enh #846: Added addPrimaryKey() / dropPrimaryKey() commands to CDbMigration (ridget)
- Enh #949: Added COciSchema::resetSequence (jazahn, samdark)
- Enh #990: Added CArrayDataProvider::$caseSensitiveSort property which allows to control whether sorting should be case sensitive (resurtm)
- Enh #1084: CDateTimeParser: MMM pattern for parsing short month names is now locale aware (resurtm)
Expand All @@ -49,13 +64,24 @@ Version 1.1.13 work in progress
- Enh #1396: Added 'text/csv' mime-type for the 'csv' file extension in utils/mimeTypes.php (effectively used by e.g. CHttpRequest::sendFile()) (rawtaz)
- Enh #1426: Behaviors are now affecting memory consumption significantly less (slavcodev, creocoder, Qiang, samdark)
- Enh #1443: Added CHttpRequest::getRawBody() that allows reading RAW HTTP request body multiple times (itamar82, resurtm, samdark)
- Enh #1464: CCaptchaAction now supports rendering through ImageMagick, CCaptcha::checkRequirements() changed (resurtm, SonkoDmitry)
- Enh #1500: CSqlDataProvider now supports CDbCommand in constructor (slavcodev)
- Enh #1507: Added support for minOccurs, maxOccurs, nillable to CWsdlGenerator. Changed most of the methods visibility to protected. Added unit tests (lubosdz)
- Enh #1518: Allow to configure CHtml::$closeSingleTags and CHtml::$renderSpecialAttributesValue. Useful for HTML5 code (creocoder)
- Enh #1531: CArrayDataProvider is now able to sort cutted array, where sorting column is not available in every entry (Yiivgeny)
- Enh #1535: HTML5 special attributes added to CHtml::renderAttributes() (creocoder)
- Enh #1567: Added filterSelector property to CGridView (MonkeyMaster)
- Enh #1581: Added an option 'unselectValue' to CHtml::dropDownList() and CHtml::activeDropDownList() to define default post value if option is not selected in multiple mode (creocoder)
- Enh #1596: Added CGridView::rowHtmlOptionsExpression to allow set HTML attributes for the row (Ryadnov)
- Enh: Fixed the check for ajaxUpdate false value in jquery.yiilistview.js as that never happens (mdomba)
- Enh: Requirements checker: added check for Oracle database (pdo_oci extension) and MSSQL (pdo_dblib, pdo_sqlsrv and pdo_mssql extensions) (resurtm)
- Enh: Added CChainedLogFilter class to allow adding multiple filters to a logroute (cebe)
- Enh: Allow CDataProvider to use custom pagination and sorter (creocoder)
- Enh: Value of the CHtml::activeTextArea() can now be set through $htmlOptions['value'] (resurtm)
- Enh: Allow to customize CHtml::error() container tag (creocoder)
- Enh: CModule::setComponents() now can reconfigure already loaded components (creocoder)
- Chg #1373: Upgraded jquery star rating to 3.14 (samdark)
- Chg #1563: Updated CTestCase for PHPUnit 3.7.7+ (tanakahisateru, samdark)
- Chg: MSSQL unit tests updated and actualized, added SQLSRV driver support (resurtm)
- Chg: Added Oracle unit tests (resurtm)
- Chg: Updated CHttpCacheFilter to use dates as specified by RFC 1123 (bramp)
Expand Down
38 changes: 38 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
How to contribute to Yii?
=========================

When contributing to Yii you have to follow some conventions and a simple
workflow. It allows us to handle the requests quickly and ensure best quality
for the Yii core code.

Following guidelines will result in less work for both you and the core team.

Contributing code and fix bugs
------------------------------

Please take the time and read the following guide from beginning to the end:
https://github.com/yiisoft/yii/wiki/Git-workflow-for-Yii-contributors

For code style see:
https://github.com/yiisoft/yii/wiki/Core-framework-code-style

A common issue for many pull requests is inconsistent line endings. You can
learn about dealing with it at:
https://help.github.com/articles/dealing-with-line-endings

**Thanks for your contribution!**

Contributing translations
-------------------------

Contributing translations does not have a workflow like with code. You don't
need to create an issue, pull request will be enough.

See the following guide on how to contribute to Yii documentation:
https://github.com/yiisoft/yii/wiki/Documentation-translation-guidelines

This one is also available in Russian language:
https://github.com/yiisoft/yii/wiki/Russian-Translation-Guidelines

**Thanks for your contribution!**

2 changes: 1 addition & 1 deletion demos/blog/protected/views/site/contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<?php echo $form->textArea($model,'body',array('rows'=>6, 'cols'=>50)); ?>
</div>

<?php if(extension_loaded('gd')): ?>
<?php if(CCaptcha::checkRequirements()): ?>
<div class="row">
<?php echo $form->labelEx($model,'verifyCode'); ?>
<div>
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/database.ar.txt
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ anything coming from the client side.

AR performs data validation automatically when
[save()|CActiveRecord::save] is being invoked. The validation is based on
the rules specified by in the [rules()|CModel::rules] method of the AR class.
the rules specified in the [rules()|CModel::rules] method of the AR class.
For more details about how to specify validation rules, refer to
the [Declaring Validation Rules](/doc/guide/form.model#declaring-validation-rules)
section. Below is the typical workflow needed by saving a record:
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/database.migration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Database Migration

Like source code, the structure of a database is evolving as we develop and maintain a database-driven application. For example, during development, we may want to add a new table; or after the application is put into production, we may realize the need of adding an index on a column. It is important to keep track of these structural database changes (called **migration**) like we do with our source code. If the source code and the database are out of sync, it is very likely the whole system may break. For this reason, Yii provides a database migration tool that can keep track of database migration history, apply new migrations, or revert existing ones.

The following steps how we can use database migration during development:
The following steps show how we can use database migration during development:

1. Tim creates a new migration (e.g. create a new table)
2. Tim commits the new migration into source control system (e.g. SVN, GIT)
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/database.query-builder.txt
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ Below is an example showing how to create an index:
~~~
[php]
// CREATE INDEX `idx_username` ON `tbl_user` (`username`)
createIndex('idx_username', 'tbl_user')
createIndex('idx_username', 'tbl_user', 'username')
~~~


Expand Down
3 changes: 2 additions & 1 deletion docs/guide/extension.use.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Then, the action can be accessed via [route](/doc/guide/basics.controller#route)
Filter
------
[Filters](/doc/guide/basics.controller#filter) are also used by a [controller](/doc/guide/basics.controller).
Their mainly pre- and post-process the user request when it is handled by an
They mainly pre- and post-process the user request when it is handled by an
[action](/doc/guide/basics.controller#action).
Given a filter class `XyzClass` belonging to
the `xyz` extension, we can use it by overriding the [CController::filters] method
Expand Down Expand Up @@ -308,6 +308,7 @@ To use a generic [component](/doc/guide/basics.component), we first
need to include its class file by using

~~~
[php]
Yii::import('ext.xyz.XyzClass');
~~~

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/ja/database.query-builder.txt
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ function createIndex($name, $table, $column, $unique=false)
~~~
[php]
// CREATE INDEX `idx_username` ON `tbl_user` (`username`)
createIndex('idx_username', 'tbl_user')
createIndex('idx_username', 'tbl_user', 'username')
~~~


Expand Down
1 change: 1 addition & 0 deletions docs/guide/ja/extension.use.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ return array(
一般的な [コンポーネント](/doc/guide/basics.component) を使用するには、はじめに、下記のようにそのクラスファイルをインクルードする必要があります。

~~~
[php]
Yii::import('ext.xyz.XyzClass');
~~~

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/ja/topics.console.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function run($args) { ... }
特定のアクションを実行するためには、以下のコンソールコマンド書式を使います。

~~~
yiic <コマンド名> <アクション名> --option1=value --option2=value2 ...
yiic <コマンド名> <アクション名> --option1=value1 --option2=value2 ...
~~~

追加される option-value のペアは、アクションメソッドに名前付きの引数として渡されます。
Expand Down
49 changes: 46 additions & 3 deletions docs/guide/ja/topics.logging.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,25 @@ array(
二番目のルートは [CEmailLogRoute] で、指定されたメールアドレス宛にメッセージを送信します。
このルートでは、レベルが `error` か `warning` のものだけが送信されます。

さらに高度な例として、特定のカテゴリがログに出現するのを抑止する方法を以下に示します
( Yii 1.1.13 以降で利用可能になった exclude 機能を使います )。

~~~
[php]
'routes'=>array(
array(
'class'=>'CEmailLogRoute',
'levels'=>'error, warning',
'exclude'=>'system.CModule.*' // CModule のログ以外をすべてメールで送信
'emails'=>'[email protected]',
),
array(
'class'=>'CWebLogRoute',
'categories'=>'system.db.*',
'exclude'=>'system.db.ar.*', // すべてのレベルの db ログを表示 (ただし ar カテゴリは除外)
),
~~~

Yii では以下のログルートが利用可能です。

- [CDbLogRoute]: メッセージをデータベースに保存する
Expand Down Expand Up @@ -133,7 +152,7 @@ array(
'levels'=>'error',
'filter'=>'CLogFilter',
),
...other log routes...
... 他のログルート ...
),
),
),
Expand All @@ -156,12 +175,12 @@ Yii は、`Yii::trace` の呼出しによって記録されるメッセージに
パフォーマンスのボトルネックがどこにあるかを見つけ出します。

パフォーマンスプロファイリングを使うには、どのコードブロックが計測されるのかを指定する必要があります。
以下のメソッドを、ブロックの最初と最後に挿入することで印をつけます
以下のメソッドを、ブロックの最初と最後に挿入することでマークをつけます

~~~
[php]
Yii::beginProfile('blockID');
...計測対象のコードブロック...
... 計測対象のコードブロック ...
Yii::endProfile('blockID');
~~~

Expand All @@ -175,6 +194,30 @@ Yii::endProfile('blockID');
これは通常のメッセージルーティングのときと同じです。
[CProfileLogRoute] ルートが計測結果を現在のページの末尾に表示します。


~~~
[php]
array(
......
'preload'=>array('log'),
'components'=>array(
......
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CProfileLogRoute',
'report'=>'summary',
// マークした全てのコードブロックの実行時間を表示
// report を callstack に設定することも可能
),
... 他のログルート ...
),
),
),
)
~~~

SQL 実行をプロファイルする
------------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/topics.auth.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ session.

In the following example, we use an identity class to demonstrate using a database approach to authentication. This is very typical of most Web applications. A user will enter their username and password into a login form, and then we validate these credentials, using [ActiveRecord](/doc/guide/database.ar), against a user table in the database . There are actually a few things being demonstrated in this single example:

1. The implementation of the `authenticate()` to use the database to validate credentials.
1. The implementation of the `authenticate()` method to use the database to validate credentials.
2. Overriding the `CUserIdentity::getId()` method to return the `_id` property because the default implementation returns the username as the ID.
3. Using the `setState()` ([CBaseUserIdentity::setState]) method to demonstrate storing other information that can easily be retrieved upon subsequent requests.

Expand Down
4 changes: 2 additions & 2 deletions docs/guide/topics.console.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ yiic help
~~~

This will display a list of available console commands. By default, the available
commands include those provided by Yii frameweork (called **system commands**)
commands include those provided by Yii framework (called **system commands**)
and those developed by users for individual applications (called **user commands**).

To see how to use a command, we can execute
Expand Down Expand Up @@ -103,7 +103,7 @@ an action named `index`.
To execute a specific action, we use the following console command format:

~~~
yiic <command-name> <action-name> --option1=value --option2=value2 ...
yiic <command-name> <action-name> --option1=value1 --option2=value2 ...
~~~

The additional option-value pairs will be passed as named parameters to the action method.
Expand Down
19 changes: 19 additions & 0 deletions docs/guide/topics.logging.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,25 @@ category starts with `system.` are saved. The second route is
[CEmailLogRoute] which sends messages to the specified email addresses.
Only messages whose level is `error` or `warning` are sent.

In a more advanced example (using an exclude feature available in Yii 1.1.13+),
we can prevent certain categories from appearing in our logs:

~~~
[php]
'routes'=>array(
array(
'class'=>'CEmailLogRoute',
'levels'=>'error, warning',
'exclude'=>'system.CModule.*' // Will email everything except any CModule logs
'emails'=>'[email protected]',
),
array(
'class'=>'CWebLogRoute',
'categories'=>'system.db.*',
'exclude'=>'system.db.ar.*', // shows all db level logs but nothing in the ar category
),
~~~

The following log routes are available in Yii:

- [CDbLogRoute]: saves messages in a database table.
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/topics.security.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Cross-site Scripting Prevention
Cross-site scripting (also known as XSS) occurs when a web application
gathers malicious data from a user. Often attackers will inject JavaScript,
VBScript, ActiveX, HTML, or Flash into a vulnerable application to fool other
application users and gather data from them. For example, a poorly design
application users and gather data from them. For example, a poorly designed
forum system may display user input in forum posts without any checking.
An attacker can then inject a piece of malicious JavaScript code into a post
so that when other users read this post, the JavaScript runs unexpectedly
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/topics.webservice.txt
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,10 @@ class PostController extends CController
Intercepting Remote Method Invocation
-------------------------------------

By implementing the [IWebServiceProvider] interface, a sevice provider can
By implementing the [IWebServiceProvider] interface, a service provider can
intercept remote method invocations. In
[IWebServiceProvider::beforeWebMethod], the provider may retrieve the
current [CWebService] instance and obtain the the name of the method
current [CWebService] instance and obtain the name of the method
currently being requested via [CWebService::methodName]. It can return
false if the remote method should not be invoked for some reason (e.g.
unauthorized access).
Expand Down
Loading

0 comments on commit 174a069

Please sign in to comment.