public static function getInstance()
 {
     if (!self::$_instance) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Example #2
0
 public static function instance()
 {
     if (!isset(self::$_instance)) {
         self::$_instance = new Connection();
     }
     return self::$_instance;
 }
Example #3
0
 public static function getInstance($dataBase)
 {
     if (!self::$_instance instanceof self) {
         self::$_instance = new self($dataBase);
     }
     return self::$_instance;
 }
Example #4
0
 /**
  * get instance
  *
  * Falls die einzige Instanz noch nicht existiert, erstelle sie
  * Gebe die einzige Instanz dann zurück
  *
  * @return   Singleton
  */
 public static function getInstance()
 {
     if (null === self::$_instance) {
         self::$_instance = new self();
     }
     return self::$_connection;
 }
Example #5
0
 public static function getInstance($type)
 {
     if (!self::$_instance) {
         // If no instance then make one
         self::$_instance = new self(self::$db_host, self::$db_user, self::$db_pass, self::$database);
     }
     return self::$_instance;
 }
Example #6
0
 public static function getConnexion()
 {
     if (!isset(self::$_instance)) {
         //if ther's no active connexions
         try {
             self::$_instance = new PDO(SQL_DSN, SQL_USERNAME, SQL_PASSWORD);
             //echo self::$_syntaxe ;
         } catch (PDOException $e) {
             echo $e;
         }
     }
     return self::$_instance;
     /* Connexion return */
 }
Example #7
0
 public function __construct()
 {
     self::$_instance = $this->realConnect();
 }