__autoload() Doesn't seem to do anything in PHP

yapadika

New Member
I'm running the latest version of XAMPP and autoload() doesn't seem to be working as it should. I pretty much replaced my previous autoload with the one from the PHP manual, but to no avail.After putting a few echo's and die()s, I've concluded that __autoload isn't being invoked at all.\[code\]class Main{ var $config_data; function __autoload($class_name) { echo "hello."; // If the file exists, require it if (file_exists(SYSTEMDIR.$class_name.".".EXT)) { echo 'Autoloader: The class exists.'; (require_once(SYSTEMDIR.$class_name.".".EXT)) or die("I tried to autoload class $class_name, but it failed! =("); } else { // The file didn't even exist. Die. die("I was going to autoload class $class_name, but it didn't exist! =("); } } /* * Function __construct * @param datatype variable description * @return datatype description */ function __construct(/* $arg */) { //Load the config $this->config = new Config; //Load the uri class: $this->uri = new Uri; }}\[/code\]It doesn't output the "hello" that is located at the very top of __autoload().The only output is: \[quote\] Fatal error: Class 'Config' not found in E:\xampplite\htdocs\system\Main.php on line 84\[/quote\]
 
Top