I am trying to create a modular php system.
Each module is a class that implements the module interface and gets the same name as the php file. Each module is located inside the Modules directory.
I can list each module in a directory, but how to get an instance from them? Is it possible?
A small pseudo code to make it easier to understand:
foreach(scandir($module_dir) as $file){ include $file $module = new $file
shuwo source share