PHP code example of zhoyoung / yii2-xhprof

1. Go to this page and download the library: Download zhoyoung/yii2-xhprof library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zhoyoung / yii2-xhprof example snippets


defined('YII_ENV') or define('YII_ENV', 'dev');

if (YII_ENV_DEV){
    $config['bootstrap'][] = 'xhprof';
    $config['modules']['xhprof'] = [
        'class'=>'zhoyoung\xhprof\Module',
        //控制抓取频率,如果为1则全部抓取
        'frequency' => 1,
        //超过限制秒数就抓取
        'minExcutionTime' => 1,
        //默认源Yii::$app->id
		//'name'=>'linkserver',
		//记录路径,默认: @runtime/xhprof/
		//'dir'=>'/tmp',
	];
}

php composer.phar 

php composer.phar