|
Open Monograph Press
3.3.0
|
Public Member Functions | |
| __construct () | |
| connect () | |
| disconnect () | |
| & | getDBConn () |
| getDriver () | |
| getNumQueries () | |
| initConn () | |
| initCustomDBConnection ($driver, $host, $username, $password, $databaseName, $persistent=false, $connectionCharset=false, $connectOnInit=true, $debug=false, $forceNew=false) | |
| initDefaultDBConnection () | |
| isConnected () | |
| reconnect ($forceNew=false) | |
Static Public Member Functions | |
| static & | getConn () |
| static | getInstance ($setInstance=null) |
| static | logAdodbMessage ($msg, $newline=true) |
Data Fields | |
| $connected | |
| $connectionCharset | |
| $connectOnInit | |
| $databaseName | |
| $dbconn | |
| $debug | |
| $driver | |
| $forceNew | |
| $host | |
| $password | |
| $persistent | |
| $username | |
Class for accessing the low-level database connection. Currently integrated with ADOdb (from http://adodb.sourceforge.net).
Definition at line 19 of file DBConnection.inc.php.
| DBConnection::__construct | ( | ) |
Constructor. Calls initDefaultDBConnection if no arguments are passed, otherwise calls initCustomDBConnection with custom connection parameters.
Definition at line 58 of file DBConnection.inc.php.
References initDefaultDBConnection().
| DBConnection::connect | ( | ) |
Establish connection to the database.
Definition at line 156 of file DBConnection.inc.php.
References $connected.
Referenced by initConn(), and reconnect().
| DBConnection::disconnect | ( | ) |
Disconnect from the database.
Definition at line 192 of file DBConnection.inc.php.
Referenced by reconnect().
|
static |
Return a reference to a single static instance of the database connection.
Definition at line 257 of file DBConnection.inc.php.
References getInstance().
Referenced by DAO\__construct(), XmlToSqlTool\execute(), DBDataXMLParser\executeData(), AdminHandler\systemInfo(), DBDataXMLParserTest\testParseSQLData(), DBDataXMLParserTest\testParseSQLDDL(), and DBDataXMLParserTest\testParseTableData().
| & DBConnection::getDBConn | ( | ) |
Return the database connection object.
Definition at line 216 of file DBConnection.inc.php.
References $dbconn.
| DBConnection::getDriver | ( | ) |
Return the name of the driver used for this connection.
Definition at line 266 of file DBConnection.inc.php.
References $driver.
|
static |
Return a reference to a single static instance of the database connection manager.
| $setInstance | DBConnection |
Definition at line 241 of file DBConnection.inc.php.
References Registry\get().
Referenced by PKPApplication\__construct(), PKPInstall\createDatabase(), InstallPluginVersionTool\execute(), getConn(), DAO\getDriver(), PKPLocale\initialize(), PKPInstall\preInstall(), Installer\preInstall(), and DatabaseTestCase\setUp().
| DBConnection::getNumQueries | ( | ) |
Get number of database queries executed.
Definition at line 232 of file DBConnection.inc.php.
| DBConnection::initConn | ( | ) |
Initialize database connection object and establish connection to the database.
Definition at line 140 of file DBConnection.inc.php.
References connect().
Referenced by initCustomDBConnection(), and initDefaultDBConnection().
| DBConnection::initCustomDBConnection | ( | $driver, | |
| $host, | |||
| $username, | |||
| $password, | |||
| $databaseName, | |||
$persistent = false, |
|||
$connectionCharset = false, |
|||
$connectOnInit = true, |
|||
$debug = false, |
|||
$forceNew = false |
|||
| ) |
Create new database connection with the specified connection parameters.
| $driver | string |
| $host | string (Use host:socket and host:port for non-standard port and socket) |
| $username | string |
| $password | string |
| $databaseName | string |
| $persistent | boolean use persistent connections (default false) |
| $connectionCharset | string character set to use for the connection (default none) |
| $connectOnInit | boolean establish database connection on initiation (default true) |
| $debug | boolean enable verbose debug output (default false) |
| $forceNew | boolean force a new connection (default false) |
Definition at line 121 of file DBConnection.inc.php.
References $connectionCharset, $connectOnInit, $databaseName, $debug, $driver, $forceNew, $host, $password, $persistent, $username, and initConn().
| DBConnection::initDefaultDBConnection | ( | ) |
Create new database connection with the connection parameters from the system configuration.
Definition at line 84 of file DBConnection.inc.php.
References Config\getVar(), and initConn().
Referenced by __construct().
| DBConnection::isConnected | ( | ) |
Check if a database connection has been established.
Definition at line 224 of file DBConnection.inc.php.
References $connected.
|
static |
Log message handler for ADODB.
| $msg | string |
| $newline | boolean |
Definition at line 75 of file DBConnection.inc.php.
References Registry\get(), and PKPString\html2text().
| DBConnection::reconnect | ( | $forceNew = false | ) |
Reconnect to the database.
| $forceNew | boolean force a new connection |
Definition at line 203 of file DBConnection.inc.php.
References $forceNew, connect(), and disconnect().
| boolean DBConnection::$connected |
indicate connection status
Definition at line 50 of file DBConnection.inc.php.
Referenced by connect(), and isConnected().
| DBConnection::$connectionCharset |
Definition at line 31 of file DBConnection.inc.php.
Referenced by initCustomDBConnection().
| boolean DBConnection::$connectOnInit |
establish connection on initiation
Definition at line 38 of file DBConnection.inc.php.
Referenced by initCustomDBConnection().
| DBConnection::$databaseName |
Definition at line 29 of file DBConnection.inc.php.
Referenced by initCustomDBConnection().
| DBConnection::$dbconn |
The underlying database connection object
Definition at line 22 of file DBConnection.inc.php.
Referenced by getDBConn().
| DBConnection::$debug |
Definition at line 44 of file DBConnection.inc.php.
Referenced by initCustomDBConnection().
| DBConnection::$driver |
Database connection parameters
Definition at line 25 of file DBConnection.inc.php.
Referenced by getDriver(), and initCustomDBConnection().
| DBConnection::$forceNew |
Definition at line 32 of file DBConnection.inc.php.
Referenced by initCustomDBConnection(), and reconnect().
| DBConnection::$host |
Definition at line 26 of file DBConnection.inc.php.
Referenced by initCustomDBConnection().
| DBConnection::$password |
Definition at line 28 of file DBConnection.inc.php.
Referenced by initCustomDBConnection().
| DBConnection::$persistent |
Definition at line 30 of file DBConnection.inc.php.
Referenced by initCustomDBConnection().
| DBConnection::$username |
Definition at line 27 of file DBConnection.inc.php.
Referenced by initCustomDBConnection().