当前位置:网站首页>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
边栏推荐
- [the path of system analyst] Chapter V software engineering (software process improvement)
- 【科学文献计量】外文文献及中文文献关键词的挖掘与可视化
- 可觀測,才可靠:雲上自動化運維CloudOps系列沙龍 第一彈
- [redis series] redis learning 16. Redis Dictionary (map) and its core coding structure
- Unity Animator 参数
- mysql拒绝访问、管理员身份打开的
- Configuration of headquarters dual computer hot standby and branch infrastructure for firewall Foundation
- (8)JMeter元件详解之 Once only Controller 仅一次控制器
- MFQE 2.0: A New Approach for Multi-FrameQuality Enhancement on Compressed Video
- MySQL如何将列合并?
猜你喜欢

QQ 居然被盗了?原因在这......

华为帐号多端协同,打造美好互联生活

There is no utf8 option for creating tables in Navicat database.

Google Earth engine (GEE) -- converts string to number and applies it to time search (ee.date.fromymd)

智慧运维:基于 BIM 技术的可视化管理系统
![[kali] Kali system, software update (with image source)](/img/ac/43a3f81d50ab6866271b500b142252.png)
[kali] Kali system, software update (with image source)
![[KALI] KALI系统、软件更新(附带镜像源)](/img/ac/43a3f81d50ab6866271b500b142252.png)
[KALI] KALI系统、软件更新(附带镜像源)

【刷题篇】爱吃香蕉的珂珂

【科学文献计量】外文文献及中文文献关键词的挖掘与可视化

DeFi“钱从哪来”?一个大多数人都没搞清楚的问题
随机推荐
This article explains the concepts of typed array, arraybuffer, typedarray, DataView, etc
(8) JMeter component detailed once only controller
Inexplicable error occurred in unity's frequent switching branch result model
What is erdma as illustrated by Coptic cartoon?
[the path of system analyst] Chapter V software engineering (software process improvement)
Comprehensively analyze the basic features and summary of free and paid SSH tools
损失函数:DIOU loss手写实现
华为帐号多端协同,打造美好互联生活
[scientific research data processing] [basic] category variable frequency analysis chart, numerical variable distribution chart and normality test (including lognormal)
Google Earth engine (GEE) -- converts string to number and applies it to time search (ee.date.fromymd)
What network security problems are exposed when a large-scale QQ number theft event occurs?
Unity Animator 参数
numpy 创建空数组 data = np.empty(shape=[1, 64,64,3])
Basic syntax of unity script (1) - common operations of game objects
这个编辑器即将开源!
我如何才能保护我的私钥?
How to take the first step in digital transformation
[redis series] redis learning 16. Redis Dictionary (map) and its core coding structure
DeFi“钱从哪来”?一个大多数人都没搞清楚的问题
点击table的td单元格出现dialog弹窗,获取值后将值放回td单元格