Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility issue with Twig 2.7.0+ #288

Closed
Kocal opened this Issue Mar 12, 2019 · 6 comments

Comments

Projects
None yet
3 participants
@Kocal
Copy link

Kocal commented Mar 12, 2019

Hi,

I wanted to update Twig from 2.6.2 to 2.7.0 because of a security issue:
Sélection_383

However, I'm facing a compatibility issue:
Sélection_382

Since Twig 2.7.0, they don't use class aliases anymore (e.g.: Twig_Environment) but class namespaces (e.g. Twig\Environment) directly, refs:

I tried to fork and replace class aliases by class namespaces, but it's out of my scope.
I don't have the time to do it, I don't know about your breaking changes policy, I don't know if I should update the .travis.yml to use a specific version of Twig... 😕

Thanks!

@Kocal

This comment has been minimized.

Copy link
Author

Kocal commented Mar 12, 2019

Also, someone opened an issue about this on the Twig repo: twigphp/Twig#2886

So maybe we will have nothing to upgrade here

@mdeboer

This comment has been minimized.

Copy link

mdeboer commented Mar 12, 2019

@Kocal I checked the dependencies and as far as I can tell, it's safe to use namespaced classes instead of class aliases.

Even though the referenced issue and PR might solve the issue for now, why not make sure it does not happen again. Getting rid of the trickery involved with aliases.

@Kocal

This comment has been minimized.

Copy link
Author

Kocal commented Mar 12, 2019

Well, in fact it's fixed by twigphp/Twig#2887

So I'm closing this one :)

@stof

This comment has been minimized.

Copy link

stof commented Mar 12, 2019

Migrating to namespaced Twig classes might still be a good idea though, as Twig 3.x will remove non-namespaced classes.

@Kocal

This comment has been minimized.

Copy link
Author

Kocal commented Mar 13, 2019

Yep of course!

@Kocal

This comment has been minimized.

Copy link
Author

Kocal commented Mar 13, 2019

I opened a PR (#290) which replace Twig aliases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.