I've checked out most of the __autoload posts here, but I don't find my following their guidelines resulting in my own script working.
So, anyways, I have my site structured into two different folders, 'sys' & 'public' (same hierarchal level). I have a subdomain pointing to 'public' (I'm not allowed in httpd.conf, I know the root remains unchanged) in which 'index.php' resides:
Code: Select all
include_once '../sys/core/init.inc.php';
$engine = new Engine(true);
Code: Select all
session_start();
/*
* Generate token
*/
if(!isset($_SESSION['token'])) {
$_SESSION['token'] = sha1(uniqid(mt_rand(), TRUE));
}
include_once '../sys/config/db-cred.inc.php'; // Working
foreach($C as $name => $val) {
define($name, $val); // Working, refers to db-cred
}
function __autoload($class) {
$filename = '../sys/class/class.'.$class.'.inc.php'; // FYI i've tried every possible combination of ../ and so forth
if(file_exists($filename)) {
include_once $filename;
}
}
[text]Fatal error: Class 'Engine' not found in /customers/somedomain.de/somedomain.de/httpd.www/public/index.php on line 3[/text]
Line 3 being the 'new Engine(true)' part..
The Engine class does not extend any other class but does, however, have its own __autoload and creates instances of other classes as well as requesting static methods from some of them.
It's working perfectly on my MAMP setup, which gives me some sense of 'it can't be all wrong', but what do I know.
I've exhausted my simple mind in a vain attempt to understand the situation, I'm hoping to get maybe a poke in the right direction..
Any help will be greatly appreciated,
A Dane in despair..