- added scope of class variables

This commit is contained in:
steinm 2013-02-04 09:27:24 +00:00
parent c68e0165a5
commit 64f4961a50

View File

@ -22,24 +22,71 @@
* @version Release: @package_version@ * @version Release: @package_version@
*/ */
class LetoDMS_Core_DatabaseAccess { class LetoDMS_Core_DatabaseAccess {
var $_debug; /**
var $_driver; * @var boolean set to true for debug mode
var $_hostname; */
var $_database; public $_debug;
var $_user;
var $_passw;
var $_conn;
var $_connected;
var $_ttreviewid;
var $_ttapproveid;
var $_ttstatid;
var $_ttcontentid;
var $_intransaction;
/*
Backup functions
*/
/**
* @var string name of database driver (mysql or sqlite3)
*/
protected $_driver;
/**
* @var string name of hostname
*/
protected $_hostname;
/**
* @var string name of database
*/
protected $_database;
/**
* @var string name of database user
*/
protected $_user;
/**
* @var string password of database user
*/
protected $_passw;
/**
* @var object internal database connection
*/
private $_conn;
/**
* @var boolean set to true if connection to database is established
*/
private $_connected;
/**
* @var boolean set to true if temp. table for tree view has been created
*/
private $_ttreviewid;
/**
* @var boolean set to true if temp. table for approvals has been created
*/
private $_ttapproveid;
/**
* @var boolean set to true if temp. table for doc status has been created
*/
private $_ttstatid;
/**
* @var boolean set to true if temp. table for doc content has been created
*/
private $_ttcontentid;
/**
* @var boolean set to true if in a database transaction
*/
private $_intransaction;
/** /**
* Return list of all database tables * Return list of all database tables
* *
@ -47,7 +94,7 @@ class LetoDMS_Core_DatabaseAccess {
* *
* @return array list of table names * @return array list of table names
*/ */
function TableList() { function TableList() { /* {{{ */
switch($this->_driver) { switch($this->_driver) {
case 'mysql': case 'mysql':
$sql = "select TABLE_NAME as name from information_schema.tables where TABLE_SCHEMA='letodms' and TABLE_TYPE='BASE TABLE'"; $sql = "select TABLE_NAME as name from information_schema.tables where TABLE_SCHEMA='letodms' and TABLE_TYPE='BASE TABLE'";
@ -63,7 +110,7 @@ class LetoDMS_Core_DatabaseAccess {
foreach($arr as $tmp) foreach($arr as $tmp)
$res[] = $tmp['name']; $res[] = $tmp['name'];
return $res; return $res;
} } /* }}} */
/** /**
* Constructor of LetoDMS_Core_DatabaseAccess * Constructor of LetoDMS_Core_DatabaseAccess
@ -76,7 +123,7 @@ class LetoDMS_Core_DatabaseAccess {
* @param string $passw password of user * @param string $passw password of user
* @param string $database name of database * @param string $database name of database
*/ */
function LetoDMS_Core_DatabaseAccess($driver, $hostname, $user, $passw, $database = false) { function LetoDMS_Core_DatabaseAccess($driver, $hostname, $user, $passw, $database = false) { /* {{{ */
$this->_driver = $driver; $this->_driver = $driver;
$this->_hostname = $hostname; $this->_hostname = $hostname;
$this->_database = $database; $this->_database = $database;
@ -96,7 +143,7 @@ class LetoDMS_Core_DatabaseAccess {
$this->_ttstatid = false; $this->_ttstatid = false;
$this->_ttcontentid = false; $this->_ttcontentid = false;
$this->_debug = false; $this->_debug = false;
} } /* }}} */
/** /**
* Connect to database * Connect to database
@ -150,7 +197,6 @@ class LetoDMS_Core_DatabaseAccess {
return $this->_conn->quote($text); return $this->_conn->quote($text);
} /* }}} */ } /* }}} */
/** /**
* Execute SQL query and return result * Execute SQL query and return result
* *