I have a very module-based architecture in my infosystem that is installed to hundreds of clients. Updates are loaded to those clients automatically. But some of these clients have custom functionality that I do not want to add footprint to every other client out there.
Thus I want to implement overrides into the system, so that certain modules act a little differently from the main system.
First idea I had was about having bunch of file_exists() checks before including files and classes, to see if there is an override version of it in overrides directory, but the system loads a lot of files, which would mean there would have to be around twenty to thirty file_exists() checks per page load (this includes files like CSS and JavaScript too).
Would that be appropriate or is there a better way to design an infosystem that has 99% of the clients on one codebase and 1% using overrides on some of the functionality?
Thanks!
I agree with user973254 and Michael Mior‘s comments, and think that you should combine them: when installing, perform the checks for the overrides, then use the info to generate a config script – just store an array of
$modules['ModuleName'] = '/File/Path'. Then, whenever you load a module callinclude $modules['ModuleName'];