2
0
forked from Wavyzz/dolibarr

Better type hinting for DoliDB

This commit is contained in:
Raphaël Doursenaud
2015-05-12 19:01:01 +02:00
parent ccd14c8305
commit 27d52cf2b0
16 changed files with 145 additions and 158 deletions

View File

@@ -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;
}