Etienne Kneuss

home » repository » php » ircbot » libraries » class.DB.php
Tree:
school
mp3
php
sample
publications
Math_Derivative
Math_Expression
ircbot
libraries
class.Link_IRC.php
class.DB_mySQL.php
class.Link.php
expt.DB_Exception.php
class.DB_mySQL_Results.php
class.DB_Common_Results.php
class.DB.php
class.DB_Common.php
iface.Observed.php
iface.Observer.php
class.BaseArray.php
class.Bot.php
modules
exceptions
bot.php
plopbot.sql
php.net
images
dump

Source code raw phps

    <?php require_once 'libraries/expt.DB_Exception.php'; require_once 'libraries/class.DB_mySQL.php'; class DB  {     static protected $_instance;     public static function instance()     {         if (!DB::$_instance instanceof DB_Common) {             throw new DB_Exception('Invalid instance');         }         return DB::$_instance;     }          public static function initiate($type)      {         $className = 'DB_'.$type;                   if (!class_exists($className)) {             throw new DB_Exception('Unable to instanciate the database handler class ('.$className.'), you need to defined it first.');         }                  DB::$_instance = new $className;                  return DB::$_instance;     } } ?>

Comments

There is currently no comment here.

Add a comment

Username:

Spam Challenge: 1+11=?

Comment: