mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 09:01:40 +01:00
Better type hinting for DoliDB
This commit is contained in:
@@ -70,8 +70,8 @@ class DoliDBSqlite extends DoliDB
|
||||
|
||||
/*if (! function_exists("sqlite_query"))
|
||||
{
|
||||
$this->connected = 0;
|
||||
$this->ok = 0;
|
||||
$this->connected = false;
|
||||
$this->ok = false;
|
||||
$this->error="Sqlite PHP functions for using Sqlite driver are not available in this version of PHP. Try to use another driver.";
|
||||
dol_syslog(get_class($this)."::DoliDBSqlite : Sqlite PHP functions for using Sqlite driver are not available in this version of PHP. Try to use another driver.",LOG_ERR);
|
||||
return $this->ok;
|
||||
@@ -79,8 +79,8 @@ class DoliDBSqlite extends DoliDB
|
||||
|
||||
/*if (! $host)
|
||||
{
|
||||
$this->connected = 0;
|
||||
$this->ok = 0;
|
||||
$this->connected = false;
|
||||
$this->ok = false;
|
||||
$this->error=$langs->trans("ErrorWrongHostParameter");
|
||||
dol_syslog(get_class($this)."::DoliDBSqlite : Erreur Connect, wrong host parameters",LOG_ERR);
|
||||
return $this->ok;
|
||||
@@ -92,9 +92,9 @@ class DoliDBSqlite extends DoliDB
|
||||
|
||||
if ($this->db)
|
||||
{
|
||||
$this->connected = 1;
|
||||
$this->ok = 1;
|
||||
$this->database_selected = 1;
|
||||
$this->connected = true;
|
||||
$this->ok = true;
|
||||
$this->database_selected = true;
|
||||
$this->database_name = $name;
|
||||
|
||||
$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
@@ -102,9 +102,9 @@ class DoliDBSqlite extends DoliDB
|
||||
else
|
||||
{
|
||||
// host, login ou password incorrect
|
||||
$this->connected = 0;
|
||||
$this->ok = 0;
|
||||
$this->database_selected = 0;
|
||||
$this->connected = false;
|
||||
$this->ok = false;
|
||||
$this->database_selected = false;
|
||||
$this->database_name = '';
|
||||
//$this->error=sqlite_connect_error();
|
||||
dol_syslog(get_class($this)."::DoliDBSqlite : Erreur Connect ".$this->error,LOG_ERR);
|
||||
@@ -360,7 +360,7 @@ class DoliDBSqlite extends DoliDB
|
||||
if ($this->db)
|
||||
{
|
||||
if ($this->transaction_opened > 0) dol_syslog(get_class($this)."::close Closing a connection with an opened transaction depth=".$this->transaction_opened,LOG_ERR);
|
||||
$this->connected=0;
|
||||
$this->connected=false;
|
||||
$this->db=null; // Clean this->db
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user