Ignore:
Timestamp:
Mar 21, 2010, 11:51:36 PM (14 years ago)
Author:
nikrou
Message:

Feature 1255 :
only one function
use exceptions to deal with differents possible errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/dblayer/functions_sqlite.inc.php

    r5230 r5236  
    3434 */
    3535
    36 function pwg_db_connect($host, $user, $password, $database, $die=true)
     36function pwg_db_connect($host, $user, $password, $database)
    3737{
    3838  global $conf;
     
    4848    $sqlite_open_mode = SQLITE3_OPEN_READWRITE;
    4949  }
    50   try {
    51     $link = new SQLite3($db_file, $sqlite_open_mode);
    52   } catch (Exception $e) {
    53     my_error('sqlite::open', $die);
     50 
     51  $link = new SQLite3($db_file, $sqlite_open_mode);
     52  if (!$link)
     53  {
     54    throw new  Exception('Connection to server succeed, but it was impossible to connect to database');
    5455  }
    5556
     
    6364
    6465  return $link;
    65 }
    66 
    67 function pwg_select_db($database=null, $link=null, $die=null)
    68 {
    69   return true;
    7066}
    7167
Note: See TracChangeset for help on using the changeset viewer.