Page 1 of 1

Classes - Includes - and other issues

Posted: Mon Mar 03, 2003 3:52 pm
by NoReason
Well i suppose its just one issue, and that is ...

Fatal error: Cannot instantiate non-existent class: sqlselect in /path/to/my/php/scripts/here/authme.php on line 5

Now im using an odd methodology in how im constructing my application, however this is the first time I have run into this problem.

My design is as follows;
index.php
Includes:
require('config.ini');
require($IncludePath.'sessionheader.php');
require($IncludePath.'html_header.php');
require($IncludePath.'classes.php');
|->require('layout_page.php');
| require($IncludePath.'html_footer');
|
| from the layout_page.php: (I will only include relevent info here)
| Includes:
|->include($ModulesPath.'accounts/authme.php');


Now if I use a class_exists() on the index.php after classes declaration I get an "OK!" , if I use classes_exists() on the layout_page.php include i get an "OK!", however if I use it on the authme.php include off the layout_page.php I get a FAIL!

Is there a maximum depth that declarations will carry over? I would not think so considerng the includes take effect before proccessing of the page occures....

Oh and yes, I have set the require() on index.php so i /know/ its finding the classes.php

help me? thanks :)

Posted: Mon Mar 03, 2003 4:10 pm
by patrikG
Check your parantheses "}" and "{". Usually the error you get means that there is some error in the class.

nope

Posted: Mon Mar 03, 2003 4:35 pm
by NoReason
No problems with the class i have tested them outside this application.

Upon further investigation however I am noticing that the $SCRIPT_PATH changes from /blah/index.php to /path/to/modules/runme.php when the page is /Submited/ wich makes sense since its that file that is now proccessing the requested script, but that should not make a differance I would not think... Would i loose control of the class in that case??

Do I have to redeclare the class on each page that proccess's its own script even though it is included into the index.php ..???

yup

Posted: Mon Mar 03, 2003 5:04 pm
by NoReason
Yup, thats were it all goes to hell, as soon as I submit.. the page proccess independantly of the index.php, so has no idea of the requiers() or includes().... Which would mean that I would have to declare all includes on each new proccess....

What a pain in the ass,,,,,