Yii Debug Toolbar
yiidebugtbというエクステンションを使ってみる。CakePHP DebugKitみたいなものか。
インストール
- yiidebugtbとかyiidebugtb - yii extensionsとかから持ってくる。
- 解凍し、/webroot/protected/extention 下にコピー。
- /webroot/protected/config/main.php を上記リンク先の例のように変更する
<?php //...略... // autoloading model and component classes 'import'=>array( 'application.models.*', 'application.components.*', //↓↓↓ここ↓↓↓ 'application.extensions.yiidebugtb.*', //↑↑↑ここ↑↑↑ ), //...略... 'components'=>array( //...略... 'log'=>array( 'class'=>'CLogRouter', 'routes'=>array( array( 'class'=>'CFileLogRoute', 'levels'=>'error, warning', ), //...略... //↓↓↓ここ↓↓↓ array( // configuration for the toolbar 'class'=>'XWebDebugRouter', 'config'=>'alignLeft, opaque, runInDebug, fixedPos, collapsed, yamlStyle', 'levels'=>'error, warning, trace, profile, info', 'allowedIPs'=>array('127.0.0.1','::1'), ), //↑↑↑ここ↑↑↑ //...略... // uncomment the following to show log messages on web pages /* array( 'class'=>'CWebLogRoute', ), */ ), ), ), //...略...
というか
というか、上記 /webroot/protected/config/main.php の変更例でコメントアウトされている「CWebLogRoute」の見せ方を変えているってわけだ。各クエリのプロファイルをここに載せるにはframeworkに手を入れないとダメかもなあ。
この辺が参考になりそう。
ロギング - Yii guide
Profiling SQL Executions - Yii guide
fdbweblogroute - Yii extensions