예제 #1
0
 public static function accessFactory()
 {
     $db = '';
     if (defined("DATABASE_TRANSACTIONAL") && DATABASE_TRANSACTIONAL) {
         $db = DbLayerTransSingleton::getInstance(DATABASE_DRIVER, DATABASE_URL, DATABASE_NAME, DATABASE_LOGIN, DATABASE_PASS, false);
     } else {
         $db = dbLayerSingleton::getInstance(DATABASE_DRIVER, DATABASE_URL, DATABASE_NAME, DATABASE_LOGIN, DATABASE_PASS, false);
     }
     return $db;
 }
예제 #2
0
 function test_mysqlstore()
 {
     global $_Auth_OpenID_db_test_host;
     $db = DbLayerTransSingleton::getInstance('mysql', 'localhost', 'test', 'root', '', false);
     $temp_db_name = _Auth_OpenID_getTmpDbName();
     $result = $db->execute("CREATE DATABASE {$temp_db_name}");
     $db = DbLayerTransSingleton::getInstance('mysql', 'localhost', $temp_db_name, 'root', '', false);
     $result = $db->execute("USE {$temp_db_name}");
     $store =& new WMySqlStore($db);
     $store->createTables();
     $this->_testStore($store);
     $this->_testNonce($store);
     $this->_testNonceCleanup($store);
     $db->execute("DROP DATABASE {$temp_db_name}");
 }