All pastes #369345 Raw Edit

Untitled

public php v1 · immutable
#369345 ·published 2007-02-23 19:53 UTC
rendered paste body
class dbInterface { public static $_instance = array();  public static function GetInstance($name, $type=NULL, $config=NULL) {    if ( !isset(self::$_instance[$name]) ) {          if ( class_exists($type) ) {               self::$_instance[$name] = new $type($config);		  } else {		       throw new Exception('Impossible d\'instancier '.$name.' : aucune implémentation de '.$type.' n\'existe.');		  }   }	  return self::$_instance[$name];  	  }}