Show
Ignore:
Timestamp:
05/07/10 02:34:56 (3 years ago)
Author:
plg
Message:

bug 1648 fixed: add the pwg_db_check_version functions for pdo-sqlite, sqlite
and pgsql, also make the $pwg_db_link global in the install_db_connect function
so that it can be used in SQLite functions.

bug fixed: with pdo-sqlite, pwg_db_num_rows always returns 0, so when
initializing user data, it tries to insert the same row twice.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/include/dblayer/functions_pdo-sqlite.inc.php

    r5503 r6090  
    2222// +-----------------------------------------------------------------------+ 
    2323 
    24 define('REQUIRED_PDO-SQLITE_VERSION', '3.0.0'); 
     24define('REQUIRED_PDO_SQLITE_VERSION', '3.0.0'); 
    2525define('DB_ENGINE', 'SQLite'); 
    2626 
     
    5454 
    5555  return $link; 
     56} 
     57 
     58function pwg_db_check_version() 
     59{ 
     60  $current_version = pwg_get_db_version(); 
     61  if (version_compare($current_version, REQUIRED_PDO_SQLITE_VERSION, '<')) 
     62  { 
     63    fatal_error( 
     64      sprintf( 
     65        'your database version is too old, you have "%s" and you need at least "%s"', 
     66        $current_version, 
     67        REQUIRED_PDO_SQLITE_VERSION 
     68        ) 
     69      ); 
     70  } 
    5671} 
    5772