-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Deprecate absolute template paths #18034
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
[FrameworkBundle] Deprecate absolute template paths #18034
Conversation
Q | A |
---|---|
Branch | master |
Bug fix? | no |
New feature? | no |
BC breaks? | no |
Deprecations? | yes |
Tests pass? | yes |
Fixed tickets | #17999 |
License | MIT |
Doc PR | - |
$isAbsolute = (bool) preg_match('#^(?:/|[a-zA-Z]:)#', $file); | ||
|
||
if ($isAbsolute) { | ||
@trigger_error('Absolute template path support is deprecated since Symfony 3.1 and will throw an exception in 4.0.', E_USER_DEPRECATED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of:
... and will throw an exception in 4.0
I think we usually write it like this:
... and it will be removed in 4.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
274cd46
to
6bb73ae
Compare
|
||
* As it was never an officially supported feature, | ||
the support for absolute template paths has been deprecated | ||
and will be removed in Symfony 4.0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The positions of the line breaks look a bit weird.
👍 |
set_error_handler(function ($type, $msg) use (&$deprecations) { | ||
if (E_USER_DEPRECATED === $type) { | ||
$deprecations[] = $msg; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just for safety, maybe we should do something in the "else" case? like forwarding to the previous error handler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. To be honest I copied this one from other test. Perhaps we should fix in in all ocurences? I won't be able to look into this before evening today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicolas-grekas is throwing an exception like I did just now acceptable?
6bb73ae
to
85a9d67
Compare
👍 (failures unrelated) |
Thank you @jakzal. |
…akzal) This PR was merged into the 3.1-dev branch. Discussion ---------- [FrameworkBundle] Deprecate absolute template paths | Q | A | ------------- | --- | Branch | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #17999 | License | MIT | Doc PR | - Commits ------- 85a9d67 [FrameworkBundle] Deprecate absolute template paths