note 15925 added to function.class-exists
| From: | spamless_blair at nb dot net | Date: | Tue, 09 Oct 2001 05:48:43 +0000 |
| Subject: | note 15925 added to function.class-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-18710@lists.php.net to get a copy of this message | ||
I have a script that includes various class libraries depending on what is contained in the constant
_INCLUDE_LIST which is a comma-delimited string.
define('_INCLUDE_LIST', 'CORE, LIB_DATA, LIB_EMAIL');
I use class_exists() to determine if a class definition has been included before creating an
instance of it.
if(class_exists('CMySQLConnection')) $oData = new CMySQLConnection;
Hope it is helpful for someone!
-Jason Garber
IonZoft.com
--
http://www.php.net/manual/en/function.class-exists.php
http://master.php.net/manage/user-notes.php?action=edit+15925
http://master.php.net/manage/user-notes.php?action=delete+15925
http://master.php.net/manage/user-notes.php?action=reject+15925