Beispiel #1
0
 public static function getInstance()
 {
     if (self::$instance == null) {
         self::$instance = new CModelConnectDB(DSN, DB_USER_NAME, DB_USER_PASS);
         return self::$instance->getDBConnection();
     } else {
         /**
          * Using the one connection to Database for all
          *
          * if it need, it may return false to deny for all other except one
          */
         return false;
     }
 }
Beispiel #2
0
 public static function getInstance()
 {
     if (self::$instance == null) {
         $dsn = CApp::settings('APPLICATION')->db['dsn'];
         $user = CApp::settings('APPLICATION')->db['db_user'];
         $pass = CApp::settings('APPLICATION')->db['db_pass'];
         self::$instance = new CModelConnectDB($dsn, $user, $pass);
         return self::$instance->getDBConnection();
     } else {
         /**
          * Using the one connection to Database for all
          *
          * if it need, it may return false to deny for all other except one
          */
         return false;
     }
 }