PHP code example of guangzhonghedd01 / xhgui-collector

1. Go to this page and download the library: Download guangzhonghedd01/xhgui-collector 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/ */

    

guangzhonghedd01 / xhgui-collector example snippets


class Xhprof extends Middleware
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request $request
     * @param  \Closure                 $next
     *
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        xhgui_laravel();

        return $next($request);
    }
}


namespace hook;

class Xhgui
{
    public function run(&$params)
    {
        \Guangzhong\Xhgui\xhgui_thinkphp();
    }
}



// 应用行为扩展定义文件
return [
    // 应用初始化
    'app_init'     => [

    ],
    // 应用开始
    'app_begin'    => [],
    // 模块初始化
    'module_init'  => ['hook\\Xhgui'],
    // 操作开始执行
    'action_begin' => [''],
    // 视图内容过滤
    'view_filter'  => [''],
    // 日志写入
    'log_write'    => [],
    // 应用结束
    'app_end'      => [],
];