当前位置:网站首页>PHP reverses scenarios based on code and skillfully uses debug_ backtrace()
PHP reverses scenarios based on code and skillfully uses debug_ backtrace()
2022-06-30 14:07:00 【Zhen Jie.】
1. First write a method that counts the method call path
/** * @desc: Statistics method call path * @date: 2021-11-9 */
public function statisticsAllFunctionPath()
{
// Connect redis
$redis = ZFactory::getRedis('***Redis');
$redis_key = "FunctionPath";
// Record scene path
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
$trace_path = "";
foreach ($backtrace as $key => $trace){
if($key == 0){
$trace_path = $trace['function'];
}else{
$trace_path = $trace_path.'-'.$trace['function'];
}
}
//md5 String path filtering hash Eliminate duplicate data
$hash_key = md5($trace_path);
if(!$redis->hExists($redis_key, $hash_key)){
// non-existent The insert hash value
$redis->hSet($redis_key, $hash_key, $trace_path);
}
if($_COOKIE['test'] == 2){
echo "<pre>";
var_dump($redis_key);echo "<br>";echo "<br>"; // Output :FunctionPath
var_dump($hash_key);echo "<br>";echo "<br>"; // Output :e2806d650d6a13384f412fce61196a1a
var_dump($trace_path);echo "<br>";echo "<br>"; // Output :sta********eplinkScene-c*******k-generateShareUrl-displayT6-display-call_user_func_array-call*****d-execute-renderComponent-dispatch
exit();
}
return true;
}
2. Where statistics are needed , Call the statistical method path method
public function createDeeplink()
{
...
...
// Call the statistics method call the path method
$testModel = new TestModel();
$testModel->statisticsAllFunctionPath();
...
...
}
3. Print redis Data collected , Push back the interface based on the collected data url
/* string(13) " All the data :" array(8) { ["e2806d650d6a13384f412fce61196a1a"]=>string(138) "sta********eplinkScene-c*******k-generateShareUrl-displayT6-display-call_user_func_array-call*****d-execute-renderComponent-dispatch" } Based on the above data, the interface can be pushed back url:/index.php?com=test&t=display */
4. According to the interface pushed back url, Then go to find the location or scenario of the front-end calling interface
边栏推荐
- 【科研数据处理】[实践]类别变量频数分析图表、数值变量分布图表与正态性检验(包含对数正态)
- Complete TCP forwarding server (kernel linked list + mutex)
- Comprehensively analyze the basic features and summary of free and paid SSH tools
- Google Earth engine (GEE) -- converts string to number and applies it to time search (ee.date.fromymd)
- 【刷题篇】避免洪水泛滥
- "As a service", the inevitable choice of enterprise digital transformation
- How can I protect my private key?
- 【科研数据处理】[基础]类别变量频数分析图表、数值变量分布图表与正态性检验(包含对数正态)
- get请求与post提交区别的简易理解
- How can c write an SQL parser
猜你喜欢
随机推荐
【科研数据处理】[基础]类别变量频数分析图表、数值变量分布图表与正态性检验(包含对数正态)
【系统分析师之路】第五章 复盘软件工程(敏捷开发)
第四批入围企业公示——年度TOP100智能网联供应商评选
Pytoch viewing model parameter quantity and calculation quantity
LeetCode_ Stack_ Medium_ 227. basic calculator II (without brackets)
Details of gets, fgetc, fgets, Getc, getchar, putc, fputc, putchar, puts, fputs functions
Inexplicable error occurred in unity's frequent switching branch result model
深入理解.Net中的线程同步之构造模式(二)内核模式3.内核模式构造物Mutex
知识传播不能取代专业学习!
Yousi College: Six Sigma is not just statistics!
Jetpack compose for perfect screen fit
智慧运维:基于 BIM 技术的可视化管理系统
Lucky hash quiz system development (source code deployment) fun investment hash game play development (case requirements)
Embedded development: five C features that may no longer be prohibited
表格储存中sql查询的时候,查询结果增加主键报错,查询结果超过10w行。需要对主键增加上多元索引吗?
How to take the first step in digital transformation
DNS resolution home network access public DNS practice
Geoffreyhinton: my 50 years of in-depth study and Research on mental skills
Getting started with shell Basics
编程实战赛来啦!B站周边、高级会员等好礼送你啦!









