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

Fixed the DebugClassLoader compatibility with eval()'d code on Darwin #30363

Merged
merged 1 commit into from Feb 24, 2019

Conversation

Projects
None yet
3 participants
@skalpa
Copy link
Contributor

commented Feb 24, 2019

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.

@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Feb 24, 2019

@@ -397,6 +397,10 @@ private function darwinRealpath($real)
$kFile = strtolower($file);
if (!isset($dirFiles[$kFile])) {
if (') : eval()\'d code' === substr($kFile, -17)) {

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas Feb 24, 2019

Member

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

This comment has been minimized.

Copy link
@skalpa

skalpa Feb 24, 2019

Author Contributor

Done. I moved it before the first isset() as it might even save the strtolower() call.

@skalpa

This comment has been minimized.

Copy link
Contributor Author

commented Feb 24, 2019

The AppVeyor build fail is unrelated (problem with the console ProcessHelperTest).

@nicolas-grekas nicolas-grekas force-pushed the skalpa:fix-debug-loader-eval-mac branch from 88d9846 to 6c2aa24 Feb 24, 2019

@nicolas-grekas

This comment has been minimized.

Copy link
Member

commented Feb 24, 2019

Thank you @skalpa.

@nicolas-grekas nicolas-grekas merged commit 6c2aa24 into symfony:3.4 Feb 24, 2019

1 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
fabbot.io Your code looks good.
Details

nicolas-grekas added a commit that referenced this pull request Feb 24, 2019

bug #30363 Fixed the DebugClassLoader compatibility with eval()'d cod…
…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

This was referenced Mar 3, 2019

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.