Entry
How can I tell if a class is defined?
Aug 4th, 1999 08:49
Nathan Wallace, Werner Stuerenburg
You can do it this way:
if(!defined("__PREPEND_INCLUDE_INC__"))
include("$DOCUMENT_ROOT/php3/phplib6/prepend.php3");
and in prepend.php3, I begin with
if(!defined("__PREPEND_INCLUDE_INC__"))
define("__PREPEND_INCLUDE_INC__",1);
Nice way, but you need to manage your includes with an if-statement. An
alternative solution may be
prepend.php3:
if(!defined("__PREPEND_INCLUDE_INC__")) {
define("__PREPEND_INCLUDE_INC__",1);
// your code
}
So you can leave your include simple.