fbi / yii2-xhprof
Yii2 provide support for xhprof
Installs: 85
Dependents: 0
Suggesters: 0
Security: 0
Type:yii2-extension
pkg:composer/fbi/yii2-xhprof
Requires
- php: >=5.4.0
- yiisoft/yii2: >=2.0
This package is not auto-updated.
Last update: 2025-10-15 14:08:57 UTC
README
xhprof for yii2
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require fbi/yii2-xhprof "*"
for dev-master
php composer.phar require fbi/yii2-xhprof "dev-master"
or add
"fbi/yii2-xhprof": "*"
to the require section of your composer.json file.
Usage
add the following code to your entry script,for example: index.php
defined('YII_PROFILE') or define('YII_PROFILE',true);then modify your application configuration as follows at the end of your config file:
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/
];
}
- then you browse the profs var http://your.site.name/index.php?r=xhprof