Untitled
public php v1 · immutableclass 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]; }}