コード例 #1
0
ファイル: MySQL.php プロジェクト: matthewbaggett/mysql2pdo
 /**
  * Get singelton instance
  *
  * @return MySQL
  */
 public static function getInstance()
 {
     if (!isset(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
コード例 #2
0
ファイル: data.php プロジェクト: ufowiner/RZ-Keven
 public static function getInstance($host = '', $name = '', $pwd = '', $dBase = '')
 {
     if (FALSE == self::$_instance instanceof self) {
         self::$_instance = new self($host, $name, $pwd, $dBase);
     }
     return self::$_instance;
 }
コード例 #3
0
ファイル: MySQL.php プロジェクト: EntityFX/QuikiJAR
 /**
  * Создаёт, либо возвращает единственный экземпляр MyQSL
  * 
  * @param string $server
  * @param string $user
  * @param string $password
  */
 public static function &creator($server, $user, $password)
 {
     if (self::$_instance == NULL) {
         self::$_instance = new MySQL($server, $user, $password);
     }
     return self::$_instance;
 }
コード例 #4
0
ファイル: MySQL.php プロジェクト: chao666/share
 static function GetInstance($host, $user, $password, $database)
 {
     if (self::$_instance == null || self::$mysqli != null) {
         self::$_instance = new MySQL();
         self::$mysqli = new mysqli($host, $user, $password, $database);
         if (mysqli_connect_errno()) {
             printf("数据库连接失败!:%s\n", mysqli_connect_error());
         }
     }
     return self::$_instance;
 }
コード例 #5
0
ファイル: MySQL.php プロジェクト: bamcod/PubCodeHub
 /**
  * Singleton accessor to the database instance
  * -- change this to use a md5 on the $params to allow for multiple single instances
  */
 public static function getInstance($params = NULL)
 {
     if (self::$_instance == NULL) {
         self::$_instance = new MySQL($params);
     }
     return self::$_instance;
 }