Skip to content

Move code from FrameworkBundle to the components. #7435

Closed
@realityking

Description

@realityking

The decoupled Symfony components have been a great help but there are a few things in FrameworkBundle that could be moved to the components with some small refactoring making them more useable for people like me who have to use the components without the full framework.

There's a pretty good chance I'm overlooking something with some of these and there are certainly backwards compatibility concerns to be adressed. I'll do the necessary pull requests but first I'd like some feedback which of these are feasible and how to approach backwards compatibility.

Let's dig in:

Router and RouterCacheWarmer

The warmUp() method from the Router class could be dropped (also the WarmableInterface), the code would move RouterCacheWarmer. With this change RouterCacheWarmer only depends on HttpKernel and Routing and could go into either of these components. (My favorite would be Routing)

TemplateFinderInterface

This one is a bit of an odd duck since the implementation very much belongs into the FrameworkBundle. But by moving the interface to the Templating component.

The reason for this is that I wrote a SmartyBridge and doesn't depend on the FrameworkBundle like the existing SmartyBundle. I'd like to add a CacheWarmer though and having this interface would allow for a CacheWarmer that easily scales up to the full framework. The same would apply for Twig.

EngineInterface

This one could easily be moved to Templating, it just provides some nice integration between Templating and HttpFoundation's Response class.

This would be very handy for standalone use and probably use in Silex (which AFAIK doesn't use the Templating component right now).

The Interface would need a new name so we don't get a hard dependency on HttpFoundation into Templating.

Templating helpers

I don't use the PhpEngine myself but I don't see why the following helpers couldn't be moved to Templating or their respective Component:

  • RequestHelper
  • SessionHelper
  • TranslatorHelper
  • FormHelper

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions