Hey guys, I have a really tricky situation here: I’m developing a Yii web app (www.x2engine.com), and it’s downloaded and installed on servers all over the world. Many of our customers want custom features, which are quite easy to implement, but become a major issue when we run an automatic update. Our updater basically generates a list of files to update to bring the installation up to date, then downloads and replaces those files.
So, either their custom code is overwritten, or they don’t get updates. Because of the complexity of this software, it is quite unlikely that just skipping modified files would produce a stable application.
The best solution we’ve thought of so far is to create empty child classes for any file that gets modified (such as a controller), so it extends the real controller. Any modifications would go in the child class, which would then be left alone by the updater. And this way, all the code within that file could be updated, except the custom overridden methods.
What I’m asking is this: how can I tell Yii to look in a folder for one of these extended classes, and use it instead of the real one if it’s there? We don’t want to create an empty child class for every single file (we have hundreds of classes, this would be silly).
This idea would only apply to classes; views can’t be extended, but I think we’ve got a good solution involving themes, since themes already do this exact same substitution for views.
Thanks for your help!