コード例 #1
0
 public static function getInstance()
 {
     if (!self::$_instance) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
コード例 #2
0
ファイル: dbConnection.php プロジェクト: alextsak/Ekpalib
 public static function instance()
 {
     if (!isset(self::$_instance)) {
         self::$_instance = new Connection();
     }
     return self::$_instance;
 }
コード例 #3
0
ファイル: Connection.php プロジェクト: juan2ramos/llenitas
 public static function getInstance($dataBase)
 {
     if (!self::$_instance instanceof self) {
         self::$_instance = new self($dataBase);
     }
     return self::$_instance;
 }
コード例 #4
0
ファイル: Connection.php プロジェクト: OSPFIA32/osp
 /**
  * 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;
 }
コード例 #5
0
ファイル: Connection.php プロジェクト: sheyooo/testify
 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;
 }
コード例 #6
0
ファイル: class.mysql.php プロジェクト: CoxyBoris/SimpleMVC
 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 */
 }
コード例 #7
0
ファイル: Connection.class.php プロジェクト: ununik/kvhusti
 public function __construct()
 {
     self::$_instance = $this->realConnect();
 }