I'm trying to modernize a very old PHP application for a customer to keep its code base up with modern coding standards. I am permitted to restructure things a bit, but dumping the entire app and switching to an existing framework is not yet an option. I just need some general tips on how best to restructure the application classes.
Right now, the parent script calls the base application, which extends the database class. Smarty is being used as the template rendering engine, but it is not integrated with the base application. The parent script calls on Smarty separately. This customer's app includes a lot of complicated processes that are often coded repeatedly throughout various parent scripts, but really need to be in their own custom classes as part of the app structure.
The whole thing seems backwards from how I understand PHP applications to be coded today. What would be effective way of restructuring the classes neatly, keeping the app extendable and a bit more "DRY"?