Skip to content

Commit

Permalink
MDL-29328 import latest adodb
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Sep 12, 2011
1 parent 5d2db8a commit 7911fcc
Show file tree
Hide file tree
Showing 121 changed files with 1,513 additions and 2,791 deletions.
2 changes: 1 addition & 1 deletion lib/adodb/adodb-active-record.inc.php
@@ -1,7 +1,7 @@
<?php
/*
@version V5.11 5 May 2010 (c) 2000-2010 John Lim (jlim#natsoft.com). All rights reserved.
@version V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
Latest version is available at http://adodb.sourceforge.net
Released under both BSD license and Lesser GPL library license.
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-active-recordx.inc.php
@@ -1,7 +1,7 @@
<?php
/*
@version V5.06 29 Sept 2008 (c) 2000-2010 John Lim (jlim#natsoft.com). All rights reserved.
@version V5.06 29 Sept 2008 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
Latest version is available at http://adodb.sourceforge.net
Released under both BSD license and Lesser GPL library license.
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-csvlib.inc.php
Expand Up @@ -8,7 +8,7 @@

/*
V5.11 5 May 2010 (c) 2000-2010 John Lim (jlim#natsoft.com). All rights reserved.
V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-datadict.inc.php
@@ -1,7 +1,7 @@
<?php

/**
V5.11 5 May 2010 (c) 2000-2010 John Lim (jlim#natsoft.com). All rights reserved.
V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-error.inc.php
@@ -1,6 +1,6 @@
<?php
/**
* @version V5.06 16 Oct 2008 (c) 2000-2010 John Lim (jlim#natsoft.com). All rights reserved.
* @version V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-errorhandler.inc.php
@@ -1,6 +1,6 @@
<?php
/**
* @version V5.11 5 May 2010 (c) 2000-2010 John Lim (jlim#natsoft.com). All rights reserved.
* @version V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-errorpear.inc.php
@@ -1,6 +1,6 @@
<?php
/**
* @version V5.06 16 Oct 2008 (c) 2000-2010 John Lim (jlim#natsoft.com). All rights reserved.
* @version V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
* Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-exceptions.inc.php
@@ -1,7 +1,7 @@
<?php

/**
* @version V5.11 5 May 2010 (c) 2000-2010 John Lim (jlim#natsoft.com). All rights reserved.
* @version V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-iterator.inc.php
@@ -1,7 +1,7 @@
<?php

/*
V5.11 5 May 2010 (c) 2000-2010 John Lim (jlim#natsoft.com). All rights reserved.
V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Expand Down
34 changes: 23 additions & 11 deletions lib/adodb/adodb-lib.inc.php
@@ -1,16 +1,12 @@
<?php




// security - hide paths
if (!defined('ADODB_DIR')) die();

global $ADODB_INCLUDED_LIB;
$ADODB_INCLUDED_LIB = 1;

/*
@version V5.06 16 Oct 2008 (c) 2000-2010 John Lim (jlim\@natsoft.com.my). All rights reserved.
@version V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Expand Down Expand Up @@ -647,9 +643,17 @@ function _adodb_getupdatesql(&$zthis,&$rs, $arrFields,$forceUpdate=false,$magicq
$type = 'C';
}

if ((strpos($upperfname,' ') !== false) || ($ADODB_QUOTE_FIELDNAMES))
$fnameq = $zthis->nameQuote.$upperfname.$zthis->nameQuote;
else
if ((strpos($upperfname,' ') !== false) || ($ADODB_QUOTE_FIELDNAMES)) {
switch (ADODB_QUOTE_FIELDNAMES) {
case 'LOWER':
$fnameq = $zthis->nameQuote.strtolower($field->name).$zthis->nameQuote;break;
case 'NATIVE':
$fnameq = $zthis->nameQuote.$field->name.$zthis->nameQuote;break;
case 'UPPER':
default:
$fnameq = $zthis->nameQuote.$upperfname.$zthis->nameQuote;break;
}
} else
$fnameq = $upperfname;


Expand Down Expand Up @@ -811,9 +815,17 @@ function _adodb_getinsertsql(&$zthis,&$rs,$arrFields,$magicq=false,$force=2)
$upperfname = strtoupper($field->name);
if (adodb_key_exists($upperfname,$arrFields,$force)) {
$bad = false;
if ((strpos($upperfname,' ') !== false) || ($ADODB_QUOTE_FIELDNAMES))
$fnameq = $zthis->nameQuote.$upperfname.$zthis->nameQuote;
else
if ((strpos($upperfname,' ') !== false) || ($ADODB_QUOTE_FIELDNAMES)) {
switch (ADODB_QUOTE_FIELDNAMES) {
case 'LOWER':
$fnameq = $zthis->nameQuote.strtolower($field->name).$zthis->nameQuote;break;
case 'NATIVE':
$fnameq = $zthis->nameQuote.$field->name.$zthis->nameQuote;break;
case 'UPPER':
default:
$fnameq = $zthis->nameQuote.$upperfname.$zthis->nameQuote;break;
}
} else
$fnameq = $upperfname;

$type = $recordSet->MetaType($field->type);
Expand Down
4 changes: 2 additions & 2 deletions lib/adodb/adodb-memcache.lib.inc.php
Expand Up @@ -11,7 +11,7 @@

/*
V5.06 16 Oct 2008 (c) 2000-2010 John Lim (jlim#natsoft.com). All rights reserved.
V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Expand Down Expand Up @@ -91,7 +91,7 @@ function writecache($filename, $contents, $debug, $secs2cache)
}
if (!$this->_memcache) return false;

if (!$this->_memcache->set($filename, $contents, $this->compress, $secs2cache)) {
if (!$this->_memcache->set($filename, $contents, $this->compress ? MEMCACHE_COMPRESSED : 0, $secs2cache)) {
if ($debug) ADOConnection::outp(" Failed to save data at the memcached server!<br>\n");
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-pager.inc.php
@@ -1,7 +1,7 @@
<?php

/*
V5.11 5 May 2010 (c) 2000-2010 John Lim (jlim#natsoft.com). All rights reserved.
V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-pear.inc.php
@@ -1,6 +1,6 @@
<?php
/**
* @version V5.06 16 Oct 2008 (c) 2000-2010 John Lim (jlim#natsoft.com). All rights reserved.
* @version V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-perf.inc.php
@@ -1,6 +1,6 @@
<?php
/*
V5.11 5 May 2010 (c) 2000-2010 John Lim (jlim#natsoft.com). All rights reserved.
V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Expand Down
2 changes: 1 addition & 1 deletion lib/adodb/adodb-php4.inc.php
@@ -1,7 +1,7 @@
<?php

/*
V5.11 5 May 2010 (c) 2000-2010 John Lim (jlim#natsoft.com). All rights reserved.
V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Expand Down
33 changes: 27 additions & 6 deletions lib/adodb/adodb-time.inc.php
Expand Up @@ -242,6 +242,12 @@
CHANGELOG
- 7 Feb 2011 0.35
Changed adodb_date to be symmetric with adodb_mktime. See $jan1_71. fix for bc.
- 13 July 2010 0.34
Changed adodb_get_gm_diff to use DateTimeZone().
- 11 Feb 2008 0.33
* Bug in 0.32 fix for hour handling. Fixed.
Expand Down Expand Up @@ -386,7 +392,7 @@ function adodb_daylight_sv(&$arr, $is_gmt)
/*
Version Number
*/
define('ADODB_DATE_VERSION',0.33);
define('ADODB_DATE_VERSION',0.35);

