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:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version V4.94 23 Jan 2007 (c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved.
|
||||
* @version V5.06 16 Oct 2008 (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.
|
||||
@@ -109,11 +109,11 @@ class DB
|
||||
* error
|
||||
*/
|
||||
|
||||
function &factory($type)
|
||||
function factory($type)
|
||||
{
|
||||
include_once(ADODB_DIR."/drivers/adodb-$type.inc.php");
|
||||
$obj = &NewADOConnection($type);
|
||||
if (!is_object($obj)) $obj =& new PEAR_Error('Unknown Database Driver: '.$dsninfo['phptype'],-1);
|
||||
$obj = NewADOConnection($type);
|
||||
if (!is_object($obj)) $obj = new PEAR_Error('Unknown Database Driver: '.$dsninfo['phptype'],-1);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ class DB
|
||||
* @see DB::parseDSN
|
||||
* @see DB::isError
|
||||
*/
|
||||
function &connect($dsn, $options = false)
|
||||
function connect($dsn, $options = false)
|
||||
{
|
||||
if (is_array($dsn)) {
|
||||
$dsninfo = $dsn;
|
||||
@@ -157,9 +157,9 @@ class DB
|
||||
@include_once("adodb-$type.inc.php");
|
||||
}
|
||||
|
||||
@$obj =& NewADOConnection($type);
|
||||
@$obj = NewADOConnection($type);
|
||||
if (!is_object($obj)) {
|
||||
$obj =& new PEAR_Error('Unknown Database Driver: '.$dsninfo['phptype'],-1);
|
||||
$obj = new PEAR_Error('Unknown Database Driver: '.$dsninfo['phptype'],-1);
|
||||
return $obj;
|
||||
}
|
||||
if (is_array($options)) {
|
||||
@@ -211,7 +211,7 @@ class DB
|
||||
function isError($value)
|
||||
{
|
||||
if (!is_object($value)) return false;
|
||||
$class = get_class($value);
|
||||
$class = strtolower(get_class($value));
|
||||
return $class == 'pear_error' || is_subclass_of($value, 'pear_error') ||
|
||||
$class == 'db_error' || is_subclass_of($value, 'db_error');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user