17 define(
'ADODB_OUTP', array(
'DBConnection',
'logAdodbMessage'));
50 $this->connected =
false;
52 if (func_num_args() == 0) {
55 $args = func_get_args();
56 call_user_func_array(array($this,
'initCustomDBConnection'), $args);
81 $this->host .=
':' . $socket;
83 $this->host .=
':' . $port;
88 $this->persistent =
Config::getVar(
'database',
'persistent') ? true :
false;
89 $this->connectionCharset =
Config::getVar(
'i18n',
'connection_charset');
91 $this->connectOnInit =
true;
92 $this->forceNew =
false;
132 require_once(
'lib/pkp/lib/vendor/adodb/adodb-php/adodb.inc.php');
134 $this->dbconn = ADONewConnection($this->driver);
136 if ($this->connectOnInit) {
148 if ($this->persistent) {
149 $this->connected = @$this->dbconn->PConnect(
157 $this->connected = @$this->dbconn->Connect(
168 $this->dbconn->debug =
true;
171 if ($this->connected && $this->connectionCharset) {
174 $this->dbconn->SetCharSet($this->connectionCharset);
184 if ($this->connected) {
185 $this->dbconn->Disconnect();
186 $this->connected =
false;
197 $this->persistent =
false;
224 return isset($this->dbconn) ? $this->dbconn->numQueries : 0;
235 if (isset($setInstance)) {
236 $instance = $setInstance;
237 }
else if ($instance ===
null) {
250 return $conn->getDBConn();