Skip to content

Fix public path resolution with symlinks#1936

Merged
mvorisek merged 1 commit intodevelopfrom
realpath_for_path_calc
Nov 9, 2022
Merged

Fix public path resolution with symlinks#1936
mvorisek merged 1 commit intodevelopfrom
realpath_for_path_calc

Conversation

@mvorisek
Copy link
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

1 participant