I am tasked to rebuild four e-learning web applications (PHP MVC) that deal with companies and users that buy/sell and interact with online courses:
- The "overlord" application, where company accounts are created, reports are aggregated for all the accounts throughout all the other applications, etc.
- The "enterprise" application, where a larger organization manages it's children companies and has access to aggregated reports for all said companies.
- The eCommerce application, where companies and individuals buy and sell the courses.
- The "base" application, where a company's users get to interact with the courses created or bought by their company. Also here is where the users and courses are created, by "instructors", which are basically users with elevated management rights.
All of these applications have different interfaces of course, and are accessed on different domains.
As of this moment, application 4 is done.
My issue is that the previous developers duplicated a lot of code and only shared the database between applications, resulting in a maintenance mess when something needed to be changed.
The applications have a lot in common. They all deal with the same courses, users and companies, and going from 4 to 1, each application basically gets a bigger picture of what is happening.
For example, in application 4, there are course completion and eCommerce reports for the current company (which only some users can access). Going up to application 2, the reports for companies belonging to the same enterprise are aggregated, and further up, in application 1, the reports for all the enterprises and stand-alone companies are presented. Besides, each has some different piece of unique functionality.
So it seems natural to me that all the applications should share the same models, and each application should have it's own controllers and views. My questions are:
What would be the best way to do this technically?. The applications are on the same server, each one in a different user's /home directory, and open_basedir restriction is in effect, with each application only being allowed to include files from it's directory.
What are the security implications should I relax the open_basedir restrictions and allow the inclusion of files from the models' location? We own the server, so making any changes is not a problem (although running Plesk means that we should do every configuration from it's interface).
How could I configure the domains?
I now "it depends", but is this actually a good idea? I can see that there is a risk of overcrowding the models with functionality for all the applications (although I will surely separate applications logic where necessary).