I have a line of code that tries to change the current directory up one level, i.e., chdir('../'); that seems to do funny things - like just exit the function it is in. I have searched for this behaviour and found that there is a PHP bug submitted on something similar. The difference is that it was associated with a windows environment and I am on a linux environment. The PHP version is 5.2.5.
The way I checked this was using the following code:
$curdir=getcwd();
error_log('current dir = '.$curdir,0);
@chdir('../');
$newdir=getcwd();
error_log('new dir = '.$newdir,0);
The output in the error_log is:
[15-Apr-2008 07:50:30] call joomla.inc.php
[15-Apr-2008 07:50:30] enter joomla.inc.php
[15-Apr-2008 07:50:30] current dir = /home/xxxxxxx/public_html/coppermine
[15-Apr-2008 07:50:30] return from joomla.inc.php
What I expected to have in the error_log was:
call joomla.inc.php
enter joomla.inc.php
current dir = /home/xxxxxxx/public_html/coppermine
new dir = /home/xxxxxxx/public_html
exit joomla.inc.php
return from joomla.inc.php
Notice that I never get an entry in the error_log for the statement after the chdir statement. In fact what happens is the code exits the current function and returns to the calling function.
Any help would be appreciated - David