francisbesset/sfcontextbundle
Symfony bundle providing a centralized context service inspired by Symfony 1's sfContext, offering convenient access to the current request, response, user, and other shared application services. It simplifies managing context dependencies with straightforward configuration.
sfContext alongside a Symfony 2 application while we port incrementally? It does not inform roadmap, feature prioritization, or customer-facing capability. Any PM time spent on it is migration-risk management, not product strategy.sfContext call sites instead?" Given the adoption signals, the defensible answer is almost always: refactor, or fork-and-own. Do not take a hard dependency on an unmaintained shim for a multi-quarter migration.sfContext as a named seam in the architecture. The PM decision is to give it a decommission date and a blast-radius budget (how many call sites are allowed to touch it), so the shim doesn't quietly become permanent infrastructure.sfContext::getInstance() for routing, request, user/session, or configuration; teams that must keep two stacks live behind one entry point during a transition.Note: the repository is a Symfony 2 bundle, not a Laravel package — the dependency/ecosystem framing should be corrected before it reaches any backlog or procurement ticket.
Adopt only when all of the following hold:
sfContext usage (routing, getRequest(), getUser(), getConfiguration()) that you cannot refactor in one pass.Look elsewhere — or stop — when:
sfContext is a global service locator that fights that model. Laravel has no analogous concept and no reason to bridge to one.sfContext surface is small enough to refactor directly — a handful of call sites is cheaper to rewrite than to bridge, and you avoid introducing global state into a clean codebase.For executives: This is a low-cost, low-risk transitional utility, not a platform investment. It costs almost nothing to evaluate and nothing to reject. Its only legitimate role is to unblock an in-flight Symfony 1 → 2 migration by letting legacy code keep working while it's ported. It is unmaintained and effectively unused in the wild, so we should not build strategy on it. Recommendation: treat it as a temporary bridge with a hard removal date, or skip it entirely and refactor the call sites — either way, it does not belong on the roadmap.
For engineering: sfContext is a global service-locator anti-pattern. If we adopt this, we are deliberately re-introducing global state into a DI-based codebase. Confine it behind a single adapter, forbid new call sites, log every usage, and schedule deletion. Assume no upstream support: vendor it, pin the version, and review it before it touches request/user/session code. If the number of call sites is small, rewriting them is the better engineering trade.
Ask: fund the migration, not the bundle. Approve a short spike (1–2 days) to count sfContext call sites and confirm version compatibility; the spike output decides build-vs-buy-vs-refactor, and default expectation is refactor.
How can I help you explore Laravel packages today?