$ADODB_DATETIME_CLASS = (PHP_VERSION >= 5.2);

Expand Down Expand Up @@ -729,9 +735,17 @@ function adodb_get_gmt_diff($y,$m,$d)
} else {
if (isset($TZ)) return $TZ;
$y = date('Y');
$TZ = mktime(0,0,0,12,2,$y,0) - gmmktime(0,0,0,12,2,$y,0);
/*
if (function_exists('date_default_timezone_get') && function_exists('timezone_offset_get')) {
$tzonename = date_default_timezone_get();
if ($tzonename) {
$tobj = new DateTimeZone($tzonename);
$TZ = -timezone_offset_get($tobj,new DateTime("now",$tzo));
}
}
*/
if (empty($TZ)) $TZ = mktime(0,0,0,12,2,$y) - gmmktime(0,0,0,12,2,$y);
}

return $TZ;
}

Expand Down Expand Up @@ -1040,11 +1054,19 @@ function adodb_date($fmt,$d=false,$is_gmt=false)
{
static $daylight;
global $ADODB_DATETIME_CLASS;
static $jan1_1971;


if (!isset($daylight)) {
$daylight = function_exists('adodb_daylight_sv');
if (empty($jan1_1971)) $jan1_1971 = mktime(0,0,0,1,1,1971); // we only use date() when > 1970 as adodb_mktime() only uses mktime() when > 1970
}

if ($d === false) return ($is_gmt)? @gmdate($fmt): @date($fmt);
if (!defined('ADODB_TEST_DATES')) {
if ((abs($d) <= 0x7FFFFFFF)) { // check if number in 32-bit signed range
if (!defined('ADODB_NO_NEGATIVE_TS') || $d >= 0) // if windows, must be +ve integer

if (!defined('ADODB_NO_NEGATIVE_TS') || $d >= $jan1_1971) // if windows, must be +ve integer
return ($is_gmt)? @gmdate($fmt,$d): @date($fmt,$d);

}
Expand All @@ -1053,7 +1075,6 @@ function adodb_date($fmt,$d=false,$is_gmt=false)

$arr = _adodb_getdate($d,true,$is_gmt);

if (!isset($daylight)) $daylight = function_exists('adodb_daylight_sv');
if ($daylight) adodb_daylight_sv($arr, $is_gmt);

$year = $arr['year'];
Expand Down Expand Up @@ -1426,4 +1447,4 @@ function adodb_strftime($fmt, $ts=false,$is_gmt=false)
}


?>
?>
6 changes: 3 additions & 3 deletions lib/adodb/adodb-xmlschema.inc.php
Expand Up @@ -10,9 +10,9 @@
* build a database on any ADOdb-supported platform using a simple
* XML schema.
*
* Last Editor: $Author$
* Last Editor: $Author: jlim $
* @author Richard Tango-Lowy & Dan Cech
* @version $Revision$
* @version $Revision: 1.12 $
*
* @package axmls
* @tutorial getting_started.pkg
Expand Down Expand Up @@ -1211,7 +1211,7 @@ function prefixQuery( $regex, $query, $prefix = NULL ) {
* @tutorial getting_started.pkg
*
* @author Richard Tango-Lowy & Dan Cech
* @version $Revision$
* @version $Revision: 1.12 $
*
* @package axmls
*/
Expand Down
6 changes: 3 additions & 3 deletions lib/adodb/adodb-xmlschema03.inc.php
Expand Up @@ -10,9 +10,9 @@
* build a database on any ADOdb-supported platform using a simple
* XML schema.
*
* Last Editor: $Author$
* Last Editor: $Author: jlim $
* @author Richard Tango-Lowy & Dan Cech
* @version $Revision$
* @version $Revision: 1.62 $
*
* @package axmls
* @tutorial getting_started.pkg
Expand Down Expand Up @@ -1310,7 +1310,7 @@ function prefixQuery( $regex, $query, $prefix = NULL ) {
* @tutorial getting_started.pkg
*
* @author Richard Tango-Lowy & Dan Cech
* @version $Revision$
* @version $Revision: 1.62 $
*
* @package axmls
*/
Expand Down
14 changes: 8 additions & 6 deletions lib/adodb/adodb.inc.php
Expand Up @@ -14,7 +14,7 @@
/**
\mainpage
@version V5.11 5 May 2010 (c) 2000-2010 John Lim (jlim#natsoft.com). All rights reserved.
@version V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
Released under both BSD license and Lesser GPL library license. You can choose which license
you prefer.
Expand Down Expand Up @@ -177,7 +177,7 @@ function ADODB_Setup()
/**
* ADODB version as a string.
*/
$ADODB_vers = 'V5.11 5 May 2010 (c) 2000-2010 John Lim (jlim#natsoft.com). All rights reserved. Released BSD & LGPL.';
$ADODB_vers = 'V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved. Released BSD & LGPL.';

/**
* Determines whether recordset->RecordCount() is used.
Expand Down Expand Up @@ -954,13 +954,15 @@ function Execute($sql,$inputarr=false)
$element0 = reset($inputarr);
# is_object check because oci8 descriptors can be passed in
$array_2d = $this->bulkBind && is_array($element0) && !is_object(reset($element0));

//remove extra memory copy of input -mikefedyk
unset($element0);

if (!is_array($sql) && !$this->_bindInputArray) {
$sqlarr = explode('?',$sql);
$nparams = sizeof($sqlarr)-1;
if (!$array_2d) $inputarr = array($inputarr);

foreach($inputarr as $arr) {
$sql = ''; $i = 0;
//Use each() instead of foreach to reduce memory usage -mikefedyk
Expand Down Expand Up @@ -1002,7 +1004,7 @@ function Execute($sql,$inputarr=false)
$stmt = $this->Prepare($sql);
else
$stmt = $sql;

foreach($inputarr as $arr) {
$ret = $this->_Execute($stmt,$arr);
if (!$ret) return $ret;
Expand Down Expand Up @@ -1799,7 +1801,7 @@ function CacheExecute($secs2cache,$sql=false,$inputarr=false)
if (get_magic_quotes_runtime() && !$this->memCache) {
ADOConnection::outp("Please disable magic_quotes_runtime - it corrupts cache files :(");
}
if ($this->debug !== -1) ADOConnection::outp( " $md5file cache failure: $err (see sql below)");
if ($this->debug !== -1) ADOConnection::outp( " $md5file cache failure: $err (this is a notice and not an error)");
}

$rs = $this->Execute($sqlparam,$inputarr);
Expand Down Expand Up @@ -4153,7 +4155,7 @@ function ADONewConnection($db='')
$fakedsn = str_replace('@/','@adodb-fakehost/',$fakedsn);
}

if ((strpos($origdsn, 'sqlite')) !== FALSE) {
if ((strpos($origdsn, 'sqlite')) !== FALSE && stripos($origdsn, '%2F') === FALSE) {
// special handling for SQLite, it only might have the path to the database file.
// If you try to connect to a SQLite database using a dsn like 'sqlite:///path/to/database', the 'parse_url' php function
// will throw you an exception with a message such as "unable to parse url"
Expand Down Expand Up @@ -4413,4 +4415,4 @@ function adodb_backtrace($printOrArr=true,$levels=9999,$ishtml=null)


}
?>
?>

0 comments on commit 7911fcc

Please sign in to comment.