fbi /? yii2-xhprof
Yii2 支持xhprof
V1.0.0
2015-04-21 10:58 UTC
Requires
- php: >=5.4.0
- yiisoft/yii2: >=2.0
This package is not auto-updated.
Last update: 2024-10-02 09:23:54 UTC
README
yii2 的 xhprof
安装
安装此扩展的首选方式是通过 Composer。
运行以下命令
php composer.phar require fbi/yii2-xhprof "*"
for dev-master
php composer.phar require fbi/yii2-xhprof "dev-master"
或者在您的 composer.json
文件的 require 部分添加
"fbi/yii2-xhprof": "*"
到 require 部分中。
使用方法
将以下代码添加到您的入口脚本中,例如:index.php
defined('YII_PROFILE') or define('YII_PROFILE',true);
然后按照以下方式修改您的应用程序配置,在配置文件末尾
if (YII_PROFILE){
$config['bootstrap'][] = 'xhprof';
$config['modules']['xhprof'] = [
'class'=>'fbi\xhprof\Module',
'frequency'=>1000,//record rate
'minExcutionTime'=>1,//
//'name'=>'linkserver',//xhprof source,default value: Yii::$app->id
//'dir'=>'/tmp',//record path ,default value: @runtime/xhprof/
];
}
- 然后您可以通过以下链接浏览 profs var http://your.site.name/index.php?r=xhprof