I have a file called dbase.class in which I declare a Database class that I utilize in all of my MySQL scripts. However, in the homepage of my site I have different pages included that show different sections of my databases (i.e. the last 5 chat topics, the newest site adddions, the latest poll, etc.). All of these scripts utilize the dbase.class file, or they should for codability. However, I haven't been able to make it that easy because I get errors if two scripts include in my homepage both include() dbase.class then the script throws an error due to redefining the Database class. Therefore, my question basically boils down to:
Is there a PHP coding method to determine if a class is already defined?
Such as:
//dbase.class
<?php
if (!class_is_defined(Database)) {
//Declare the class
}
?>
That way if it already is defined and I reinclude it it won't redeclare the class and I won't get any errors...
Any help, or should I go back to the drawing board with my coding?
Thanks in advance,
Justin Kohlhepp