If we placed our autoloader code in a class as a static or instance method, our search for include
calls will reveal the inclusion of that class file. If you remove that include
call, autoloading will fail, because the class file will not have been loaded. This is a chicken-and-egg problem. The solution is to leave the autoloader include
in place as part of our bootstrapping or setup code. If we are fully diligent about removing include
calls, that is likely to be the only include
remaining in the codebase.
There are several ways to go about this. We could do the following:
We can manually traverse the entire codebase and work file-by-file.
We can generate a list of class and function definition files, and then generate a list of files that
include
those files.We can search for every
include
call and look at the related file to see if it has class or function definitions.