|
|||
|
Hi all,
I'm about to begin a project that will span across multiple domains and have come up with some potential pitfalls - maybe some of you have come across the same problems before... OK, say we have domain123.com and domainABC.com (but there could be many more). The codebase should remain very much the same across all domains as far as core functionality is concerned, but there will be some differences across the domains. For example:
I predict that the majority of these will remain over domains, however I need to create a transparent way of switching between forms, models and access lists based on the domain. This in itself doesn't pose too much of a challenge - I'm just concerned that doing it will introduce duplication into my code. Anyway, my thinking is as follows: - DomainController.php (handles setting of application-wide settings such as baseURL, domain name etc that will be used by the rest of the application when deciding which forms/models to load) - UserModel.php (example of the base functionality of a user model) - UserModel_Domain123.php (extended from UserModel.php - provides custom functionality for Domain123.com) Some utility methods would be available that would first check for a domain specific file (such as UserModel_Domain123.php) and if that wasn't present, then load UserModel.php as default. This same technique will apply to the Forms problem. The problem with this technique is that I need to do a file_exists() call every time a form class or model class is loaded - something i'm not particularly keen on doing to be honest. Does anybody else have any experience with this sort of architecture - or any thoughts on problems like this? |
![]() |
| Thread Tools | |
| Display Modes | |
|
|