|  | Posted by Giacomo on 03/08/07 01:15 
Hi all.I just don't understand the behaviour of this: i have a few-webpages
 application in which I have these two files (and all the others)
 
 classes/class.User.php
 include/stdinclude.php
 
 the code of stdinclude.php is the following:
 
 <CODE>
 ....
 session_start();
 
 function __autoload( $classname ) {
 require_once "../classes/class.$class_name.php";
 }
 ....
 </CODE>
 
 I was getting the require_once-fatal-error becouse the script couldn't
 find "../classes/class.User.php", and I tried to understand where the
 include path pointed to: so i dumped the stacktrace and that's what
 was in:
 
 (please read the first entry even if it's long)
 <BACKTRACE>
 [0]=>
 array(2) {
 ["function"]=>
 string(10) "__autoload"
 ["args"]=>
 array(1) {
 [0]=>
 &string(4) "User"
 }
 }
 [1]=>
 array(4) {
 ["file"]=>
 string(72) "C:\foo\include\stdinclude.php"
 ["line"]=>
 int(3)
 ["function"]=>
 string(13) "session_start"
 ["args"]=>
 array(0) {
 }
 }
 [2]=>
 array(4) {
 ["file"]=>
 string(68) "C:\foo\include\header.php"
 ["line"]=>
 int(3)
 ["args"]=>
 array(1) {
 [0]=>
 string(72) "C:\foo\include\stdinclude.php"
 }
 ["function"]=>
 string(12) "require_once"
 }
 [3]=>
 array(4) {
 ["file"]=>
 string(59) "C:\foo\index.php"
 ["line"]=>
 int(1)
 ["args"]=>
 array(1) {
 [0]=>
 string(68) "C:\foo\include\header.php"
 }
 ["function"]=>
 string(7) "include"
 }
 }
 </BACKTRACE>
 
 in the $_SESSION variable i have an object of type User, and the
 session_start() call tries to load the class User by means of
 __autoload function, but it is located in nowhere, so i cannot use any
 relative path in the require_once ..
 
 this never happends to me before; is this a correct php behaviour ?
 should I fix with an absolute path ?
 
 tnx, bye
 M
  Navigation: [Reply to this message] |