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

Fix public path resolution with symlinks #1936

Merged
merged 1 commit into from
Nov 9, 2022
Merged

Conversation

mvorisek
Copy link
Member

@mvorisek mvorisek commented Nov 9, 2022

see #1727 (comment) discussion and analysis there

RUN mkdir /mount && mkdir /mount/html && chmod 0777 /mount/html
RUN ln -s /mount/html /var/www/ht # /var/www/html directory cannot be removed because of Docker

RUN cd /var/www/ht/ && pwd && php -r 'var_dump(getcwd());' && php demos/test.php

and test.php:

<?php var_dump(__FILE__); var_dump(__DIR__);

demo shows calling realpath on __DIR__ is redundant, so the proposed solution should imply no performance drop, realpath is called only once per app/request for entry php script file

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

Successfully merging this pull request may close these issues.

1 participant