Beispiel #1
0
 private static function initDB()
 {
     if (self::$db === NULL) {
         self::$db = new DbUtil(DbConfig::getHost(), DbConfig::getUserName(), DbConfig::getUserPwd(), DbConfig::getDbName());
         self::$login_time = time();
     } else {
         $cur = time();
         if ($cur - self::$login_time > 60) {
             self::$db->close();
             self::$db->init(DbConfig::getHost(), DbConfig::getUserName(), DbConfig::getUserPwd(), DbConfig::getDbName());
             self::$login_time = $cur;
         }
     }
     return TRUE;
 }