[英]in netbeans and php, how can i find out all the files/areas of a program where a certain function/method is called
[英]How can I find a list of all the php files that are called when a page loads?
我正在接管我的工作的网站。 上一个开发人员不了解我们 CMS 的架构,并且在所有方面都采用了他的方式。 此外,他没有记录任何内容。
我需要回溯并查看调用网站时正在调用哪些文件? 什么是最简单的方法来做到这一点?
我知道我可以做到:
ps aux | grep php
不过,这仅向我显示了当前正在运行的脚本。 如果我没有在正确的时间运行命令,我会错过一些东西。
如何查看调用 URL 时运行的每个文件的日志? 这是一个基本的 LAMP 堆栈。
谢谢!
PHP 中的解决方案:
http://php.net/manual/en/function.get-included-files.php
使用get_included_files()
获取使用include
、 include_once
、 require
或require_once
包含的所有内容的数组。
然后你可以这样做:
register_shutdown_function( function(){
echo implode( PHP_EOL, get_included_files() );
} );
此时,您可以在每次执行时将列表写入磁盘。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.