I am currently working on a legacy PHP application. To give you an idea what the application is like:
- The backend is about 14,000 LOC. The frontend is is about 3,000 LOC.
- Each url is a php script, no use of classes.
- Each of those php scripts has a smarty template associated with it.
- It makes heavy use of PEAR form generation plugins.
- Frontend is offered in two languages. This done by duplicating the php scripts + templates.
- It does not follow many best practices, like escaping all sql parameters, redirecting on a post request, putting php scripts out of web root, XSS protection, CRSF protection.
- The app has two main developers, I am working on it temporarily to help out.
- The app is used by several client. Each of them might have a slightly altered version.
Let's say you had two weeks, what would you do to fix this application? Is there there any framework you would recommend that work particularly well with this type of app and which can be introduced gradually?
I was thinking maybe start by introducing ORM, to get rid of sql injection and improve the spaghetti code to construct sql queries.
EDIT 1:: Since people seem to dwell on the SCM issue a lot. I do use git to keep track my own local changes. I am only working on this application temporarily, so I am not really in the position to tell the other developers which tools to use. Also, that was not really the question.
EDIT 2: The reason that I was considering a framework was a) the other developer brought it up b) it would give the project a more rigid structure, so mistakes (like CSFR) are more easily avoided in the future.