Skip to content

Commit

Permalink
Upgraded ADOdb to 4.71
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Jan 28, 2006
1 parent 13ca56c commit 7d94fa9
Show file tree
Hide file tree
Showing 93 changed files with 714 additions and 243 deletions.
2 changes: 1 addition & 1 deletion lib/adodb/adodb-csvlib.inc.php
Expand Up @@ -8,7 +8,7 @@

/*
V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Expand Down
3 changes: 2 additions & 1 deletion lib/adodb/adodb-datadict.inc.php
@@ -1,7 +1,7 @@
<?php

/**
V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Expand Down Expand Up @@ -61,6 +61,7 @@ function Lens_ParseArgs($args,$endstmtchar=',',$tokenchars='_.-')
$tokens[$stmtno] = array();
$max = strlen($args);
$quoted = false;
$tokarr = array();

while ($pos < $max) {
$ch = substr($args,$pos,1);
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-error.inc.php
@@ -1,6 +1,6 @@
<?php
/**
* @version V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
* @version V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-errorhandler.inc.php
@@ -1,6 +1,6 @@
<?php
/**
* @version V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
* @version V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-errorpear.inc.php
@@ -1,6 +1,6 @@
<?php
/**
* @version V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
* @version V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
* Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-exceptions.inc.php
@@ -1,7 +1,7 @@
<?php

/**
* @version V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
* @version V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-iterator.inc.php
@@ -1,7 +1,7 @@
<?php

/*
V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Expand Down
26 changes: 19 additions & 7 deletions lib/adodb/adodb-lib.inc.php
Expand Up @@ -7,7 +7,7 @@
$ADODB_INCLUDED_LIB = 1;

/*
@version V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim\@natsoft.com.my). All rights reserved.
@version V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim\@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Expand Down Expand Up @@ -57,8 +57,10 @@ function _adodb_replace(&$zthis, $table, $fieldArray, $keyCol, $autoQuote, $has_

$where = false;
foreach ($keyCol as $v) {
if ($where) $where .= " and $v=$fieldArray[$v]";
else $where = "$v=$fieldArray[$v]";
if (isset($fieldArray[$v])) {
if ($where) $where .= ' and '.$v.'='.$fieldArray[$v];
else $where = $v.'='.$fieldArray[$v];
}
}

if ($uSet && $where) {
Expand Down Expand Up @@ -284,6 +286,12 @@ function _adodb_getmenu_gp(&$zthis, $name,$defstr='',$blank1stItem=true,$multipl
query rewriting techniques...
Does not work with UNIONs, except with postgresql and oracle.
Usage:
$conn->Connect(...);
$cnt = _adodb_getcount($conn, $sql);
*/
function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0)
{
Expand Down Expand Up @@ -595,9 +603,11 @@ function _adodb_getupdatesql(&$zthis,&$rs, $arrFields,$forceUpdate=false,$magicq
$discard = false;
// not a good hack, improvements?
if ($whereClause) {
#var_dump($whereClause);
if (preg_match('/\s(ORDER\s.*)/is', $whereClause[1], $discard));
else if (preg_match('/\s(LIMIT\s.*)/is', $whereClause[1], $discard));
else preg_match('/\s(FOR UPDATE.*)/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
$whereClause = array(false,false);

Expand Down Expand Up @@ -919,11 +929,13 @@ function _adodb_debug_execute(&$zthis, $sql, $inputarr)
$dbt = $zthis->databaseType;
if (isset($zthis->dsnType)) $dbt .= '-'.$zthis->dsnType;
if ($inBrowser) {
$ss = htmlspecialchars($ss);
if ($ss) {
$ss = '<code>'.htmlspecialchars($ss).'</code>';
}
if ($zthis->debug === -1)
ADOConnection::outp( "<br>\n($dbt): ".htmlspecialchars($sqlTxt)." &nbsp; <code>$ss</code>\n<br>\n",false);
ADOConnection::outp( "<br />\n($dbt): ".htmlspecialchars($sqlTxt)." &nbsp; $ss\n<br />\n",false);
else
ADOConnection::outp( "<hr>\n($dbt): ".htmlspecialchars($sqlTxt)." &nbsp; <code>$ss</code>\n<hr>\n",false);
ADOConnection::outp( "<hr />\n($dbt): ".htmlspecialchars($sqlTxt)." &nbsp; $ss\n<hr />\n",false);
} else {
ADOConnection::outp("-----\n($dbt): ".$sqlTxt."\n-----\n",false);
}
Expand Down
7 changes: 4 additions & 3 deletions lib/adodb/adodb-pager.inc.php
@@ -1,7 +1,7 @@
<?php

/*
V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Expand Down Expand Up @@ -265,10 +265,11 @@ function Render($rows=10)

$grid = $this->RenderGrid();
$footer = $this->RenderPageCount();
$rs->Close();
$this->rs = false;

$this->RenderLayout($header,$grid,$footer);

$rs->Close();
$this->rs = false;
}

//------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-pear.inc.php
@@ -1,6 +1,6 @@
<?php
/**
* @version V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
* @version V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
Expand Down
10 changes: 5 additions & 5 deletions lib/adodb/adodb-perf.inc.php
@@ -1,6 +1,6 @@
<?php
/*
V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Expand All @@ -16,7 +16,7 @@
*/

if (!defined(ADODB_DIR)) include_once(dirname(__FILE__).'/adodb.inc.php');
if (!defined('ADODB_DIR')) include_once(dirname(__FILE__).'/adodb.inc.php');
include_once(ADODB_DIR.'/tohtml.inc.php');

define( 'ADODB_OPT_HIGH', 2);
Expand Down Expand Up @@ -136,7 +136,7 @@ function& adodb_log_sql(&$conn,$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') {
} else if ($dbT == 'odbc_mssql' || $dbT == 'informix' || $dbT == 'odbtp') {
$timer = $arr['f'];
if ($dbT == 'informix') $sql2 = substr($sql2,0,230);

Expand Down Expand Up @@ -588,7 +588,7 @@ function _DBParameter($sql)

$rs = $this->conn->Execute($sql1);

if (isset($savem)) $this->SetFetchMode($savem);
if (isset($savem)) $this->conn->SetFetchMode($savem);
$ADODB_FETCH_MODE = $save;
if ($rs) {
while (!$rs->EOF) {
Expand Down Expand Up @@ -949,7 +949,7 @@ function SplitSQL($sql)
return $arr;
}

function undomq(&$m)
function undomq($m)
{
if (get_magic_quotes_gpc()) {
// undo the damage
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-php4.inc.php
@@ -1,7 +1,7 @@
<?php

/*
V4.66 28 Sept 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
V4.71 24 Jan 2006 (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-time.inc.php
Expand Up @@ -691,7 +691,7 @@ function adodb_date_gentable($out=true)
for ($i=1970; $i > 1500; $i--) {
echo "<hr>$i ";
echo "<hr />$i ";
adodb_date_test_date($i,1,1);
}
Expand Down
19 changes: 19 additions & 0 deletions lib/adodb/adodb-xmlschema.inc.php
Expand Up @@ -17,6 +17,20 @@
* @package axmls
* @tutorial getting_started.pkg
*/

function _file_get_contents($file)
{
if (function_exists('file_get_contents')) return file_get_contents($file);

$f = fopen($file,'r');
if (!$f) return '';
$t = '';

while ($s = fread($f,100000)) $t .= $s;
fclose($f);
return $t;
}


/**
* Debug on or off
Expand Down Expand Up @@ -1429,6 +1443,10 @@ function ParseSchemaFile( $filename, $returnSchema = FALSE ) {

if ( $returnSchema )
{
$xmlstring = '';
while( $data = fread( $fp, 100000 ) ) {
$xmlstring .= $data;
}
return $xmlstring;
}

Expand Down Expand Up @@ -1572,6 +1590,7 @@ function ExecuteSchema( $sqlArray = NULL, $continueOnErr = NULL ) {
* @return array Array of SQL statements or FALSE if an error occurs
*/
function PrintSQL( $format = 'NONE' ) {
$sqlArray = null;
return $this->getSQL( $format, $sqlArray );
}

Expand Down

0 comments on commit 7d94fa9

Please sign in to comment.