1
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of webman.
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the MIT-LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @author walkor<walkor@workerman.net>
|
||||
* @copyright walkor<walkor@workerman.net>
|
||||
* @link http://www.workerman.net/
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
namespace plugin\admin\api;
|
||||
|
||||
use Illuminate\Database\Events\QueryExecuted;
|
||||
use Workerman\Protocols\Http;
|
||||
use Workerman\Protocols\Http\Session as SessionBase;
|
||||
use Workerman\Worker;
|
||||
use function config;
|
||||
use function property_exists;
|
||||
use support\think\Db;
|
||||
|
||||
/**
|
||||
* Class Session
|
||||
* @package support
|
||||
*/
|
||||
class Bootstrap implements \Webman\Bootstrap
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Worker|null $worker
|
||||
* @return void
|
||||
*/
|
||||
public static function start(?Worker $worker)
|
||||
{
|
||||
|
||||
Db::connection()->listen(function (QueryExecuted $queryExecuted) {
|
||||
var_dump("[{$queryExecuted->time} ms] {$queryExecuted->sql}");
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user