-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Enhance GAE compat by removing some realpath() #20292
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
c208e6d
to
4296da1
Compare
4296da1
to
f2f232d
Compare
Looking more carefully, many realpath calls where not needed at all. Just removing them is enough. |
@@ -52,7 +52,7 @@ class FrameworkExtension extends Extension | |||
*/ | |||
public function load(array $configs, ContainerBuilder $container) | |||
{ | |||
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); | |||
$loader = new XmlFileLoader($container, new FileLocator(dirname(__DIR__).'/Resources/config')); |
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 asking: is this kind of change needed to solve the GAE issues? I agree with @xabbuh that dirname(__DIR__)
is less readable than ../
(and it also introduces a function call).
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.
This is a DI extension, we don't care about perf :) And yes it is: realpath removes these ..
, but if we don't call realpath anymore, we have to clean the path ourselves.
Thank you @nicolas-grekas. |
…ekas) This PR was merged into the 2.7 branch. Discussion ---------- Enhance GAE compat by removing some realpath() | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #20241 | License | MIT | Doc PR | - The remaining ones are in test folders, or in things that don't run/have to run on GAE directly (e.g. commands). Commits ------- f2f232d Enhance GAE compat by removing some realpath()
$mappingDirectory = realpath($mappingDirectory); | ||
} | ||
$this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = $mappingDirectory; | ||
$this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = realpath($mappingDirectory) ?: $mappingDirectory; |
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.
this breaks BC, because Doctrine does not follow symlinks when reading mapping
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.
Not sure to get what you mean. Does this need a fix? (can you send it please?)
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.
ah sorry, I looked at it too fast and missed the fact that it was not removed entirely but only when realpath fails.
@@ -996,7 +996,7 @@ private function getKernelRootHash(ContainerBuilder $container) | |||
*/ | |||
public function getXsdValidationBasePath() | |||
{ | |||
return __DIR__.'/../Resources/config/schema'; | |||
return dirname(__DIR__).'/Resources/config/schema'; |
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.
we don't really care about a realpath here though (unless GAE also does not support ..
in paths, but then they should reallt rework there filesystem)
The remaining ones are in test folders, or in things that don't run/have to run on GAE directly (e.g. commands).