2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Merged from McMasterReports branch

This commit is contained in:
azammitdcarf
2010-01-14 07:45:37 +00:00
parent 18dbb16138
commit d1b139d315
1884 changed files with 555891 additions and 364768 deletions

View File

@@ -1,6 +1,6 @@
<?php
/*
V4.94 23 Jan 2007 (c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved.
V5.08 6 Apr 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
@@ -64,39 +64,7 @@ function adodb_pdo_type($t)
class ADODB_pdo_base extends ADODB_pdo {
var $sysDate = "'?'";
var $sysTimeStamp = "'?'";
function _init($parentDriver)
{
$parentDriver->_bindInputArray = true;
#$parentDriver->_connectionID->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,true);
}
function ServerInfo()
{
return ADOConnection::ServerInfo();
}
function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
{
$ret = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
return $ret;
}
function MetaTables()
{
return false;
}
function MetaColumns()
{
return false;
}
}
class ADODB_pdo extends ADOConnection {
@@ -124,7 +92,7 @@ class ADODB_pdo extends ADOConnection {
function _UpdatePDO()
{
$d = &$this->_driver;
$d = $this->_driver;
$this->fmtDate = $d->fmtDate;
$this->fmtTimeStamp = $d->fmtTimeStamp;
$this->replaceQuote = $d->replaceQuote;
@@ -147,7 +115,7 @@ class ADODB_pdo extends ADOConnection {
if (!empty($this->_driver->_hasdual)) $sql = "select $this->sysTimeStamp from dual";
else $sql = "select $this->sysTimeStamp";
$rs =& $this->_Execute($sql);
$rs = $this->_Execute($sql);
if ($rs && !$rs->EOF) return $this->UnixTimeStamp(reset($rs->fields));
return false;
@@ -190,6 +158,7 @@ class ADODB_pdo extends ADOConnection {
case 'mysql':
case 'pgsql':
case 'mssql':
case 'sqlite':
include_once(ADODB_DIR.'/drivers/adodb-pdo_'.$this->dsnType.'.inc.php');
break;
}
@@ -206,6 +175,15 @@ class ADODB_pdo extends ADOConnection {
return false;
}
function Concat()
{
$args = func_get_args();
if(method_exists($this->_driver, 'Concat'))
return call_user_func_array(array($this->_driver, 'Concat'), $args);
return call_user_func_array(array($this,'parent::Concat'), $args);
}
// returns true or false
function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
{
@@ -248,6 +226,10 @@ class ADODB_pdo extends ADOConnection {
else $obj->bindParam($name, $var);
}
function OffsetDate($dayFraction,$date=false)
{
return $this->_driver->OffsetDate($dayFraction,$date);
}
function ErrorMsg()
{
@@ -280,8 +262,19 @@ class ADODB_pdo extends ADOConnection {
return $err;
}
function SetTransactionMode($transaction_mode)
{
if(method_exists($this->_driver, 'SetTransactionMode'))
return $this->_driver->SetTransactionMode($transaction_mode);
return parent::SetTransactionMode($seqname);
}
function BeginTrans()
{
if(method_exists($this->_driver, 'BeginTrans'))
return $this->_driver->BeginTrans();
if (!$this->hasTransactions) return false;
if ($this->transOff) return true;
$this->transCnt += 1;
@@ -292,6 +285,9 @@ class ADODB_pdo extends ADOConnection {
function CommitTrans($ok=true)
{
if(method_exists($this->_driver, 'CommitTrans'))
return $this->_driver->CommitTrans($ok);
if (!$this->hasTransactions) return false;
if ($this->transOff) return true;
if (!$ok) return $this->RollbackTrans();
@@ -305,6 +301,9 @@ class ADODB_pdo extends ADOConnection {
function RollbackTrans()
{
if(method_exists($this->_driver, 'RollbackTrans'))
return $this->_driver->RollbackTrans();
if (!$this->hasTransactions) return false;
if ($this->transOff) return true;
if ($this->transCnt) $this->transCnt -= 1;
@@ -331,6 +330,30 @@ class ADODB_pdo extends ADOConnection {
return $obj;
}
function CreateSequence($seqname='adodbseq',$startID=1)
{
if(method_exists($this->_driver, 'CreateSequence'))
return $this->_driver->CreateSequence($seqname, $startID);
return parent::CreateSequence($seqname, $startID);
}
function DropSequence($seqname='adodbseq')
{
if(method_exists($this->_driver, 'DropSequence'))
return $this->_driver->DropSequence($seqname);
return parent::DropSequence($seqname);
}
function GenID($seqname='adodbseq',$startID=1)
{
if(method_exists($this->_driver, 'GenID'))
return $this->_driver->GenID($seqname, $startID);
return parent::GenID($seqname, $startID);
}
/* returns queryID or false */
function _query($sql,$inputarr=false)
@@ -390,6 +413,40 @@ class ADODB_pdo extends ADOConnection {
}
}
class ADODB_pdo_base extends ADODB_pdo {
var $sysDate = "'?'";
var $sysTimeStamp = "'?'";
function _init($parentDriver)
{
$parentDriver->_bindInputArray = true;
#$parentDriver->_connectionID->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,true);
}
function ServerInfo()
{
return ADOConnection::ServerInfo();
}
function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
{
$ret = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
return $ret;
}
function MetaTables()
{
return false;
}
function MetaColumns()
{
return false;
}
}
class ADOPDOStatement {
var $databaseType = "pdo";
@@ -506,7 +563,7 @@ class ADORecordSet_pdo extends ADORecordSet {
}
// returns the field object
function &FetchField($fieldOffset = -1)
function FetchField($fieldOffset = -1)
{
$off=$fieldOffset+1; // offsets begin at 1