I'm working on legacy PHP based E-cormmerce project, and there are so many files that are not being used.
I just want to remove every PHP file that are not included or required by another file.
However, PHP supports something like runtime dynamic import. This makes it hard to find out every file.
So I'm wondering if there is a good way or even idea to find out every isolated PHP file in a project.
I tried to use grep
, but it does not work well because the PHP source uses dynamic include a lot.
You could try to find this out in a few steps, assuming you're using Linux:
It's not a perfect method, but it doesn't rely on the PHP code at all, which can be an advantage.