I recently inherited an older custom PHP website that consists of three parts: a public section for all to see, a members section, and an administrator section. The directory section resembles the following:
->css ->doc ->inc ->js ->member ->css ->doc ->inc ->js ->admin ->css ->doc ->inc ->js
It looks like the site was originally produced by copying over a directory three times. Maintenance is turning out to be a pain because there are three copies of most functions. If I want to change the uploader, for instance, I have to remember to change it three times. However, the three sections are now very different from each other and have very different uses, so over time, many functions have evolved away from one another. This means that I have to diff before I copy, just in case.
A big frontend overhaul is planned and we're also updating security and moving from mysql_query to PDO. This seems like a good time to overhaul the structure too.
So my first question is, what is a good way to keep the tripartite structure for users but simplify? Is there a downside to creating a single inc or lib directory at the top level and putting all common files there?
For an additional complication, we would like to modernize the login so I am investigating panique's Huge php-login package. It would be used for member and admin logins. That package has an MVC structure and looks like it is meant to serve as the foundation for an entire site. But, I am not sure how I should incorporate it into our preexisting site... I'm reluctant to copy it over twice, for the admin and member sections. I'm wondering whether I should place the member and admin directories inside the php-login directory, or place php-login inside the common lib directory that I'm considering...