-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Fixed the DebugClassLoader compatibility with eval()'d code on Darwin #30363
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
Conversation
@@ -397,6 +397,10 @@ private function darwinRealpath($real) | |||
$kFile = strtolower($file); | |||
|
|||
if (!isset($dirFiles[$kFile])) { | |||
if (') : eval()\'d code' === substr($kFile, -17)) { |
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.
to allow the result to be cached, this should be before the previous "if", using
if (!isset($dirFiles[$kFile]) && ') : eval()\'d code' === substr($kFile, -17)) {
for example
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.
Done. I moved it before the first isset()
as it might even save the strtolower()
call.
The AppVeyor build fail is unrelated (problem with the console |
88d9846
to
6c2aa24
Compare
Thank you @skalpa. |
…e on Darwin (skalpa) This PR was squashed before being merged into the 3.4 branch (closes #30363). Discussion ---------- Fixed the DebugClassLoader compatibility with eval()'d code on Darwin | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #30362 | License | MIT When a class is defined in an `eval()` block, the reported file name is `file_name.php(123) : eval()'d code`, which prevents `DebugClassLoader::darwinRealpath()` from locating/normalizing the file name, and triggers a notice. Commits ------- 6c2aa24 Fixed the DebugClassLoader compatibility with eval()'d code on Darwin
…aknin) This PR was merged into the 3.4 branch. Discussion ---------- [DI] Fix Reflection file name with eval()\'d code | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - remove eval()\'d code from lineage similar to #30363 Commits ------- 394a694 Fix Reflection file name with eval()\'d code
When a class is defined in an
eval()
block, the reported file name isfile_name.php(123) : eval()'d code
, which preventsDebugClassLoader::darwinRealpath()
from locating/normalizing the file name, and triggers a notice.