id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	phpversion	appname	pending	exts	sapi	probability	blocking
117	__FILE__ doesn't work correctly in hard-linked files	sherwind@…	moo	"A file that require()s a config file located in {{{dirname(__FILE__)}}}
and outputs a constant is hard-linked in multiple sites hosted on the
same server. The constant for the site from which the file was first
requested gets cached and is returned in subsequent requests, even for
other sites.

It works fine if the file is *unhardlinked*. It also works if
{{{dirname(__FILE__)}}} is removed or just replaced with './'.

System:
 * Centos 4.5
 * Apache 2.0.52
 * PHP v4.3.9
 * XCache v1.2.1


__Reproduce code:__

foo.example.com and bar.example.com have the same copies of test.php
and config.php
{{{
# sha1sum /www/*/{test,config}.php
a0af22d58a7a7a5fd11547cd304cc08968c13d5c  /www/bar.example.com/test.php
a0af22d58a7a7a5fd11547cd304cc08968c13d5c  /www/foo.example.com/test.php
4494ec973dfed496e4b28f1ae6e4e2224d10a66c  /www/bar.example.com/config.php
4494ec973dfed496e4b28f1ae6e4e2224d10a66c  /www/foo.example.com/config.php
}}}
but test.php is hard-linked
{{{
# ls -il /www/*/{test,config}.php | awk '{print $1, $10}' | sort -rn
5640819 /www/foo.example.com/test.php
5640819 /www/bar.example.com/test.php
4792040 /www/bar.example.com/config.php
4792039 /www/foo.example.com/config.php

# cat /www/foo.example.com/test.php
<?php
require(dirname(__FILE__) . '/config.php');
echo ABSPATH;
?>

# cat /www/foo.example.com/config.php
<?php
define('ABSPATH', dirname(__FILE__).'/');
?>
}}}

__Expected result:__

""echo ABSPATH;"" should return the ABSPATH for foo if foo.example.com is
requested and the ABSPATH for bar if bar.example.com is requested.

__Actual result:__

{{{
# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

# curl -H 'Host: foo.example.com' http://127.0.0.1/test.php
/www/foo.example.com/

# curl -H 'Host: bar.example.com' http://127.0.0.1/test.php
/www/foo.example.com/

# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

# curl -H 'Host: bar.example.com' http://127.0.0.1/test.php
/www/bar.example.com/

# curl -H 'Host: foo.example.com' http://127.0.0.1/test.php
/www/bar.example.com/
}}}"	defect	closed	major	2.0.1	cacher	1.2.1	fixed	dirname hardlink hard link good_report	judas.iscariote@…		4.3.9		0		Irrelevant	Always	
