[Bug 912] Changed - special_characters.php fails to find required lib/Registry.php

bugs@bugs.horde.org bugs@bugs.horde.org
Tue, 19 Mar 2002 21:33:38 -0400


http://bugs.horde.org/show_bug.cgi?id=912

*** shadow/912	Tue Mar 19 19:27:55 2002
--- shadow/912.tmp.9395	Tue Mar 19 21:33:38 2002
***************
*** 3,9 ****
  Version: 2.0 Stable
  Platform: PHP Code
  OS/Version: HP-UX
! Status: REOPENED   
  Resolution: INVALID
  Severity: minor
  Priority: P4
--- 3,9 ----
  Version: 2.0 Stable
  Platform: PHP Code
  OS/Version: HP-UX
! Status: RESOLVED   
  Resolution: INVALID
  Severity: minor
  Priority: P4
***************
*** 138,140 ****
--- 138,195 ----
  Ged 
  
  Nothing but grief.... 
+ 
+ ------- Additional Comments From lodder@yacc.com.au  03/19/02 21:33 -------
+ The plot thickens....
+ I have traced the problem further. I created a simple C program to print out 
+ the __FILE__ value. When is compile it with HP's ANSI C compiler it works as 
+ expected i.e. the value is as specified in the include. When I compile with GNU 
+ CC compiler (gcc) the value is "sanitised". 
+ 
+ See below
+ 
+ /home/gedl/tmp $ cc -o a a.c ./lib/b.c && echo "The output" && ./a
+ a.c:
+ ./lib/b.c:
+ The output
+ a.c
+ ./lib/b.c
+ /home/gedl/tmp $ gcc -o a a.c ./lib/b.c && echo "The output" && ./a
+ The output
+ a.c
+ lib/b.c
+ /home/gedl/tmp $
+ 
+ Essentially the same but not exactly. I thought this might be the problem but 
+ both compilers give a valid answer.
+ 
+ When I create the same functionality in php the output is as follows
+ included as lib/a.php reports /lib/a.php 
+ included as ./lib/a.php reports /lib/a.php 
+ 
+ The original file is reported with an absolute path from the system's root 
+ directory eg "/some/folder/tmp/a.php". The contents of that file are
+ 
+ <?php
+ echo "Calling  file ", __FILE__;
+ echo "<br>included as lib/a.php reports ";
+ include 'lib/a.php';
+ echo "<br>included as ./lib/a.php reports ";
+ include './lib/a.php';
+ ?>
+ 
+ lib/a.php contains:
+ <?php
+ echo  __FILE__;
+ ?>
+ 
+ The question now is why does php prepend the / to the relative path? As this is 
+ not a horde problem I will close it and pursue that elsewhere. 
+ 
+ Thanks to all. If you are interested in the final solution let me know and I 
+ will update you when I get to the bottom of it.
+ 
+ Regards
+ 
+ Ged
+