如何判断哪些 PHP 文件实际被使用,哪些没有?

2022-01-15 00:00:00 dependencies php

我有一个大型 PHP 网站,我现在要处理它.它包含数百个单独的 PHP 文件,但我怀疑只有不到一半真正被使用.其中大部分可能都可以删除.

I got a large PHP website which I'm now about to take care of. It contains hundreds of separate PHP files, but I suspect only less than a half is really being used. Most of them probably can be deleted.

但我真正想做的最后一件事是检查每个文件的代码并检查其是否链接、包含、需要...等.给其他人或是否可以安全删除.

But the last thing I really want to do is going through the code of each file and check whether its linked, included, required...etc. to others or whether it can be safely deleted.

你知道是否有任何工具可以做到这一点?

Do you know whether there's any tool which is capable of doing this?

推荐答案

看看phpxref,它可能会满足您的需求.

Take a look at phpxref, It might do what you need.

交叉引用 PHP 类、函数、变量、常量和 require/include 用法.

Cross-references PHP classes, functions, variables, constants and require/include usage.

相关文章