forked from yiisoft/yii
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/yiisoft/yii into 1381-sta…
…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
Showing
187 changed files
with
1,980 additions
and
670 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]: メッセージをデータベースに保存する | ||
|
@@ -133,7 +152,7 @@ array( | |
'levels'=>'error', | ||
'filter'=>'CLogFilter', | ||
), | ||
...other log routes... | ||
... 他のログルート ... | ||
), | ||
), | ||
), | ||
|
@@ -156,12 +175,12 @@ Yii は、`Yii::trace` の呼出しによって記録されるメッセージに | |
パフォーマンスのボトルネックがどこにあるかを見つけ出します。 | ||
|
||
パフォーマンスプロファイリングを使うには、どのコードブロックが計測されるのかを指定する必要があります。 | ||
以下のメソッドを、ブロックの最初と最後に挿入することで印をつけます。 | ||
以下のメソッドを、ブロックの最初と最後に挿入することでマークをつけます。 | ||
|
||
~~~ | ||
[php] | ||
Yii::beginProfile('blockID'); | ||
...計測対象のコードブロック... | ||
... 計測対象のコードブロック ... | ||
Yii::endProfile('blockID'); | ||
~~~ | ||
|
||
|
@@ -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 実行をプロファイルする | ||
------------------------ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.