I’m using Slim as I go through the process of modernizing an old spaghetti code site. Previously, all of the .php scripts were just sitting in the document root. I’ve created a new public directory with my index.php, assets, etc and moved the rest of the scripts below the document root.
From there, the plan was use a catch-all route as a fallback while I gradually define new routes as I get things cleaned up and create the relevant controllers. My fallback route is dispatching to a LegacyController
with a handle
method which basically just includes the relevant legacy .php script. This initial attempt works in some cases, but the issue I’m stuck on at the moment is that some of these scripts have Header("Location: ...")
calls in them to redirect after doing some logic, and I can’t think of a way to get this to work within the context of the Slim app lifecycle.
Wondering if anyone has any ideas? Please let me know if you need more info on what I’m trying to do.