How to find all possibly used PHP files in a large complex application

  Kiến thức lập trình

The application I inherited has many hundreds of PHP files and most of them contain conditional logic if/switch statements that within the blocks contain include/require statements. I tried using get_included_files() but it didn’t really help identify all potentially used files. I am wondering if there is free or paid utility that can look at a top level file and scan for the include/require/include_once/require_once statements and recursively traverse the files to get a complete list of all files that potentially can be included. A node tree or similar view would be ideal although a straight list would be helpful. I am trying to find files that are never called because the last developer had a habit of making multiple backups with similar yet somewhat co fusing names as files I know are being executed. Thank you for any suggestions you can offer

Tried get_included_files() call at bottom of some of the main entry point source files but it didn’t help much due to the complexity of the application having many conditionally included files each of which also has conditionally included file logic.

New contributor

BillMitchell is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT