eZ Community » Blogs » Jérôme Vieilledent » legacy_mode clarified

By

legacy_mode clarified

Monday 07 October 2013 2:39:34 pm

  • Currently 5 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Legacy mode is probably one of the most ambiguous settings in eZ Publish 5, according to many posts in the forum. Let's clarify this !

A lot of incorrect things have been said on this legacy_mode setting, like it increases performance. This is mainly due that it was not documented as it should be.

When running php ezpublish/console config:dump-reference ezpublish, this setting is commented this way:

# Whether to use legacy mode or not. If true, will let the legacy kernel handle url aliases.

I reckon that this is not the clearest comment ever...

Let's be pragmatic then.

What it does

  • Still runs through the whole Symfony kernel. As such, Symfony services can still be accessed from legacy stack.
  • Disables the default router (standard Symfony routes won't work in this mode). New in eZ Publish 5.2, see EZP-21628 .
  • Disables the UrlAliasRouter. As such, the ViewController will be bypassed.

What it doesn't do

  • Increase performance. Legacy mode is actually painful for performances since it won't use the HttpCache mechanism.

 

So what should I do?

In a migration context, using Legacy Mode is never a good option as it prevents all the performance goodness (e.g. Http Cache) to work.
Always keep in mind that, not running in legacy mode, if a content still doesn't have a corresponding Twig template/controller, eZ Publish will always fallback to the legacy kernel, looking for a legacy template.

In short: Don't use it except for admin interface.

 

One more thing

This is now fully documented on Confluence.ez.no \o/.

Proudly Developed with from