I have a command interpreter in php. It lives inside the commands directory and needs access to every command in the command file. Currently I call require once on each co
foreach (glob("*.php") as $filename) {
require_once $filename;
}
I'd be careful with something like that though and always prefer "manually" including files. If that's too burdensome, maybe some refactoring is in order. Another solution may be to autoload classes.