mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-65740 lib: Adodb library update
This commit is contained in:
parent
f3507273e9
commit
0e5f79e80c
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
|
@ -8,7 +8,7 @@ $ADODB_INCLUDED_CSV = 1;
|
||||
|
||||
/*
|
||||
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -16,14 +16,10 @@ $ADODB_INCLUDED_CSV = 1;
|
||||
the BSD license will take precedence. See License.txt.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Library for CSV serialization. This is used by the csv/proxy driver and is the
|
||||
CacheExecute() serialization format.
|
||||
|
||||
==== NOTE ====
|
||||
Format documented at http://php.weblogs.com/ADODB_CSV
|
||||
==============
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.9 21-Dec-2016
|
||||
* @version v5.20.14 06-Jan-2019
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.9 21-Dec-2016
|
||||
* @version v5.20.14 06-Jan-2019
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
@ -9,7 +9,7 @@
|
||||
*
|
||||
* Set tabs to 4 for best viewing.
|
||||
*
|
||||
* Latest version is available at http://php.weblogs.com
|
||||
* Latest version is available at http://adodb.org/
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.9 21-Dec-2016
|
||||
* @version v5.20.14 06-Jan-2019
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
@ -9,7 +9,7 @@
|
||||
*
|
||||
* Set tabs to 4 for best viewing.
|
||||
*
|
||||
* Latest version is available at http://php.weblogs.com
|
||||
* Latest version is available at http://adodb.org/
|
||||
*
|
||||
*/
|
||||
include_once('PEAR.php');
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @version v5.20.9 21-Dec-2016
|
||||
* @version v5.20.14 06-Jan-2019
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
@ -10,7 +10,7 @@
|
||||
*
|
||||
* Set tabs to 4 for best viewing.
|
||||
*
|
||||
* Latest version is available at http://php.weblogs.com
|
||||
* Latest version is available at http://adodb.org/
|
||||
*
|
||||
* Exception-handling code using PHP5 exceptions (try-catch-throw).
|
||||
*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -6,7 +6,7 @@ global $ADODB_INCLUDED_LIB;
|
||||
$ADODB_INCLUDED_LIB = 1;
|
||||
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -218,6 +218,13 @@ function _adodb_getmenu(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=f
|
||||
{
|
||||
$hasvalue = false;
|
||||
|
||||
if (is_array($name))
|
||||
{
|
||||
/*
|
||||
* Reserved for future use
|
||||
*/
|
||||
}
|
||||
|
||||
if ($multiple or is_array($defstr)) {
|
||||
if ($size==0) $size=5;
|
||||
$attr = ' multiple size="'.$size.'"';
|
||||
@ -227,12 +234,15 @@ function _adodb_getmenu(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=f
|
||||
|
||||
$s = '<select name="'.$name.'"'.$attr.' '.$selectAttr.'>';
|
||||
if ($blank1stItem)
|
||||
{
|
||||
if (is_string($blank1stItem)) {
|
||||
$barr = explode(':',$blank1stItem);
|
||||
if (sizeof($barr) == 1) $barr[] = '';
|
||||
$s .= "\n<option value=\"".$barr[0]."\">".$barr[1]."</option>";
|
||||
} else $s .= "\n<option></option>";
|
||||
|
||||
}
|
||||
else
|
||||
$s .= "\n<option></option>";
|
||||
}
|
||||
if ($zthis->FieldCount() > 1) $hasvalue=true;
|
||||
else $compareFields0 = true;
|
||||
|
||||
@ -248,34 +258,21 @@ function _adodb_getmenu(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=f
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($fieldsize > 1) {
|
||||
if (isset($zthis->fields[1]))
|
||||
$zval2 = rtrim($zthis->fields[1]);
|
||||
$myFields = array_map('trim',array_values($zthis->fields));
|
||||
|
||||
if ($fieldsize > 1) {
|
||||
if (isset($myFields[1]))
|
||||
$zval2 = $myFields[1];
|
||||
else
|
||||
$zval2 = rtrim(next($zthis->fields));
|
||||
$zval2 = next($myFields);
|
||||
}
|
||||
$selected = ($compareFields0) ? $zval : $zval2;
|
||||
|
||||
$group = '';
|
||||
if ($fieldsize > 2) {
|
||||
$group = rtrim($zthis->fields[2]);
|
||||
}
|
||||
/*
|
||||
if ($optgroup != $group) {
|
||||
$optgroup = $group;
|
||||
if ($firstgroup) {
|
||||
$firstgroup = false;
|
||||
$s .="\n<optgroup label='". htmlspecialchars($group) ."'>";
|
||||
} else {
|
||||
$s .="\n</optgroup>";
|
||||
$s .="\n<optgroup label='". htmlspecialchars($group) ."'>";
|
||||
}
|
||||
}
|
||||
*/
|
||||
if ($hasvalue)
|
||||
$value = " value='".htmlspecialchars($zval2)."'";
|
||||
|
||||
if (is_array($defstr)) {
|
||||
if (is_array($defstr))
|
||||
{
|
||||
|
||||
if (in_array($selected,$defstr))
|
||||
$s .= "\n<option selected='selected'$value>".htmlspecialchars($zval).'</option>';
|
||||
@ -291,10 +288,6 @@ function _adodb_getmenu(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=f
|
||||
$zthis->MoveNext();
|
||||
} // while
|
||||
|
||||
// closing last optgroup
|
||||
if($optgroup != null) {
|
||||
$s .= "\n</optgroup>";
|
||||
}
|
||||
return $s ."\n</select>\n";
|
||||
}
|
||||
|
||||
@ -304,6 +297,13 @@ function _adodb_getmenu_gp(&$zthis, $name,$defstr='',$blank1stItem=true,$multipl
|
||||
{
|
||||
$hasvalue = false;
|
||||
|
||||
if (is_array($name))
|
||||
{
|
||||
/*
|
||||
* Reserved for future use
|
||||
*/
|
||||
}
|
||||
|
||||
if ($multiple or is_array($defstr)) {
|
||||
if ($size==0) $size=5;
|
||||
$attr = ' multiple size="'.$size.'"';
|
||||
@ -323,9 +323,9 @@ function _adodb_getmenu_gp(&$zthis, $name,$defstr='',$blank1stItem=true,$multipl
|
||||
else $compareFields0 = true;
|
||||
|
||||
$value = '';
|
||||
$optgroup = null;
|
||||
$firstgroup = true;
|
||||
$fieldsize = sizeof($zthis->fields);
|
||||
$optgroup = null;
|
||||
$firstgroup = true;
|
||||
$fieldsize = sizeof($zthis->fields);
|
||||
while(!$zthis->EOF) {
|
||||
$zval = rtrim(reset($zthis->fields));
|
||||
|
||||
@ -334,28 +334,32 @@ function _adodb_getmenu_gp(&$zthis, $name,$defstr='',$blank1stItem=true,$multipl
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($fieldsize > 1) {
|
||||
if (isset($zthis->fields[1]))
|
||||
$zval2 = rtrim($zthis->fields[1]);
|
||||
$myFields = array_map('trim',array_values($zthis->fields));
|
||||
|
||||
if ($fieldsize > 1) {
|
||||
if (isset($myFields[1]))
|
||||
$zval2 = $myFields[1];
|
||||
else
|
||||
$zval2 = rtrim(next($zthis->fields));
|
||||
$zval2 = next($myFields);
|
||||
}
|
||||
|
||||
$selected = ($compareFields0) ? $zval : $zval2;
|
||||
|
||||
$group = '';
|
||||
if (isset($zthis->fields[2])) {
|
||||
$group = rtrim($zthis->fields[2]);
|
||||
}
|
||||
$group = '';
|
||||
|
||||
if (isset($myFields[2])) {
|
||||
$group = $myFields[2];
|
||||
}
|
||||
|
||||
if ($optgroup != $group) {
|
||||
$optgroup = $group;
|
||||
if ($firstgroup) {
|
||||
$firstgroup = false;
|
||||
$s .="\n<optgroup label='". htmlspecialchars($group) ."'>";
|
||||
} else {
|
||||
$s .="\n</optgroup>";
|
||||
$s .="\n<optgroup label='". htmlspecialchars($group) ."'>";
|
||||
}
|
||||
if ($optgroup != $group) {
|
||||
$optgroup = $group;
|
||||
if ($firstgroup) {
|
||||
$firstgroup = false;
|
||||
$s .="\n<optgroup label='". htmlspecialchars($group) ."'>";
|
||||
} else {
|
||||
$s .="\n</optgroup>";
|
||||
$s .="\n<optgroup label='". htmlspecialchars($group) ."'>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($hasvalue)
|
||||
@ -377,14 +381,13 @@ function _adodb_getmenu_gp(&$zthis, $name,$defstr='',$blank1stItem=true,$multipl
|
||||
$zthis->MoveNext();
|
||||
} // while
|
||||
|
||||
// closing last optgroup
|
||||
if($optgroup != null) {
|
||||
$s .= "\n</optgroup>";
|
||||
// closing last optgroup
|
||||
if($optgroup != null) {
|
||||
$s .= "\n</optgroup>";
|
||||
}
|
||||
return $s ."\n</select>\n";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Count the number of records this sql statement will return by using
|
||||
query rewriting heuristics...
|
||||
@ -416,7 +419,12 @@ function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0)
|
||||
} else
|
||||
$rewritesql = "SELECT COUNT(*) FROM (".$rewritesql.")";
|
||||
|
||||
} else if (strncmp($zthis->databaseType,'postgres',8) == 0 || strncmp($zthis->databaseType,'mysql',5) == 0) {
|
||||
} else if (strncmp($zthis->databaseType,'postgres',8) == 0
|
||||
|| strncmp($zthis->databaseType,'mysql',5) == 0
|
||||
|| strncmp($zthis->databaseType,'mssql',5) == 0
|
||||
|| strncmp($zthis->dsnType,'sqlsrv',5) == 0
|
||||
|| strncmp($zthis->dsnType,'mssql',5) == 0
|
||||
){
|
||||
$rewritesql = "SELECT COUNT(*) FROM ($rewritesql) _ADODB_ALIAS_";
|
||||
} else {
|
||||
$rewritesql = "SELECT COUNT(*) FROM ($rewritesql)";
|
||||
@ -766,7 +774,7 @@ function _adodb_getupdatesql(&$zthis,&$rs, $arrFields,$forceUpdate=false,$magicq
|
||||
if (preg_match('/\s(ORDER\s.*)/is', $whereClause[1], $discard));
|
||||
else if (preg_match('/\s(LIMIT\s.*)/is', $whereClause[1], $discard));
|
||||
else if (preg_match('/\s(FOR UPDATE.*)/is', $whereClause[1], $discard));
|
||||
else preg_match('/\s.*(\) WHERE .*)/is', $whereClause[1], $discard); # see http://sourceforge.net/tracker/index.php?func=detail&aid=1379638&group_id=42718&atid=433976
|
||||
else preg_match('/\s.*(\) WHERE .*)/is', $whereClause[1], $discard); # see https://sourceforge.net/p/adodb/bugs/37/
|
||||
} else
|
||||
$whereClause = array(false,false);
|
||||
|
||||
|
@ -11,7 +11,7 @@ if (empty($ADODB_INCLUDED_CSV)) include_once(ADODB_DIR.'/adodb-csvlib.inc.php');
|
||||
|
||||
/*
|
||||
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -19,7 +19,7 @@ if (empty($ADODB_INCLUDED_CSV)) include_once(ADODB_DIR.'/adodb-csvlib.inc.php');
|
||||
the BSD license will take precedence. See License.txt.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Usage:
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.9 21-Dec-2016
|
||||
* @version v5.20.14 06-Jan-2019
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
@ -358,7 +358,7 @@ class DB
|
||||
*/
|
||||
function assertExtension($name)
|
||||
{
|
||||
if (!extension_loaded($name)) {
|
||||
if (function_exists('dl') && !extension_loaded($name)) {
|
||||
$dlext = (strncmp(PHP_OS,'WIN',3) === 0) ? '.dll' : '.so';
|
||||
@dl($name . $dlext);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence. See License.txt.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Library for basic performance monitoring and tuning.
|
||||
|
||||
@ -147,7 +147,7 @@ function adodb_log_sql(&$connx,$sql,$inputarr)
|
||||
if (empty($d)) $d = date("'Y-m-d H:i:s'");
|
||||
if ($conn->dataProvider == 'oci8' && $dbT != 'oci8po') {
|
||||
$isql = "insert into $perf_table values($d,:b,:c,:d,:e,:f)";
|
||||
} else if ($dbT == 'odbc_mssql' || $dbT == 'informix' || strncmp($dbT,'odbtp',4)==0) {
|
||||
} else if ($dbT == 'mssqlnative' || $dbT == 'odbc_mssql' || $dbT == 'informix' || strncmp($dbT,'odbtp',4)==0) {
|
||||
$timer = $arr['f'];
|
||||
if ($dbT == 'informix') $sql2 = substr($sql2,0,230);
|
||||
|
||||
@ -166,6 +166,9 @@ function adodb_log_sql(&$connx,$sql,$inputarr)
|
||||
|
||||
global $ADODB_PERF_MIN;
|
||||
if ($errN != 0 || $time >= $ADODB_PERF_MIN) {
|
||||
if($conn instanceof ADODB_mysqli && $conn->_queryID) {
|
||||
mysqli_free_result($conn->_queryID);
|
||||
}
|
||||
$ok = $conn->Execute($isql,$arr);
|
||||
} else
|
||||
$ok = true;
|
||||
@ -226,7 +229,7 @@ class adodb_perf {
|
||||
var $cliFormat = "%32s => %s \r\n";
|
||||
var $sql1 = 'sql1'; // used for casting sql1 to text for mssql
|
||||
var $explain = true;
|
||||
var $helpurl = '<a href="http://adodb.sourceforge.net/docs-adodb.htm#logsql">LogSQL help</a>';
|
||||
var $helpurl = '<a href="http://adodb.org/dokuwiki/doku.php?id=v5:performance:logsql">LogSQL help</a>';
|
||||
var $createTableSQL = false;
|
||||
var $maxLength = 2000;
|
||||
|
||||
@ -721,7 +724,7 @@ Committed_AS: 348732 kB
|
||||
|
||||
if (empty($_GET['hidem']))
|
||||
echo "<table border=1 width=100% bgcolor=lightyellow><tr><td colspan=2>
|
||||
<b><a href=http://adodb.sourceforge.net/?perf=1>ADOdb</a> Performance Monitor</b> <font size=1>for $app</font></tr><tr><td>
|
||||
<b><a href=http://adodb.org/dokuwiki/doku.php?id=v5:performance:performance_index>ADOdb</a> Performance Monitor</b> <font size=1>for $app</font></tr><tr><td>
|
||||
<a href=?do=stats><b>Performance Stats</b></a> <a href=?do=viewsql><b>View SQL</b></a>
|
||||
<a href=?do=tables><b>View Tables</b></a> <a href=?do=poll><b>Poll Stats</b></a>",
|
||||
$allowsql ? ' <a href=?do=dosql><b>Run SQL</b></a>' : '',
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,9 +1,10 @@
|
||||
<?php
|
||||
/*
|
||||
ADOdb Date Library, part of the ADOdb abstraction library
|
||||
Download: http://adodb.sourceforge.net/#download
|
||||
|
||||
@version v5.20.9 21-Dec-2016
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
|
||||
@ -420,6 +421,9 @@ $ADODB_DATETIME_CLASS = (PHP_VERSION >= 5.2);
|
||||
|
||||
if (!defined('ADODB_ALLOW_NEGATIVE_TS')) define('ADODB_NO_NEGATIVE_TS',1);
|
||||
|
||||
if (!DEFINED('ADODB_FUTURE_DATE_CUTOFF_YEARS'))
|
||||
DEFINE('ADODB_FUTURE_DATE_CUTOFF_YEARS',200);
|
||||
|
||||
function adodb_date_test_date($y1,$m,$d=13)
|
||||
{
|
||||
$h = round(rand()% 24);
|
||||
@ -816,7 +820,7 @@ global $_month_table_normal,$_month_table_leaf;
|
||||
|
||||
if ($marr[$m] < $d) return false;
|
||||
|
||||
if ($y < 1000 && $y > 3000) return false;
|
||||
if ($y < 1000 || $y > 3000) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -829,13 +833,23 @@ global $_month_table_normal,$_month_table_leaf;
|
||||
function _adodb_getdate($origd=false,$fast=false,$is_gmt=false)
|
||||
{
|
||||
static $YRS;
|
||||
global $_month_table_normal,$_month_table_leaf;
|
||||
global $_month_table_normal,$_month_table_leaf, $_adodb_last_date_call_failed;
|
||||
|
||||
$_adodb_last_date_call_failed = false;
|
||||
|
||||
$d = $origd - ($is_gmt ? 0 : adodb_get_gmt_diff_ts($origd));
|
||||
$_day_power = 86400;
|
||||
$_hour_power = 3600;
|
||||
$_min_power = 60;
|
||||
|
||||
$cutoffDate = time() + (60 * 60 * 24 * 365 * ADODB_FUTURE_DATE_CUTOFF_YEARS);
|
||||
|
||||
if ($d > $cutoffDate)
|
||||
{
|
||||
$d = $cutoffDate;
|
||||
$_adodb_last_date_call_failed = true;
|
||||
}
|
||||
|
||||
if ($d < -12219321600) $d -= 86400*10; // if 15 Oct 1582 or earlier, gregorian correction
|
||||
|
||||
$_month_table_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31);
|
||||
@ -1460,3 +1474,16 @@ global $ADODB_DATE_LOCALE;
|
||||
$ret = adodb_date($fmtdate, $ts, $is_gmt);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the status of the last date calculation and whether it exceeds
|
||||
* the limit of ADODB_FUTURE_DATE_CUTOFF_YEARS
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function adodb_last_date_status()
|
||||
{
|
||||
global $_adodb_last_date_call_failed;
|
||||
|
||||
return $_adodb_last_date_call_failed;
|
||||
}
|
||||
|
@ -1305,8 +1305,9 @@ class adoSchema {
|
||||
function __construct( $db ) {
|
||||
// Initialize the environment
|
||||
$this->mgq = get_magic_quotes_runtime();
|
||||
ini_set("magic_quotes_runtime", 0);
|
||||
#set_magic_quotes_runtime(0);
|
||||
if ($this->mgq !== false) {
|
||||
ini_set('magic_quotes_runtime', 0);
|
||||
}
|
||||
|
||||
$this->db = $db;
|
||||
$this->debug = $this->db->debug;
|
||||
@ -2195,8 +2196,9 @@ class adoSchema {
|
||||
* @deprecated adoSchema now cleans up automatically.
|
||||
*/
|
||||
function Destroy() {
|
||||
ini_set("magic_quotes_runtime", $this->mgq );
|
||||
#set_magic_quotes_runtime( $this->mgq );
|
||||
if ($this->mgq !== false) {
|
||||
ini_set('magic_quotes_runtime', $this->mgq );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1409,8 +1409,9 @@ class adoSchema {
|
||||
function __construct( $db ) {
|
||||
// Initialize the environment
|
||||
$this->mgq = get_magic_quotes_runtime();
|
||||
#set_magic_quotes_runtime(0);
|
||||
ini_set("magic_quotes_runtime", 0);
|
||||
if ($this->mgq !== false) {
|
||||
ini_set('magic_quotes_runtime', 0 );
|
||||
}
|
||||
|
||||
$this->db = $db;
|
||||
$this->debug = $this->db->debug;
|
||||
@ -2377,8 +2378,9 @@ class adoSchema {
|
||||
* @deprecated adoSchema now cleans up automatically.
|
||||
*/
|
||||
function Destroy() {
|
||||
ini_set("magic_quotes_runtime", $this->mgq );
|
||||
#set_magic_quotes_runtime( $this->mgq );
|
||||
if ($this->mgq !== false) {
|
||||
ini_set('magic_quotes_runtime', $this->mgq );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* Set tabs to 4 for best viewing.
|
||||
*
|
||||
* Latest version is available at http://adodb.sourceforge.net
|
||||
* Latest version is available at http://adodb.org/
|
||||
*
|
||||
* This is the main include file for ADOdb.
|
||||
* Database specific drivers are stored in the adodb/drivers/adodb-*.inc.php
|
||||
@ -14,7 +14,7 @@
|
||||
/**
|
||||
\mainpage
|
||||
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
|
||||
@ -29,9 +29,6 @@
|
||||
Informix, PostgreSQL, FrontBase, Interbase (Firebird and Borland variants), Foxpro, Access,
|
||||
ADO, SAP DB, SQLite and ODBC. We have had successful reports of connecting to Progress and
|
||||
other databases via ODBC.
|
||||
|
||||
Latest Download at http://adodb.sourceforge.net/
|
||||
|
||||
*/
|
||||
|
||||
if (!defined('_ADODB_LAYER')) {
|
||||
@ -227,13 +224,12 @@ if (!defined('_ADODB_LAYER')) {
|
||||
|
||||
// Initialize random number generator for randomizing cache flushes
|
||||
// -- note Since PHP 4.2.0, the seed becomes optional and defaults to a random value if omitted.
|
||||
// MDL-41198 Removed random seed initialization.
|
||||
// srand(((double)microtime())*1000000);
|
||||
srand(((double)microtime())*1000000);
|
||||
|
||||
/**
|
||||
* ADODB version as a string.
|
||||
*/
|
||||
$ADODB_vers = 'v5.20.9 21-Dec-2016';
|
||||
$ADODB_vers = 'v5.20.14 06-Jan-2019';
|
||||
|
||||
/**
|
||||
* Determines whether recordset->RecordCount() is used.
|
||||
@ -432,6 +428,7 @@ if (!defined('_ADODB_LAYER')) {
|
||||
var $databaseType = ''; /// RDBMS currently in use, eg. odbc, mysql, mssql
|
||||
var $database = ''; /// Name of database to be used.
|
||||
var $host = ''; /// The hostname of the database server
|
||||
var $port = ''; /// The port of the database server
|
||||
var $user = ''; /// The username which is used to connect to the database server.
|
||||
var $password = ''; /// Password for the username. For security, we no longer store it.
|
||||
var $debug = false; /// if set to true will output sql statements
|
||||
@ -633,6 +630,26 @@ if (!defined('_ADODB_LAYER')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the hostname to extract the port.
|
||||
* Overwrites $this->host and $this->port, only if a port is specified.
|
||||
* The Hostname can be fully or partially qualified,
|
||||
* ie: "db.mydomain.com:5432" or "ldaps://ldap.mydomain.com:636"
|
||||
* Any specified scheme such as ldap:// or ldaps:// is maintained.
|
||||
*/
|
||||
protected function parseHostNameAndPort() {
|
||||
$parsed_url = parse_url($this->host);
|
||||
if (is_array($parsed_url) && isset($parsed_url['host']) && isset($parsed_url['port'])) {
|
||||
if ( isset($parsed_url['scheme']) ) {
|
||||
// If scheme is specified (ie: ldap:// or ldaps://, make sure we retain that.
|
||||
$this->host = $parsed_url['scheme'] . "://" . $parsed_url['host'];
|
||||
} else {
|
||||
$this->host = $parsed_url['host'];
|
||||
}
|
||||
$this->port = $parsed_url['port'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect to database
|
||||
*
|
||||
@ -648,9 +665,9 @@ if (!defined('_ADODB_LAYER')) {
|
||||
if ($argHostname != "") {
|
||||
$this->host = $argHostname;
|
||||
}
|
||||
if ( strpos($this->host, ':') > 0 && isset($this->port) ) {
|
||||
list($this->host, $this->port) = explode(":", $this->host, 2);
|
||||
}
|
||||
// Overwrites $this->host and $this->port if a port is specified.
|
||||
$this->parseHostNameAndPort();
|
||||
|
||||
if ($argUsername != "") {
|
||||
$this->user = $argUsername;
|
||||
}
|
||||
@ -731,9 +748,9 @@ if (!defined('_ADODB_LAYER')) {
|
||||
if ($argHostname != "") {
|
||||
$this->host = $argHostname;
|
||||
}
|
||||
if ( strpos($this->host, ':') > 0 && isset($this->port) ) {
|
||||
list($this->host, $this->port) = explode(":", $this->host, 2);
|
||||
}
|
||||
// Overwrites $this->host and $this->port if a port is specified.
|
||||
$this->parseHostNameAndPort();
|
||||
|
||||
if ($argUsername != "") {
|
||||
$this->user = $argUsername;
|
||||
}
|
||||
@ -1497,6 +1514,9 @@ if (!defined('_ADODB_LAYER')) {
|
||||
* @return the recordset ($rs->databaseType == 'array')
|
||||
*/
|
||||
function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0) {
|
||||
$nrows = (int)$nrows;
|
||||
$offset = (int)$offset;
|
||||
|
||||
if ($this->hasTop && $nrows > 0) {
|
||||
// suggested by Reinhard Balling. Access requires top after distinct
|
||||
// Informix requires first before distinct - F Riosa
|
||||
@ -1511,7 +1531,7 @@ if (!defined('_ADODB_LAYER')) {
|
||||
// access includes ties in result
|
||||
if ($isaccess) {
|
||||
$sql = preg_replace(
|
||||
'/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.' '.((integer)$nrows).' ',$sql);
|
||||
'/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.' '.$nrows.' ',$sql);
|
||||
|
||||
if ($secs2cache != 0) {
|
||||
$ret = $this->CacheExecute($secs2cache, $sql,$inputarr);
|
||||
@ -1521,10 +1541,10 @@ if (!defined('_ADODB_LAYER')) {
|
||||
return $ret; // PHP5 fix
|
||||
} else if ($ismssql){
|
||||
$sql = preg_replace(
|
||||
'/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.' '.((integer)$nrows).' ',$sql);
|
||||
'/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.' '.$nrows.' ',$sql);
|
||||
} else {
|
||||
$sql = preg_replace(
|
||||
'/(^\s*select\s)/i','\\1 '.$this->hasTop.' '.((integer)$nrows).' ',$sql);
|
||||
'/(^\s*select\s)/i','\\1 '.$this->hasTop.' '.$nrows.' ',$sql);
|
||||
}
|
||||
} else {
|
||||
$nn = $nrows + $offset;
|
||||
@ -2392,6 +2412,7 @@ if (!defined('_ADODB_LAYER')) {
|
||||
*/
|
||||
function Close() {
|
||||
$rez = $this->_close();
|
||||
$this->_queryID = false;
|
||||
$this->_connectionID = false;
|
||||
return $rez;
|
||||
}
|
||||
@ -3039,6 +3060,61 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1
|
||||
return $rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the last error recorded by PHP and clear the message.
|
||||
*
|
||||
* By clearing the message, it becomes possible to detect whether a new error
|
||||
* has occurred, even when it is the same error as before being repeated.
|
||||
*
|
||||
* @return array|null Array if an error has previously occurred. Null otherwise.
|
||||
*/
|
||||
protected function resetLastError() {
|
||||
$error = error_get_last();
|
||||
|
||||
if (is_array($error)) {
|
||||
$error['message'] = '';
|
||||
}
|
||||
|
||||
return $error;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare a previously stored error message with the last error recorded by PHP
|
||||
* to determine whether a new error has occured.
|
||||
*
|
||||
* @param array|null $old Optional. Previously stored return value of error_get_last().
|
||||
*
|
||||
* @return string The error message if a new error has occured
|
||||
* or an empty string if no (new) errors have occured..
|
||||
*/
|
||||
protected function getChangedErrorMsg($old = null) {
|
||||
$new = error_get_last();
|
||||
|
||||
if (is_null($new)) {
|
||||
// No error has occured yet at all.
|
||||
return '';
|
||||
}
|
||||
|
||||
if (is_null($old)) {
|
||||
// First error recorded.
|
||||
return $new['message'];
|
||||
}
|
||||
|
||||
$changed = false;
|
||||
foreach($new as $key => $value) {
|
||||
if ($new[$key] !== $old[$key]) {
|
||||
$changed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($changed === true) {
|
||||
return $new['message'];
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
} // end class ADOConnection
|
||||
|
||||
|
||||
@ -4618,8 +4694,8 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1
|
||||
$class = $db; break;
|
||||
}
|
||||
|
||||
$file = ADODB_DIR."/drivers/adodb-".$db.".inc.php";
|
||||
@include_once($file);
|
||||
$file = "drivers/adodb-$db.inc.php";
|
||||
@include_once(ADODB_DIR . '/' . $file);
|
||||
$ADODB_LASTDB = $class;
|
||||
if (class_exists("ADODB_" . $class)) {
|
||||
return $class;
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence. See License.txt.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Microsoft Access data driver. Requires ODBC. Works only on MS Windows.
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Microsoft ADO data driver. Requires ADO. Works only on MS Windows.
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Microsoft ADO data driver. Requires ADO. Works only on MS Windows. PHP5 compat version.
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@ Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence. See License.txt.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Microsoft Access ADO data driver. Requires ADO and ODBC. Works only on MS Windows.
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Microsoft SQL Server ADO data driver. Requires ADO and MSSQL client.
|
||||
Works only on MS Windows.
|
||||
|
@ -75,17 +75,15 @@ class ADODB_ads extends ADOConnection {
|
||||
// returns true or false
|
||||
function _connect($argDSN, $argUsername, $argPassword, $argDatabasename)
|
||||
{
|
||||
global $php_errormsg;
|
||||
|
||||
if (!function_exists('ads_connect')) return null;
|
||||
|
||||
if ($this->debug && $argDatabasename && $this->databaseType != 'vfp') {
|
||||
ADOConnection::outp("For Advantage Connect(), $argDatabasename is not used. Place dsn in 1st parameter.");
|
||||
}
|
||||
if (isset($php_errormsg)) $php_errormsg = '';
|
||||
$last_php_error = $this->resetLastError();
|
||||
if ($this->curmode === false) $this->_connectionID = ads_connect($argDSN,$argUsername,$argPassword);
|
||||
else $this->_connectionID = ads_connect($argDSN,$argUsername,$argPassword,$this->curmode);
|
||||
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
|
||||
$this->_errorMsg = $this->getChangedErrorMsg($last_php_error);
|
||||
if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
|
||||
|
||||
return $this->_connectionID != false;
|
||||
@ -94,12 +92,10 @@ class ADODB_ads extends ADOConnection {
|
||||
// returns true or false
|
||||
function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
|
||||
{
|
||||
global $php_errormsg;
|
||||
|
||||
if (!function_exists('ads_connect')) return null;
|
||||
|
||||
if (isset($php_errormsg)) $php_errormsg = '';
|
||||
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
|
||||
$last_php_error = $this->resetLastError();
|
||||
$this->_errorMsg = '';
|
||||
if ($this->debug && $argDatabasename) {
|
||||
ADOConnection::outp("For PConnect(), $argDatabasename is not used. Place dsn in 1st parameter.");
|
||||
}
|
||||
@ -107,7 +103,7 @@ class ADODB_ads extends ADOConnection {
|
||||
if ($this->curmode === false) $this->_connectionID = ads_connect($argDSN,$argUsername,$argPassword);
|
||||
else $this->_connectionID = ads_pconnect($argDSN,$argUsername,$argPassword,$this->curmode);
|
||||
|
||||
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
|
||||
$this->_errorMsg = $this->getChangedErrorMsg($last_php_error);
|
||||
if ($this->_connectionID && $this->autoRollback) @ads_rollback($this->_connectionID);
|
||||
if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
|
||||
|
||||
@ -519,9 +515,8 @@ See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/od
|
||||
/* returns queryID or false */
|
||||
function _query($sql,$inputarr=false)
|
||||
{
|
||||
GLOBAL $php_errormsg;
|
||||
if (isset($php_errormsg)) $php_errormsg = '';
|
||||
$this->_error = '';
|
||||
$last_php_error = $this->resetLastError();
|
||||
$this->_errorMsg = '';
|
||||
|
||||
if ($inputarr) {
|
||||
if (is_array($sql)) {
|
||||
@ -530,7 +525,7 @@ See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/od
|
||||
$stmtid = ads_prepare($this->_connectionID,$sql);
|
||||
|
||||
if ($stmtid == false) {
|
||||
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
|
||||
$this->_errorMsg = $this->getChangedErrorMsg($last_php_error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -563,8 +558,7 @@ See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/od
|
||||
|
||||
$this->_lastAffectedRows = 0;
|
||||
|
||||
if ($stmtid)
|
||||
{
|
||||
if ($stmtid) {
|
||||
|
||||
if (@ads_num_fields($stmtid) == 0) {
|
||||
$this->_lastAffectedRows = ads_num_rows($stmtid);
|
||||
@ -578,22 +572,19 @@ See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/od
|
||||
|
||||
}
|
||||
|
||||
if ($this->_haserrorfunctions)
|
||||
{
|
||||
|
||||
if ($this->_haserrorfunctions) {
|
||||
$this->_errorMsg = '';
|
||||
$this->_errorCode = 0;
|
||||
} else {
|
||||
$this->_errorMsg = $this->getChangedErrorMsg($last_php_error);
|
||||
}
|
||||
else
|
||||
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
if ($this->_haserrorfunctions) {
|
||||
$this->_errorMsg = ads_errormsg();
|
||||
$this->_errorCode = ads_error();
|
||||
} else
|
||||
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
|
||||
} else {
|
||||
$this->_errorMsg = $this->getChangedErrorMsg($last_php_error);
|
||||
}
|
||||
}
|
||||
|
||||
return $stmtid;
|
||||
@ -611,10 +602,11 @@ See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/od
|
||||
*/
|
||||
function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
|
||||
{
|
||||
$last_php_error = $this->resetLastError();
|
||||
$sql = "UPDATE $table SET $column=? WHERE $where";
|
||||
$stmtid = ads_prepare($this->_connectionID,$sql);
|
||||
if ($stmtid == false){
|
||||
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
|
||||
$this->_errorMsg = $this->getChangedErrorMsg($last_php_error);
|
||||
return false;
|
||||
}
|
||||
if (! ads_execute($stmtid,array($val),array(SQL_BINARY) )){
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Support Borland Interbase 6.5 and later
|
||||
|
||||
@ -53,6 +53,8 @@ class ADODB_borland_ibase extends ADODB_ibase {
|
||||
// SELECT FIRST 5 SKIP 2 col1, col2 FROM TABLE
|
||||
function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
|
||||
{
|
||||
$nrows = (int) $nrows;
|
||||
$offset = (int) $offset;
|
||||
if ($nrows > 0) {
|
||||
if ($offset <= 0) $str = " ROWS $nrows ";
|
||||
else {
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -83,8 +83,10 @@ class ADODB_csv extends ADOConnection {
|
||||
// parameters use PostgreSQL convention, not MySQL
|
||||
function SelectLimit($sql, $nrows = -1, $offset = -1, $inputarr = false, $secs2cache = 0)
|
||||
{
|
||||
global $ADODB_FETCH_MODE;
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
$nrows = (int) $nrows;
|
||||
$offset = (int) $offset;
|
||||
$url = $this->_url.'?sql='.urlencode($sql)."&nrows=$nrows&fetch=".
|
||||
(($this->fetchMode !== false)?$this->fetchMode : $ADODB_FETCH_MODE).
|
||||
"&offset=$offset";
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
|
||||
@ -71,8 +71,6 @@ class ADODB_db2 extends ADOConnection {
|
||||
// returns true or false
|
||||
function _connect($argDSN, $argUsername, $argPassword, $argDatabasename)
|
||||
{
|
||||
global $php_errormsg;
|
||||
|
||||
if (!function_exists('db2_connect')) {
|
||||
ADOConnection::outp("Warning: The old ODBC based DB2 driver has been renamed 'odbc_db2'. This ADOdb driver calls PHP's native db2 extension which is not installed.");
|
||||
return null;
|
||||
@ -90,7 +88,6 @@ class ADODB_db2 extends ADOConnection {
|
||||
if (stripos($argDSN,'UID=') && stripos($argDSN,'PWD=')) $this->_connectionID = db2_connect($argDSN,null,null);
|
||||
else $this->_connectionID = db2_connect($argDSN,$argUsername,$argPassword);
|
||||
}
|
||||
if (isset($php_errormsg)) $php_errormsg = '';
|
||||
|
||||
// For db2_connect(), there is an optional 4th arg. If present, it must be
|
||||
// an array of valid options. So far, we don't use them.
|
||||
@ -105,16 +102,13 @@ class ADODB_db2 extends ADOConnection {
|
||||
// returns true or false
|
||||
function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
|
||||
{
|
||||
global $php_errormsg;
|
||||
|
||||
if (!function_exists('db2_connect')) return null;
|
||||
|
||||
// This needs to be set before the connect().
|
||||
// Replaces the odbc_binmode() call that was in Execute()
|
||||
ini_set('ibm_db2.binmode', $this->binmode);
|
||||
|
||||
if (isset($php_errormsg)) $php_errormsg = '';
|
||||
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
|
||||
$this->_errorMsg = '';
|
||||
|
||||
if ($argDatabasename && empty($argDSN)) {
|
||||
|
||||
@ -125,7 +119,6 @@ class ADODB_db2 extends ADOConnection {
|
||||
if (stripos($argDSN,'UID=') && stripos($argDSN,'PWD=')) $this->_connectionID = db2_pconnect($argDSN,null,null);
|
||||
else $this->_connectionID = db2_pconnect($argDSN,$argUsername,$argPassword);
|
||||
}
|
||||
if (isset($php_errormsg)) $php_errormsg = '';
|
||||
|
||||
$this->_errorMsg = @db2_conn_errormsg();
|
||||
if ($this->_connectionID && $this->autoRollback) @db2_rollback($this->_connectionID);
|
||||
@ -243,7 +236,8 @@ class ADODB_db2 extends ADOConnection {
|
||||
|
||||
function SelectLimit($sql, $nrows = -1, $offset = -1, $inputArr = false, $secs2cache = 0)
|
||||
{
|
||||
$nrows = (integer) $nrows;
|
||||
$nrows = (int) $nrows;
|
||||
$offset = (int) $offset;
|
||||
if ($offset <= 0) {
|
||||
// could also use " OPTIMIZE FOR $nrows ROWS "
|
||||
if ($nrows >= 0) $sql .= " FETCH FIRST $nrows ROWS ONLY ";
|
||||
@ -627,9 +621,8 @@ See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/db2/htm/db2
|
||||
/* returns queryID or false */
|
||||
function _query($sql,$inputarr=false)
|
||||
{
|
||||
GLOBAL $php_errormsg;
|
||||
if (isset($php_errormsg)) $php_errormsg = '';
|
||||
$this->_error = '';
|
||||
$last_php_error = $this->resetLastError();
|
||||
$this->_errorMsg = '';
|
||||
|
||||
if ($inputarr) {
|
||||
if (is_array($sql)) {
|
||||
@ -638,7 +631,7 @@ See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/db2/htm/db2
|
||||
$stmtid = db2_prepare($this->_connectionID,$sql);
|
||||
|
||||
if ($stmtid == false) {
|
||||
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
|
||||
$this->_errorMsg = $this->getChangedErrorMsg($last_php_error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -675,15 +668,16 @@ See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/db2/htm/db2
|
||||
if ($this->_haserrorfunctions) {
|
||||
$this->_errorMsg = '';
|
||||
$this->_errorCode = 0;
|
||||
} else
|
||||
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
|
||||
} else {
|
||||
$this->_errorMsg = $this->getChangedErrorMsg($last_php_error);
|
||||
}
|
||||
} else {
|
||||
if ($this->_haserrorfunctions) {
|
||||
$this->_errorMsg = db2_stmt_errormsg();
|
||||
$this->_errorCode = db2_stmt_error();
|
||||
} else
|
||||
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
|
||||
|
||||
} else {
|
||||
$this->_errorMsg = $this->getChangedErrorMsg($last_php_error);
|
||||
}
|
||||
}
|
||||
return $stmtid;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Microsoft Visual FoxPro data driver. Requires ODBC. Works only on MS Windows.
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Microsoft Visual FoxPro data driver. Requires ODBC. Works only on MS Windows.
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
*/
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
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.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Interbase data driver. Requires interbase client. Works on Windows and Unix.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.9 21-Dec-2016
|
||||
* @version v5.20.14 06-Jan-2019
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
@ -9,7 +9,7 @@
|
||||
*
|
||||
* Set tabs to 4 for best viewing.
|
||||
*
|
||||
* Latest version is available at http://php.weblogs.com
|
||||
* Latest version is available at http://adodb.org/
|
||||
*
|
||||
* Informix 9 driver that supports SELECT FIRST
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim. All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Informix port by Mitchell T. Young (mitch@youngfamily.org)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Native mssql driver. Requires mssql client. Works on Windows.
|
||||
To configure for Unix, see
|
||||
@ -245,6 +245,8 @@ class ADODB_mssql extends ADOConnection {
|
||||
|
||||
function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
|
||||
{
|
||||
$nrows = (int) $nrows;
|
||||
$offset = (int) $offset;
|
||||
if ($nrows > 0 && $offset <= 0) {
|
||||
$sql = preg_replace(
|
||||
'/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop." $nrows ",$sql);
|
||||
@ -680,7 +682,12 @@ order by constraint_name, referenced_table_name, keyno";
|
||||
$arr = $args;
|
||||
}
|
||||
|
||||
array_walk($arr, create_function('&$v', '$v = "CAST(" . $v . " AS VARCHAR(255))";'));
|
||||
array_walk(
|
||||
$arr,
|
||||
function(&$value, $key) {
|
||||
$value = "CAST(" . $value . " AS VARCHAR(255))";
|
||||
}
|
||||
);
|
||||
$s = implode('+',$arr);
|
||||
if (sizeof($arr) > 0) return "$s";
|
||||
|
||||
@ -798,7 +805,16 @@ order by constraint_name, referenced_table_name, keyno";
|
||||
$decl .= "@P$i NVARCHAR($len)";
|
||||
}
|
||||
|
||||
$params .= "@P$i=N". (strncmp($v,"'",1)==0? $v : $this->qstr($v));
|
||||
|
||||
if (substr($v,0,1) == "'" && substr($v,-1,1) == "'")
|
||||
/*
|
||||
* String is already fully quoted
|
||||
*/
|
||||
$inputVar = $v;
|
||||
else
|
||||
$inputVar = $this->qstr($v);
|
||||
|
||||
$params .= "@P$i=N" . $inputVar;
|
||||
} else if (is_integer($v)) {
|
||||
$decl .= "@P$i INT";
|
||||
$params .= "@P$i=".$v;
|
||||
|
@ -7,7 +7,8 @@
|
||||
// NOTICE OF COPYRIGHT //
|
||||
// //
|
||||
// ADOdb - Database Abstraction Library for PHP //
|
||||
// http://adodb.sourceforge.net/ //
|
||||
// //
|
||||
// Latest version is available at http://adodb.org //
|
||||
// //
|
||||
// Copyright (c) 2000-2014 John Lim (jlim\@natsoft.com.my) //
|
||||
// All rights reserved. //
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Native mssql driver. Requires mssql client. Works on Windows.
|
||||
http://www.microsoft.com/sql/technologies/php/default.mspx
|
||||
@ -458,8 +458,6 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
$this->_errorMsg .= "Error Code: ".$arrError[ 'code']."\n";
|
||||
$this->_errorMsg .= "Message: ".$arrError[ 'message']."\n";
|
||||
}
|
||||
} else {
|
||||
$this->_errorMsg = "No errors found";
|
||||
}
|
||||
return $this->_errorMsg;
|
||||
}
|
||||
@ -527,7 +525,12 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
$arr = $args;
|
||||
}
|
||||
|
||||
array_walk($arr, create_function('&$v', '$v = "CAST(" . $v . " AS VARCHAR(255))";'));
|
||||
array_walk(
|
||||
$arr,
|
||||
function(&$value, $key) {
|
||||
$value = "CAST(" . $value . " AS VARCHAR(255))";
|
||||
}
|
||||
);
|
||||
$s = implode('+',$arr);
|
||||
if (sizeof($arr) > 0) return "$s";
|
||||
|
||||
@ -566,7 +569,7 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
|
||||
$insert = false;
|
||||
// handle native driver flaw for retrieving the last insert ID
|
||||
if(preg_match('/^\W*insert[\s\w()",.]+values\s*\((?:[^;\']|\'\'|(?:(?:\'\')*\'[^\']+\'(?:\'\')*))*;?$/i', $sql)) {
|
||||
if(preg_match('/^\W*insert[\s\w()[\]",.]+values\s*\((?:[^;\']|\'\'|(?:(?:\'\')*\'[^\']+\'(?:\'\')*))*;?$/i', $sql)) {
|
||||
$insert = true;
|
||||
$sql .= '; '.$this->identitySQL; // select scope_identity()
|
||||
}
|
||||
@ -913,7 +916,7 @@ class ADORecordset_mssqlnative extends ADORecordSet {
|
||||
{
|
||||
$_typeConversion = array(
|
||||
-155 => 'datetimeoffset',
|
||||
-154 => 'time',
|
||||
-154 => 'char',
|
||||
-152 => 'xml',
|
||||
-151 => 'udt',
|
||||
-11 => 'uniqueidentifier',
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.9 21-Dec-2016
|
||||
* @version v5.20.14 06-Jan-2019
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
@ -9,7 +9,7 @@
|
||||
*
|
||||
* Set tabs to 4 for best viewing.
|
||||
*
|
||||
* Latest version is available at http://php.weblogs.com
|
||||
* Latest version is available at http://adodb.org/
|
||||
*
|
||||
* Portable MSSQL Driver that supports || instead of +
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -585,6 +585,8 @@ class ADODB_mysql extends ADOConnection {
|
||||
// parameters use PostgreSQL convention, not MySQL
|
||||
function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs=0)
|
||||
{
|
||||
$nrows = (int) $nrows;
|
||||
$offset = (int) $offset;
|
||||
$offsetStr =($offset>=0) ? ((integer)$offset)."," : '';
|
||||
// jason judge, see http://phplens.com/lens/lensforum/msgs.php?id=9220
|
||||
if ($nrows < 0) $nrows = '18446744073709551615';
|
||||
@ -684,7 +686,7 @@ class ADODB_mysql extends ADOConnection {
|
||||
$ref_table = strtoupper($ref_table);
|
||||
}
|
||||
|
||||
// see https://sourceforge.net/tracker/index.php?func=detail&aid=2287278&group_id=42718&atid=433976
|
||||
// see https://sourceforge.net/p/adodb/bugs/100/
|
||||
if (!isset($foreign_keys[$ref_table])) {
|
||||
$foreign_keys[$ref_table] = array();
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -113,7 +113,7 @@ class ADODB_mysqli extends ADOConnection {
|
||||
if ($persist && PHP_VERSION > 5.2 && strncmp($argHostname,'p:',2) != 0) $argHostname = 'p:'.$argHostname;
|
||||
|
||||
#if (!empty($this->port)) $argHostname .= ":".$this->port;
|
||||
$ok = mysqli_real_connect($this->_connectionID,
|
||||
$ok = @mysqli_real_connect($this->_connectionID,
|
||||
$argHostname,
|
||||
$argUsername,
|
||||
$argPassword,
|
||||
@ -128,7 +128,7 @@ class ADODB_mysqli extends ADOConnection {
|
||||
return true;
|
||||
} else {
|
||||
if ($this->debug) {
|
||||
ADOConnection::outp("Could't connect : " . $this->ErrorMsg());
|
||||
ADOConnection::outp("Could not connect : " . $this->ErrorMsg());
|
||||
}
|
||||
$this->_connectionID = null;
|
||||
return false;
|
||||
@ -601,7 +601,7 @@ class ADODB_mysqli extends ADOConnection {
|
||||
$ref_table = strtoupper($ref_table);
|
||||
}
|
||||
|
||||
// see https://sourceforge.net/tracker/index.php?func=detail&aid=2287278&group_id=42718&atid=433976
|
||||
// see https://sourceforge.net/p/adodb/bugs/100/
|
||||
if (!isset($foreign_keys[$ref_table])) {
|
||||
$foreign_keys[$ref_table] = array();
|
||||
}
|
||||
@ -713,6 +713,8 @@ class ADODB_mysqli extends ADOConnection {
|
||||
$inputarr = false,
|
||||
$secs = 0)
|
||||
{
|
||||
$nrows = (int) $nrows;
|
||||
$offset = (int) $offset;
|
||||
$offsetStr = ($offset >= 0) ? "$offset," : '';
|
||||
if ($nrows < 0) $nrows = '18446744073709551615';
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim. All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Code contributed by George Fourlanos <fou@infomap.gr>
|
||||
|
||||
@ -709,6 +709,8 @@ END;
|
||||
*/
|
||||
function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
|
||||
{
|
||||
$nrows = (int) $nrows;
|
||||
$offset = (int) $offset;
|
||||
// Since the methods used to limit the number of returned rows rely
|
||||
// on modifying the provided SQL query, we can't work with prepared
|
||||
// statements so we just extract the SQL string.
|
||||
@ -1563,7 +1565,13 @@ class ADORecordset_oci8 extends ADORecordSet {
|
||||
$this->adodbFetchMode = $mode;
|
||||
$this->_queryID = $queryID;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Overrides the core destructor method as that causes problems here
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function __destruct() {}
|
||||
|
||||
function Init()
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.9 21-Dec-2016
|
||||
* @version v5.20.14 06-Jan-2019
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
@ -9,7 +9,7 @@
|
||||
*
|
||||
* Set tabs to 4 for best viewing.
|
||||
*
|
||||
* Latest version is available at http://php.weblogs.com
|
||||
* Latest version is available at http://adodb.org/
|
||||
*
|
||||
* Oracle 8.0.5 driver
|
||||
*/
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim. All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
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.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Portable version of oci8 driver, to make it more similar to other database drivers.
|
||||
The main differences are
|
||||
@ -81,29 +81,88 @@ class ADODB_oci8po extends ADODB_oci8 {
|
||||
$arr['bind'.$i++] = $v;
|
||||
}
|
||||
} else {
|
||||
// Need to identify if the ? is inside a quoted string, and if
|
||||
// so not use it as a bind variable
|
||||
preg_match_all('/".*\??"|\'.*\?.*?\'/', $sql, $matches);
|
||||
foreach($matches[0] as $qmMatch){
|
||||
$qmReplace = str_replace('?', '-QUESTIONMARK-', $qmMatch);
|
||||
$sql = str_replace($qmMatch, $qmReplace, $sql);
|
||||
}
|
||||
|
||||
// Replace parameters if any were found
|
||||
$sqlarr = explode('?',$sql);
|
||||
if(count($sqlarr) > 1) {
|
||||
$sql = $sqlarr[0];
|
||||
|
||||
foreach ($inputarr as $k => $v) {
|
||||
$sql .= ":$k" . $sqlarr[++$i];
|
||||
}
|
||||
}
|
||||
|
||||
$sql = str_replace('-QUESTIONMARK-', '?', $sql);
|
||||
$sql = $this->extractBinds($sql,$inputarr);
|
||||
}
|
||||
}
|
||||
return ADODB_oci8::_query($sql,$inputarr);
|
||||
}
|
||||
/**
|
||||
* Replaces compatibility bind markers with oracle ones and returns a
|
||||
* valid sql statement
|
||||
*
|
||||
* This replaces a regexp based section of code that has been subject
|
||||
* to numerous tweaks, as more extreme test cases have appeared. This
|
||||
* is now done this like this to help maintainability and avoid the
|
||||
* need to rely on regexp experienced maintainers
|
||||
*
|
||||
* @param string $sql The sql statement
|
||||
* @param string[] $inputarr The bind array
|
||||
*
|
||||
* @return string The modified statement
|
||||
*/
|
||||
final private function extractBinds($sql,$inputarr)
|
||||
{
|
||||
$inString = false;
|
||||
$escaped = 0;
|
||||
$sqlLength = strlen($sql) - 1;
|
||||
$newSql = '';
|
||||
$bindCount = 0;
|
||||
|
||||
/*
|
||||
* inputarr is the passed in bind list, which is associative, but
|
||||
* we only want the keys here
|
||||
*/
|
||||
$inputKeys = array_keys($inputarr);
|
||||
|
||||
|
||||
for ($i=0;$i<=$sqlLength;$i++)
|
||||
{
|
||||
/*
|
||||
* find the next character of the string
|
||||
*/
|
||||
$c = $sql{$i};
|
||||
|
||||
if ($c == "'" && !$inString && $escaped==0)
|
||||
/*
|
||||
* Found the start of a string inside the statement
|
||||
*/
|
||||
$inString = true;
|
||||
elseif ($c == "\\" && $escaped==0)
|
||||
/*
|
||||
* The next character will be escaped
|
||||
*/
|
||||
$escaped = 1;
|
||||
elseif ($c == "'" && $inString && $escaped==0)
|
||||
/*
|
||||
* We found the end of the string
|
||||
*/
|
||||
$inString = false;
|
||||
|
||||
if ($escaped == 2)
|
||||
$escaped = 0;
|
||||
|
||||
if ($escaped==0 && !$inString && $c == '?')
|
||||
/*
|
||||
* We found a bind symbol, replace it with the oracle equivalent
|
||||
*/
|
||||
$newSql .= ':' . $inputKeys[$bindCount++];
|
||||
else
|
||||
/*
|
||||
* Add the current character the pile
|
||||
*/
|
||||
$newSql .= $c;
|
||||
|
||||
if ($escaped == 1)
|
||||
/*
|
||||
* We have just found an escape character, make sure we ignore the
|
||||
* next one that comes along, it might be a ' character
|
||||
*/
|
||||
$escaped = 2;
|
||||
}
|
||||
|
||||
return $newSql;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim. All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
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.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Portable version of oci8 driver, to make it more similar to other database drivers.
|
||||
The main differences are
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Requires ODBC. Works on Windows and Unix.
|
||||
*/
|
||||
@ -50,8 +50,6 @@ class ADODB_odbc extends ADOConnection {
|
||||
// returns true or false
|
||||
function _connect($argDSN, $argUsername, $argPassword, $argDatabasename)
|
||||
{
|
||||
global $php_errormsg;
|
||||
|
||||
if (!function_exists('odbc_connect')) return null;
|
||||
|
||||
if (!empty($argDatabasename) && stristr($argDSN, 'Database=') === false) {
|
||||
@ -61,10 +59,10 @@ class ADODB_odbc extends ADOConnection {
|
||||
$argDSN .= 'Database='.$argDatabasename;
|
||||
}
|
||||
|
||||
if (isset($php_errormsg)) $php_errormsg = '';
|
||||
$last_php_error = $this->resetLastError();
|
||||
if ($this->curmode === false) $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword);
|
||||
else $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword,$this->curmode);
|
||||
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
|
||||
$this->_errorMsg = $this->getChangedErrorMsg($last_php_error);
|
||||
if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
|
||||
|
||||
return $this->_connectionID != false;
|
||||
@ -73,12 +71,10 @@ class ADODB_odbc extends ADOConnection {
|
||||
// returns true or false
|
||||
function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
|
||||
{
|
||||
global $php_errormsg;
|
||||
|
||||
if (!function_exists('odbc_connect')) return null;
|
||||
|
||||
if (isset($php_errormsg)) $php_errormsg = '';
|
||||
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
|
||||
$last_php_error = $this->resetLastError();
|
||||
$this->_errorMsg = '';
|
||||
if ($this->debug && $argDatabasename) {
|
||||
ADOConnection::outp("For odbc PConnect(), $argDatabasename is not used. Place dsn in 1st parameter.");
|
||||
}
|
||||
@ -86,7 +82,7 @@ class ADODB_odbc extends ADOConnection {
|
||||
if ($this->curmode === false) $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword);
|
||||
else $this->_connectionID = odbc_pconnect($argDSN,$argUsername,$argPassword,$this->curmode);
|
||||
|
||||
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
|
||||
$this->_errorMsg = $this->getChangedErrorMsg($last_php_error);
|
||||
if ($this->_connectionID && $this->autoRollback) @odbc_rollback($this->_connectionID);
|
||||
if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
|
||||
|
||||
@ -503,9 +499,8 @@ See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/od
|
||||
/* returns queryID or false */
|
||||
function _query($sql,$inputarr=false)
|
||||
{
|
||||
GLOBAL $php_errormsg;
|
||||
if (isset($php_errormsg)) $php_errormsg = '';
|
||||
$this->_error = '';
|
||||
$last_php_error = $this->resetLastError();
|
||||
$this->_errorMsg = '';
|
||||
|
||||
if ($inputarr) {
|
||||
if (is_array($sql)) {
|
||||
@ -514,7 +509,7 @@ See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/od
|
||||
$stmtid = odbc_prepare($this->_connectionID,$sql);
|
||||
|
||||
if ($stmtid == false) {
|
||||
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
|
||||
$this->_errorMsg = $this->getChangedErrorMsg($last_php_error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -555,14 +550,16 @@ See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/od
|
||||
if ($this->_haserrorfunctions) {
|
||||
$this->_errorMsg = '';
|
||||
$this->_errorCode = 0;
|
||||
} else
|
||||
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
|
||||
} else {
|
||||
$this->_errorMsg = $this->getChangedErrorMsg($last_php_error);
|
||||
}
|
||||
} else {
|
||||
if ($this->_haserrorfunctions) {
|
||||
$this->_errorMsg = odbc_errormsg();
|
||||
$this->_errorCode = odbc_error();
|
||||
} else
|
||||
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
|
||||
} else {
|
||||
$this->_errorMsg = $this->getChangedErrorMsg($last_php_error);
|
||||
}
|
||||
}
|
||||
return $stmtid;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
DB2 data driver. Requires ODBC.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
MSSQL support via ODBC. Requires ODBC. Works on Windows and Unix.
|
||||
For Unix configuration, see http://phpbuilder.com/columns/alberto20000919.php3
|
||||
@ -280,6 +280,8 @@ order by constraint_name, referenced_table_name, keyno";
|
||||
|
||||
function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
|
||||
{
|
||||
$nrows = (int) $nrows;
|
||||
$offset = (int) $offset;
|
||||
if ($nrows > 0 && $offset <= 0) {
|
||||
$sql = preg_replace(
|
||||
'/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop." $nrows ",$sql);
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Oracle support via ODBC. Requires ODBC. Works on Windows.
|
||||
*/
|
||||
@ -76,11 +76,9 @@ class ADODB_odbc_oracle extends ADODB_odbc {
|
||||
// returns true or false
|
||||
function _connect($argDSN, $argUsername, $argPassword, $argDatabasename)
|
||||
{
|
||||
global $php_errormsg;
|
||||
|
||||
$php_errormsg = '';
|
||||
$last_php_error = $this->resetLastError();
|
||||
$this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword,SQL_CUR_USE_ODBC );
|
||||
$this->_errorMsg = $php_errormsg;
|
||||
$this->_errorMsg = $this->getChangedErrorMsg($last_php_error);
|
||||
|
||||
$this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'");
|
||||
//if ($this->_connectionID) odbc_autocommit($this->_connectionID,true);
|
||||
@ -89,10 +87,9 @@ class ADODB_odbc_oracle extends ADODB_odbc {
|
||||
// returns true or false
|
||||
function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
|
||||
{
|
||||
global $php_errormsg;
|
||||
$php_errormsg = '';
|
||||
$last_php_error = $this->resetLastError();
|
||||
$this->_connectionID = odbc_pconnect($argDSN,$argUsername,$argPassword,SQL_CUR_USE_ODBC );
|
||||
$this->_errorMsg = $php_errormsg;
|
||||
$this->_errorMsg = $this->getChangedErrorMsg($last_php_error);
|
||||
|
||||
$this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'");
|
||||
//if ($this->_connectionID) odbc_autocommit($this->_connectionID,true);
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
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. See License.txt.
|
||||
Set tabs to 4 for best viewing.
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
*/
|
||||
// Code contributed by "stefan bogdan" <sbogdan#rsb.ro>
|
||||
|
||||
@ -609,9 +609,8 @@ class ADODB_odbtp extends ADOConnection{
|
||||
|
||||
function _query($sql,$inputarr=false)
|
||||
{
|
||||
global $php_errormsg;
|
||||
|
||||
$this->_errorMsg = false;
|
||||
$last_php_error = $this->resetLastError();
|
||||
$this->_errorMsg = false;
|
||||
$this->_errorCode = false;
|
||||
|
||||
if ($inputarr) {
|
||||
@ -620,7 +619,7 @@ class ADODB_odbtp extends ADOConnection{
|
||||
} else {
|
||||
$stmtid = @odbtp_prepare($sql,$this->_connectionID);
|
||||
if ($stmtid == false) {
|
||||
$this->_errorMsg = $php_errormsg;
|
||||
$this->_errorMsg = $this->getChangedErrorMsg($last_php_error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
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. See License.txt.
|
||||
Set tabs to 4 for best viewing.
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
*/
|
||||
|
||||
// Code contributed by "Robert Twitty" <rtwitty#neutron.ushmm.org>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
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.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Oracle data driver. Requires Oracle client. Works on Windows and Unix and Oracle 7.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Requires ODBC. Works on Windows and Unix.
|
||||
|
||||
@ -335,6 +335,17 @@ class ADODB_pdo extends ADOConnection {
|
||||
return $err;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $auto_commit
|
||||
* @return void
|
||||
*/
|
||||
function SetAutoCommit($auto_commit)
|
||||
{
|
||||
if(method_exists($this->_driver, 'SetAutoCommit')) {
|
||||
$this->_driver->SetAutoCommit($auto_commit);
|
||||
}
|
||||
}
|
||||
|
||||
function SetTransactionMode($transaction_mode)
|
||||
{
|
||||
if(method_exists($this->_driver, 'SetTransactionMode')) {
|
||||
@ -358,7 +369,7 @@ class ADODB_pdo extends ADOConnection {
|
||||
}
|
||||
$this->transCnt += 1;
|
||||
$this->_autocommit = false;
|
||||
$this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,false);
|
||||
$this->SetAutoCommit(false);
|
||||
|
||||
return $this->_connectionID->beginTransaction();
|
||||
}
|
||||
@ -384,7 +395,7 @@ class ADODB_pdo extends ADOConnection {
|
||||
$this->_autocommit = true;
|
||||
|
||||
$ret = $this->_connectionID->commit();
|
||||
$this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,true);
|
||||
$this->SetAutoCommit(true);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@ -406,7 +417,7 @@ class ADODB_pdo extends ADOConnection {
|
||||
$this->_autocommit = true;
|
||||
|
||||
$ret = $this->_connectionID->rollback();
|
||||
$this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,true);
|
||||
$this->SetAutoCommit(true);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@ -461,6 +472,7 @@ class ADODB_pdo extends ADOConnection {
|
||||
/* returns queryID or false */
|
||||
function _query($sql,$inputarr=false)
|
||||
{
|
||||
$ok = false;
|
||||
if (is_array($sql)) {
|
||||
$stmt = $sql[1];
|
||||
} else {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -85,6 +85,15 @@ class ADODB_pdo_mysql extends ADODB_pdo {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $auto_commit
|
||||
* @return void
|
||||
*/
|
||||
function SetAutoCommit($auto_commit)
|
||||
{
|
||||
$this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT, $auto_commit);
|
||||
}
|
||||
|
||||
function SetTransactionMode($transaction_mode)
|
||||
{
|
||||
$this->_transmode = $transaction_mode;
|
||||
@ -192,6 +201,8 @@ class ADODB_pdo_mysql extends ADODB_pdo {
|
||||
// parameters use PostgreSQL convention, not MySQL
|
||||
function SelectLimit($sql, $nrows=-1, $offset=-1, $inputarr=false, $secs=0)
|
||||
{
|
||||
$nrows = (int) $nrows;
|
||||
$offset = (int) $offset;
|
||||
$offsetStr =($offset>=0) ? "$offset," : '';
|
||||
// jason judge, see http://phplens.com/lens/lensforum/msgs.php?id=9220
|
||||
if ($nrows < 0) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -90,4 +90,13 @@ class ADODB_pdo_oci extends ADODB_pdo_base {
|
||||
else
|
||||
return $retarr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $auto_commit
|
||||
* @return void
|
||||
*/
|
||||
function SetAutoCommit($auto_commit)
|
||||
{
|
||||
$this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT, $auto_commit);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -73,12 +73,14 @@ WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s'))
|
||||
|
||||
function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
|
||||
{
|
||||
$offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
|
||||
$limitStr = ($nrows >= 0) ? " LIMIT $nrows" : '';
|
||||
if ($secs2cache)
|
||||
$rs = $this->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr);
|
||||
else
|
||||
$rs = $this->Execute($sql."$limitStr$offsetStr",$inputarr);
|
||||
$nrows = (int) $nrows;
|
||||
$offset = (int) $offset;
|
||||
$offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
|
||||
$limitStr = ($nrows >= 0) ? " LIMIT $nrows" : '';
|
||||
if ($secs2cache)
|
||||
$rs = $this->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr);
|
||||
else
|
||||
$rs = $this->Execute($sql."$limitStr$offsetStr",$inputarr);
|
||||
|
||||
return $rs;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -9,7 +9,7 @@
|
||||
the BSD license will take precedence. See License.txt.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Thanks Diogo Toscano (diogo#scriptcase.net) for the code.
|
||||
And also Sid Dunayer [sdunayer#interserv.com] for extensive fixes.
|
||||
@ -54,13 +54,15 @@ class ADODB_pdo_sqlite extends ADODB_pdo {
|
||||
|
||||
function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
|
||||
{
|
||||
$nrows = (int) $nrows;
|
||||
$offset = (int) $offset;
|
||||
$parent = $this->pdoDriver;
|
||||
$offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
|
||||
$limitStr = ($nrows >= 0) ? " LIMIT $nrows" : ($offset >= 0 ? ' LIMIT 999999999' : '');
|
||||
if ($secs2cache)
|
||||
$rs = $parent->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr);
|
||||
else
|
||||
$rs = $parent->Execute($sql."$limitStr$offsetStr",$inputarr);
|
||||
if ($secs2cache)
|
||||
$rs = $parent->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr);
|
||||
else
|
||||
$rs = $parent->Execute($sql."$limitStr$offsetStr",$inputarr);
|
||||
|
||||
return $rs;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -666,8 +666,8 @@ class ADODB_postgres64 extends ADOConnection{
|
||||
}
|
||||
|
||||
$col_names = $this->MetaColumnNames($table,true,true);
|
||||
//3rd param is use attnum,
|
||||
// see http://sourceforge.net/tracker/index.php?func=detail&aid=1451245&group_id=42718&atid=433976
|
||||
// 3rd param is use attnum,
|
||||
// see https://sourceforge.net/p/adodb/bugs/45/
|
||||
$indexes = array();
|
||||
while ($row = $rs->FetchRow()) {
|
||||
$columns = array();
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -109,6 +109,8 @@ class ADODB_postgres7 extends ADODB_postgres64 {
|
||||
// which makes obsolete the LIMIT limit,offset syntax
|
||||
function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
|
||||
{
|
||||
$nrows = (int) $nrows;
|
||||
$offset = (int) $offset;
|
||||
$offsetStr = ($offset >= 0) ? " OFFSET ".((integer)$offset) : '';
|
||||
$limitStr = ($nrows >= 0) ? " LIMIT ".((integer)$nrows) : '';
|
||||
if ($secs2cache)
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
SAPDB data driver. Requires ODBC.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
reserved.
|
||||
@ -9,7 +9,7 @@ reserved.
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
21.02.2002 - Wade Johnson wade@wadejohnson.de
|
||||
Extended ODBC class for Sybase SQLAnywhere.
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
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.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
SQLite info: http://www.hwaci.com/sw/sqlite/
|
||||
|
||||
@ -226,6 +226,8 @@ class ADODB_sqlite extends ADOConnection {
|
||||
|
||||
function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
|
||||
{
|
||||
$nrows = (int) $nrows;
|
||||
$offset = (int) $offset;
|
||||
$offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
|
||||
$limitStr = ($nrows >= 0) ? " LIMIT $nrows" : ($offset >= 0 ? ' LIMIT 999999999' : '');
|
||||
if ($secs2cache) {
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
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.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
SQLite info: http://www.hwaci.com/sw/sqlite/
|
||||
|
||||
@ -209,6 +209,8 @@ class ADODB_sqlite3 extends ADOConnection {
|
||||
|
||||
function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
|
||||
{
|
||||
$nrows = (int) $nrows;
|
||||
$offset = (int) $offset;
|
||||
$offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
|
||||
$limitStr = ($nrows >= 0) ? " LIMIT $nrows" : ($offset >= 0 ? ' LIMIT 999999999' : '');
|
||||
if ($secs2cache) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim. All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Sybase driver contributed by Toni (toni.tunkkari@finebyte.com)
|
||||
|
||||
@ -117,8 +117,10 @@ class ADODB_sybase extends ADOConnection {
|
||||
if ($this->_logsql) return $this->_errorMsg;
|
||||
if (function_exists('sybase_get_last_message'))
|
||||
$this->_errorMsg = sybase_get_last_message();
|
||||
else
|
||||
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : 'SYBASE error messages not supported on this platform';
|
||||
else {
|
||||
$this->_errorMsg = 'SYBASE error messages not supported on this platform';
|
||||
}
|
||||
|
||||
return $this->_errorMsg;
|
||||
}
|
||||
|
||||
@ -133,9 +135,9 @@ class ADODB_sybase extends ADOConnection {
|
||||
}
|
||||
|
||||
if ($this->charSet) {
|
||||
$this->_connectionID = sybase_connect($argHostname,$argUsername,$argPassword, $this->charSet);
|
||||
$this->_connectionID = @sybase_connect($argHostname,$argUsername,$argPassword, $this->charSet);
|
||||
} else {
|
||||
$this->_connectionID = sybase_connect($argHostname,$argUsername,$argPassword);
|
||||
$this->_connectionID = @sybase_connect($argHostname,$argUsername,$argPassword);
|
||||
}
|
||||
|
||||
if ($this->_connectionID === false) return false;
|
||||
@ -154,9 +156,9 @@ class ADODB_sybase extends ADOConnection {
|
||||
}
|
||||
|
||||
if ($this->charSet) {
|
||||
$this->_connectionID = sybase_pconnect($argHostname,$argUsername,$argPassword, $this->charSet);
|
||||
$this->_connectionID = @sybase_pconnect($argHostname,$argUsername,$argPassword, $this->charSet);
|
||||
} else {
|
||||
$this->_connectionID = sybase_pconnect($argHostname,$argUsername,$argPassword);
|
||||
$this->_connectionID = @sybase_pconnect($argHostname,$argUsername,$argPassword);
|
||||
}
|
||||
|
||||
if ($this->_connectionID === false) return false;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Set tabs to 4.
|
||||
@ -259,8 +259,7 @@ class ADODB_text extends ADOConnection {
|
||||
$projtypes = array($this->_types[$i]);
|
||||
$projnames = array($n);
|
||||
|
||||
reset($where_arr);
|
||||
while (list($k_a,$a) = each($where_arr)) {
|
||||
foreach ($where_arr as $a) {
|
||||
if ($i == 0 && $this->_skiprow1) {
|
||||
$projarray[] = array($n);
|
||||
continue;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Microsoft Visual FoxPro data driver. Requires ODBC. Works only on MS Windows.
|
||||
*/
|
||||
|
@ -1,19 +1,22 @@
|
||||
ADOdb License
|
||||
=============
|
||||
|
||||
ADOdb is dual licensed under BSD and LGPL.
|
||||
The ADOdb Library is dual-licensed, released under both the
|
||||
[BSD 3-clause](#bsd-3-clause-license) and the
|
||||
[GNU Lesser General Public License (LGPL) v2.1](#gnu-lesser-general-public-license)
|
||||
or, at your option, any later version.
|
||||
|
||||
In plain English, you do not need to distribute your application in source code form,
|
||||
nor do you need to distribute ADOdb source code, provided you follow the rest of
|
||||
terms of the BSD license.
|
||||
|
||||
For more info about ADOdb, visit http://adodb.sourceforge.net/
|
||||
For more information about ADOdb, visit http://adodb.org/
|
||||
|
||||
BSD 3-Clause License
|
||||
--------------------
|
||||
|
||||
(c) 2000-2013 John Lim (jlim@natsoft.com)
|
||||
(c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
(c) 2000-2013 John Lim (jlim@natsoft.com)
|
||||
(c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence. See License.txt.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Library for basic performance monitoring and tuning
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence. See License.txt.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Library for basic performance monitoring and tuning
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -9,7 +9,7 @@
|
||||
the BSD license will take precedence. See License.txt.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Library for basic performance monitoring and tuning
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -9,7 +9,7 @@
|
||||
the BSD license will take precedence. See License.txt.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Library for basic performance monitoring and tuning
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence. See License.txt.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Library for basic performance monitoring and tuning
|
||||
|
||||
@ -118,7 +118,7 @@ class perf_mysql extends adodb_perf{
|
||||
return $s;
|
||||
}
|
||||
|
||||
function Tables()
|
||||
function tables($orderby='1')
|
||||
{
|
||||
if (!$this->tablesSQL) return false;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -8,7 +8,7 @@
|
||||
the BSD license will take precedence. See License.txt.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Library for basic performance monitoring and tuning
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -9,7 +9,7 @@
|
||||
the BSD license will take precedence. See License.txt.
|
||||
Set tabs to 4 for best viewing.
|
||||
|
||||
Latest version is available at http://adodb.sourceforge.net
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
Library for basic performance monitoring and tuning
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.9 21-Dec-2016
|
||||
* @version v5.20.14 06-Jan-2019
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user