8000 Enhance GAE compat by removing some realpath() by nicolas-grekas · Pull Request #20292 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 1 commit into from
Oct 27, 2016

Conversation

nicolas-grekas
Copy link
Member
@nicolas-grekas nicolas-grekas commented Oct 25, 2016
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).

@nicolas-grekas
Copy link
Member Author

Looking more carefully, many realpath calls where not needed at all. Just removing them is enough.
PR updated, code should be cleaner.

@@ -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'));
Copy link
Member
@javiereguiluz javiereguiluz Oct 27, 2016

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).

Copy link
Member Author

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.

@fabpot
Copy link
Member
fabpot commented Oct 27, 2016

Thank you @nicolas-grekas.

@fabpot fabpot merged commit f2f232d into symfony:2.7 Oct 27, 2016
fabpot added a commit that referenced this pull request Oct 27, 2016
…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()
@nicolas-grekas nicolas-grekas deleted the no-realpath branch October 27, 2016 16:32
$mappingDirectory = realpath($mappingDirectory);
}
$this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = $mappingDirectory;
$this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = realpath($mappingDirectory) ?: $mappingDirectory;
Copy link
Member

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

Copy link
Member Author

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?)

Copy link
Member

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';
Copy link
Member

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0