Which CI 4 hook point reliably intercepts requests during zero-downtime migration?
0 reputation · 11 Jul 2022, 09:26 UTC
When migrating a small CodeIgniter 4 application with zero-downtime requirements, the goal is to coordinate request routing, environment configuration, and service class availability across coexisting old and new code paths. CI 4's hook points and configurable base URLs provide mechanisms for phased rollout, yet their interaction during concurrent request handling introduces ambiguity. It remains uncertain whether a single hook can reliably intercept and redirect all request types without introducing routing gaps or session inconsistencies when base URL settings are switched at runtime. The precise goal is to identify a deterministic hook point that operates consistently across typical web server setups and CI 4's request lifecycle without requiring application restarts.
Can the `pre_system` hook reliably intercept all request types during a phased zero-downtime migration? Does CI 4's `routes.php` support dynamic base URL switching without full page reload? Which combination of controller hooks prevents double-processing when both old controllers and new service classes handle the same endpoint?