Gen. partnerAlgotech

Get a list of all loaded files

When debugging more complex applications, it sometimes happens that I don't know what all files have been loaded and if something is missing.

|
April 10, 2021

When debugging more complex applications, it sometimes happens that I don't know what all files have been loaded and if something is missing.

If you use Composer or any other kind of class autoloading, you probably don't know this problem. However, it can be a relatively common occurrence when debugging older applications from other developers.

Getting all the loaded files can be done with the get_included_files() function, which returns them as an array of absolute path strings.

It is common in development to have a huge number of files loaded (for example, even this relatively simple blog uses almost 160 files). Most of the time, though, the large volume doesn't matter, because the contents of the files are retrieved from OPCache, which is optimized for bulk reads.

Loading comments...

Stay in the loop

Subscribe to our newsletter and get the latest cybersecurity news delivered straight to your inbox.

Your data is safe. You can unsubscribe from the newsletter at any time.