From: <var...@us...> - 2020-12-26 16:01:47
|
Revision: 10206 http://sourceforge.net/p/phpwiki/code/10206 Author: vargenau Date: 2020-12-26 16:01:39 +0000 (Sat, 26 Dec 2020) Log Message: ----------- Update Adodb to version 5.20.19 Modified Paths: -------------- trunk/config/phpwiki.spec trunk/lib/WikiDB/adodb/LICENSE.md trunk/lib/WikiDB/adodb/README.md trunk/lib/WikiDB/adodb/adodb-active-record.inc.php trunk/lib/WikiDB/adodb/adodb-active-recordx.inc.php trunk/lib/WikiDB/adodb/adodb-csvlib.inc.php trunk/lib/WikiDB/adodb/adodb-datadict.inc.php trunk/lib/WikiDB/adodb/adodb-error.inc.php trunk/lib/WikiDB/adodb/adodb-errorhandler.inc.php trunk/lib/WikiDB/adodb/adodb-errorpear.inc.php trunk/lib/WikiDB/adodb/adodb-exceptions.inc.php trunk/lib/WikiDB/adodb/adodb-iterator.inc.php trunk/lib/WikiDB/adodb/adodb-lib.inc.php trunk/lib/WikiDB/adodb/adodb-memcache.lib.inc.php trunk/lib/WikiDB/adodb/adodb-pager.inc.php trunk/lib/WikiDB/adodb/adodb-pear.inc.php trunk/lib/WikiDB/adodb/adodb-perf.inc.php trunk/lib/WikiDB/adodb/adodb-php4.inc.php trunk/lib/WikiDB/adodb/adodb-time.inc.php trunk/lib/WikiDB/adodb/adodb-xmlschema.inc.php trunk/lib/WikiDB/adodb/adodb-xmlschema03.inc.php trunk/lib/WikiDB/adodb/adodb.inc.php trunk/lib/WikiDB/adodb/composer.json trunk/lib/WikiDB/adodb/datadict/datadict-access.inc.php trunk/lib/WikiDB/adodb/datadict/datadict-db2.inc.php trunk/lib/WikiDB/adodb/datadict/datadict-firebird.inc.php trunk/lib/WikiDB/adodb/datadict/datadict-generic.inc.php trunk/lib/WikiDB/adodb/datadict/datadict-ibase.inc.php trunk/lib/WikiDB/adodb/datadict/datadict-informix.inc.php trunk/lib/WikiDB/adodb/datadict/datadict-mssql.inc.php trunk/lib/WikiDB/adodb/datadict/datadict-mssqlnative.inc.php trunk/lib/WikiDB/adodb/datadict/datadict-mysql.inc.php trunk/lib/WikiDB/adodb/datadict/datadict-oci8.inc.php trunk/lib/WikiDB/adodb/datadict/datadict-postgres.inc.php trunk/lib/WikiDB/adodb/datadict/datadict-sapdb.inc.php trunk/lib/WikiDB/adodb/datadict/datadict-sqlite.inc.php trunk/lib/WikiDB/adodb/datadict/datadict-sybase.inc.php trunk/lib/WikiDB/adodb/docs/changelog.md trunk/lib/WikiDB/adodb/docs/changelog_v2.x.md trunk/lib/WikiDB/adodb/docs/changelog_v3.x.md trunk/lib/WikiDB/adodb/docs/changelog_v4+5.md trunk/lib/WikiDB/adodb/docs/changelog_v4.x.md trunk/lib/WikiDB/adodb/drivers/adodb-access.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-ado.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-ado5.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-ado_access.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-ado_mssql.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-ads.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-borland_ibase.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-csv.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-db2.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-db2oci.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-db2ora.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-fbsql.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-firebird.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-ibase.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-informix.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-informix72.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-ldap.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-mssql.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-mssql_n.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-mssqlnative.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-mssqlpo.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-mysql.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-mysqli.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-mysqlpo.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-mysqlt.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-netezza.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-oci8.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-oci805.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-oci8po.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-oci8quercus.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-odbc.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-odbc_db2.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-odbc_mssql.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-odbc_oracle.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-odbtp.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-odbtp_unicode.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-oracle.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-pdo.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-pdo_mssql.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-pdo_mysql.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-pdo_oci.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-pdo_pgsql.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-pdo_sqlite.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-postgres.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-postgres64.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-postgres7.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-postgres8.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-postgres9.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-proxy.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-sapdb.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-sqlanywhere.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-sqlite.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-sqlite3.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-sqlitepo.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-sybase.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-sybase_ase.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-vfp.inc.php trunk/lib/WikiDB/adodb/pear/Auth/Container/ADOdb.php trunk/lib/WikiDB/adodb/perf/perf-db2.inc.php trunk/lib/WikiDB/adodb/perf/perf-informix.inc.php trunk/lib/WikiDB/adodb/perf/perf-mssql.inc.php trunk/lib/WikiDB/adodb/perf/perf-mssqlnative.inc.php trunk/lib/WikiDB/adodb/perf/perf-mysql.inc.php trunk/lib/WikiDB/adodb/perf/perf-oci8.inc.php trunk/lib/WikiDB/adodb/perf/perf-postgres.inc.php trunk/lib/WikiDB/adodb/pivottable.inc.php trunk/lib/WikiDB/adodb/rsfilter.inc.php trunk/lib/WikiDB/adodb/server.php trunk/lib/WikiDB/adodb/session/adodb-compress-bzip2.php trunk/lib/WikiDB/adodb/session/adodb-compress-gzip.php trunk/lib/WikiDB/adodb/session/adodb-cryptsession.php trunk/lib/WikiDB/adodb/session/adodb-cryptsession2.php trunk/lib/WikiDB/adodb/session/adodb-encrypt-mcrypt.php trunk/lib/WikiDB/adodb/session/adodb-encrypt-md5.php trunk/lib/WikiDB/adodb/session/adodb-encrypt-secret.php trunk/lib/WikiDB/adodb/session/adodb-session-clob.php trunk/lib/WikiDB/adodb/session/adodb-session-clob2.php trunk/lib/WikiDB/adodb/session/adodb-session.php trunk/lib/WikiDB/adodb/session/adodb-session2.php trunk/lib/WikiDB/adodb/session/crypt.inc.php trunk/lib/WikiDB/adodb/session/old/adodb-cryptsession.php trunk/lib/WikiDB/adodb/session/old/adodb-session-clob.php trunk/lib/WikiDB/adodb/session/old/adodb-session.php trunk/lib/WikiDB/adodb/session/old/crypt.inc.php trunk/lib/WikiDB/adodb/toexport.inc.php trunk/lib/WikiDB/adodb/tohtml.inc.php trunk/pgsrc/ReleaseNotes Modified: trunk/config/phpwiki.spec =================================================================== --- trunk/config/phpwiki.spec 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/config/phpwiki.spec 2020-12-26 16:01:39 UTC (rev 10206) @@ -40,7 +40,7 @@ # RPM spec preamble Summary: PHP-based Wiki webapplication Name: phpwiki -Version: 1.6.0 +Version: @@VERSION@@ Release: 1 BuildArch: noarch License: GPL @@ -53,7 +53,7 @@ #Relocation! Prefix: /var/www -Requires: httpd, php, php-pear, units, graphviz, php-mysql +Requires: httpd, php, php-pear, units, graphviz Autoreq: 0 @@ -104,18 +104,6 @@ %post -cd %{prefix}/%{name} -mysqladmin create %{DB_NAME} - -echo 'GRANT select, insert, update, delete, lock tables -ON %{DB_NAME}.* -TO %{DB_USER}@localhost -IDENTIFIED BY "%{DB_PASSWD}"' | mysql - -mysqladmin reload - -cat schemas/mysql-initialize.sql | mysql %{DB_NAME} - %files %defattr(-, root, root) %doc README UPGRADING LICENSE INSTALL doc Makefile Modified: trunk/lib/WikiDB/adodb/LICENSE.md =================================================================== --- trunk/lib/WikiDB/adodb/LICENSE.md 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/LICENSE.md 2020-12-26 16:01:39 UTC (rev 10206) @@ -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 (jl...@na...) -(c) 2014 Damien Regad, Mark Newnham and the ADOdb community +(c) 2000-2013 John Lim (jl...@na...) +(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, Modified: trunk/lib/WikiDB/adodb/README.md =================================================================== --- trunk/lib/WikiDB/adodb/README.md 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/README.md 2020-12-26 16:01:39 UTC (rev 10206) @@ -5,26 +5,20 @@ [](https://sourceforge.net/projects/adodb/files/latest/download) (c) 2000-2013 John Lim (jl...@na...) -(c) 2014 Damien Regad, Mark Newnham and the ADOdb community +(c) 2014 Damien Regad, Mark Newnham and the + [ADOdb community](https://github.com/ADOdb/ADOdb/graphs/contributors) -Released under both [BSD 3-Clause](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md#bsd-3-clause-license) -and [GNU Lesser GPL library 2.1](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md#gnu-lesser-general-public-license) -licenses. -This means you can use it in proprietary products; +The ADOdb Library is dual-licensed, released under both the +[BSD 3-Clause](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md#bsd-3-clause-license) +and the +[GNU Lesser General Public Licence (LGPL) v2.1](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md#gnu-lesser-general-public-license) +or, at your option, any later version. +This means you can use it in proprietary products; see [License](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md) for details. Home page: http://adodb.org/ -> **WARNING: known issue with Associative Fetch Mode in ADOdb v5.19 --- PLEASE UPGRADE TO v5.20 !** -> When fetching data in Associative mode (i.e. when `$ADODB_FETCH_MODE` is -> set to *ADODB_FETCH_ASSOC*), recordsets do not return any data (empty strings) -> when using some database drivers. The problem has been reported on MSSQL, -> Interbase and Foxpro, but possibly affects other drivers as well; all drivers -> derived from the above are also impacted. -> For further details, please refer to [Issue #20](https://github.com/ADOdb/ADOdb/issues/20). - Introduction ============ @@ -102,7 +96,6 @@ You may also find legacy issues in -- the old [ADOdb forums](http://phplens.com/lens/lensforum/topics.php?id=4) on phplens.com - the [SourceForge tickets section](http://sourceforge.net/p/adodb/_list/tickets) However, please note that they are not actively monitored and should Modified: trunk/lib/WikiDB/adodb/adodb-active-record.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb-active-record.inc.php 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/adodb-active-record.inc.php 2020-12-26 16:01:39 UTC (rev 10206) @@ -1,10 +1,10 @@ <?php /* -@version v5.20.9 21-Dec-2016 +@version v5.20.19 13-Dec-2020 @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, @@ -46,7 +46,7 @@ // $db = database connection // $index = name of index - can be associative, for an example see -// http://phplens.com/lens/lensforum/msgs.php?id=17790 +// PHPLens Issue No: 17790 // returns index into $_ADODB_ACTIVE_DBS function ADODB_SetDatabaseAdapter(&$db, $index=false) { @@ -120,7 +120,7 @@ // php5 constructor function __construct($table = false, $pkeyarr=false, $db=false) { - global $ADODB_ASSOC_CASE,$_ADODB_ACTIVE_DBS; + global $_ADODB_ACTIVE_DBS; if ($db == false && is_object($pkeyarr)) { $db = $pkeyarr; @@ -374,7 +374,7 @@ // update metadata function UpdateActiveTable($pkeys=false,$forceUpdate=false) { - global $ADODB_ASSOC_CASE,$_ADODB_ACTIVE_DBS , $ADODB_CACHE_DIR, $ADODB_ACTIVE_CACHESECS; + global $_ADODB_ACTIVE_DBS , $ADODB_CACHE_DIR, $ADODB_ACTIVE_CACHESECS; global $ADODB_ACTIVE_DEFVALS,$ADODB_FETCH_MODE; $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat]; @@ -463,8 +463,8 @@ $attr = array(); $keys = array(); - switch($ADODB_ASSOC_CASE) { - case 0: + switch (ADODB_ASSOC_CASE) { + case ADODB_ASSOC_CASE_LOWER: foreach($cols as $name => $fldobj) { $name = strtolower($name); if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value)) { @@ -480,7 +480,7 @@ } break; - case 1: + case ADODB_ASSOC_CASE_UPPER: foreach($cols as $name => $fldobj) { $name = strtoupper($name); @@ -510,7 +510,7 @@ $attr[$name] = $fldobj; } foreach($pkeys as $k => $name) { - $keys[$name] = $cols[$name]->name; + $keys[$name] = $cols[strtoupper($name)]->name; } break; } @@ -813,7 +813,7 @@ } # useful for multiple record inserts - # see http://phplens.com/lens/lensforum/msgs.php?id=17795 + # see PHPLens Issue No: 17795 function Reset() { $this->_where=null; @@ -927,8 +927,6 @@ // returns 0 on error, 1 on update, 2 on insert function Replace() { - global $ADODB_ASSOC_CASE; - $db = $this->DB(); if (!$db) { return false; @@ -968,15 +966,18 @@ $pkey = array($pkey); } - if ($ADODB_ASSOC_CASE == 0) { - foreach($pkey as $k => $v) - $pkey[$k] = strtolower($v); + switch (ADODB_ASSOC_CASE) { + case ADODB_ASSOC_CASE_LOWER: + foreach ($pkey as $k => $v) { + $pkey[$k] = strtolower($v); + } + break; + case ADODB_ASSOC_CASE_UPPER: + foreach ($pkey as $k => $v) { + $pkey[$k] = strtoupper($v); + } + break; } - elseif ($ADODB_ASSOC_CASE == 1) { - foreach($pkey as $k => $v) { - $pkey[$k] = strtoupper($v); - } - } $ok = $db->Replace($this->_table,$arr,$pkey); if ($ok) { Modified: trunk/lib/WikiDB/adodb/adodb-active-recordx.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb-active-recordx.inc.php 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/adodb-active-recordx.inc.php 2020-12-26 16:01:39 UTC (rev 10206) @@ -1,10 +1,10 @@ <?php /* -@version v5.20.9 21-Dec-2016 +@version v5.20.19 13-Dec-2020 @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, @@ -137,7 +137,7 @@ // if $options['new'] is true, we forget all relations function __construct($table = false, $pkeyarr=false, $db=false, $options=array()) { - global $ADODB_ASSOC_CASE,$_ADODB_ACTIVE_DBS; + global $_ADODB_ACTIVE_DBS; if ($db == false && is_object($pkeyarr)) { $db = $pkeyarr; @@ -410,7 +410,7 @@ // update metadata function UpdateActiveTable($pkeys=false,$forceUpdate=false) { - global $ADODB_ASSOC_CASE,$_ADODB_ACTIVE_DBS , $ADODB_CACHE_DIR, $ADODB_ACTIVE_CACHESECS; + global $_ADODB_ACTIVE_DBS , $ADODB_CACHE_DIR, $ADODB_ACTIVE_CACHESECS; global $ADODB_ACTIVE_DEFVALS, $ADODB_FETCH_MODE; $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat]; @@ -491,8 +491,8 @@ $attr = array(); $keys = array(); - switch($ADODB_ASSOC_CASE) { - case 0: + switch (ADODB_ASSOC_CASE) { + case ADODB_ASSOC_CASE_LOWER: foreach($cols as $name => $fldobj) { $name = strtolower($name); if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value)) { @@ -508,7 +508,7 @@ } break; - case 1: + case ADODB_ASSOC_CASE_UPPER: foreach($cols as $name => $fldobj) { $name = strtoupper($name); @@ -1060,8 +1060,6 @@ // returns 0 on error, 1 on update, 2 on insert function Replace() { - global $ADODB_ASSOC_CASE; - $db = $this->DB(); if (!$db) { return false; @@ -1097,7 +1095,7 @@ } - switch ($ADODB_ASSOC_CASE == 0) { + switch (ADODB_ASSOC_CASE) { case ADODB_ASSOC_CASE_LOWER: foreach($pkey as $k => $v) { $pkey[$k] = strtolower($v); Modified: trunk/lib/WikiDB/adodb/adodb-csvlib.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb-csvlib.inc.php 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/adodb-csvlib.inc.php 2020-12-26 16:01:39 UTC (rev 10206) @@ -8,7 +8,7 @@ /* - @version v5.20.9 21-Dec-2016 + @version v5.20.19 13-Dec-2020 @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 @@ 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 - ============== */ /** Modified: trunk/lib/WikiDB/adodb/adodb-datadict.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb-datadict.inc.php 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/adodb-datadict.inc.php 2020-12-26 16:01:39 UTC (rev 10206) @@ -1,7 +1,7 @@ <?php /** - @version v5.20.9 21-Dec-2016 + @version v5.20.19 13-Dec-2020 @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. @@ -520,7 +520,7 @@ list($lines,$pkey,$idxs) = $this->_GenFields($flds); // genfields can return FALSE at times if ($lines == null) $lines = array(); - list(,$first) = each($lines); + $first = current($lines); list(,$column_def) = preg_split("/[\t ]+/",$first,2); } return array(sprintf($this->renameColumn,$tabname,$this->NameQuote($oldcolumn),$this->NameQuote($newcolumn),$column_def)); Modified: trunk/lib/WikiDB/adodb/adodb-error.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb-error.inc.php 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/adodb-error.inc.php 2020-12-26 16:01:39 UTC (rev 10206) @@ -1,6 +1,6 @@ <?php /** - * @version v5.20.9 21-Dec-2016 + * @version v5.20.19 13-Dec-2020 * @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. @@ -111,7 +111,7 @@ 'could not serialize access due to' => DB_ERROR_SERIALIZATION_FAILURE ); reset($error_regexps); - while (list($regexp,$code) = each($error_regexps)) { + foreach ($error_regexps as $regexp => $code) { if (preg_match("/$regexp/mi", $errormsg)) { return $code; } Modified: trunk/lib/WikiDB/adodb/adodb-errorhandler.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb-errorhandler.inc.php 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/adodb-errorhandler.inc.php 2020-12-26 16:01:39 UTC (rev 10206) @@ -1,6 +1,6 @@ <?php /** - * @version v5.20.9 21-Dec-2016 + * @version v5.20.19 13-Dec-2020 * @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/ * */ Modified: trunk/lib/WikiDB/adodb/adodb-errorpear.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb-errorpear.inc.php 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/adodb-errorpear.inc.php 2020-12-26 16:01:39 UTC (rev 10206) @@ -1,6 +1,6 @@ <?php /** - * @version v5.20.9 21-Dec-2016 + * @version v5.20.19 13-Dec-2020 * @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'); Modified: trunk/lib/WikiDB/adodb/adodb-exceptions.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb-exceptions.inc.php 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/adodb-exceptions.inc.php 2020-12-26 16:01:39 UTC (rev 10206) @@ -1,7 +1,7 @@ <?php /** - * @version v5.20.9 21-Dec-2016 + * @version v5.20.19 13-Dec-2020 * @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). */ Modified: trunk/lib/WikiDB/adodb/adodb-iterator.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb-iterator.inc.php 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/adodb-iterator.inc.php 2020-12-26 16:01:39 UTC (rev 10206) @@ -1,7 +1,7 @@ <?php /* - @version v5.20.9 21-Dec-2016 + @version v5.20.19 13-Dec-2020 @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. Modified: trunk/lib/WikiDB/adodb/adodb-lib.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb-lib.inc.php 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/adodb-lib.inc.php 2020-12-26 16:01:39 UTC (rev 10206) @@ -6,7 +6,7 @@ $ADODB_INCLUDED_LIB = 1; /* - @version v5.20.9 21-Dec-2016 + @version v5.20.19 13-Dec-2020 @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. @@ -177,7 +177,7 @@ if ($zthis->poorAffectedRows) { /* The Select count(*) wipes out any errors that the update would have returned. - http://phplens.com/lens/lensforum/msgs.php?id=5696 + PHPLens Issue No: 5696 */ if ($zthis->ErrorNo()<>0) return 0; @@ -212,122 +212,66 @@ return ($rs) ? 2 : 0; } -// Requires $ADODB_FETCH_MODE = ADODB_FETCH_NUM function _adodb_getmenu(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=false, $size=0, $selectAttr='',$compareFields0=true) { - $hasvalue = false; + global $ADODB_FETCH_MODE; - if ($multiple or is_array($defstr)) { - if ($size==0) $size=5; - $attr = ' multiple size="'.$size.'"'; - if (!strpos($name,'[]')) $name .= '[]'; - } else if ($size) $attr = ' size="'.$size.'"'; - else $attr =''; + $s = _adodb_getmenu_select($name, $defstr, $blank1stItem, $multiple, $size, $selectAttr); - $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>"; + $hasvalue = $zthis->FieldCount() > 1; + if (!$hasvalue) { + $compareFields0 = true; + } - if ($zthis->FieldCount() > 1) $hasvalue=true; - else $compareFields0 = true; - $value = ''; - $optgroup = null; - $firstgroup = true; - $fieldsize = $zthis->FieldCount(); while(!$zthis->EOF) { $zval = rtrim(reset($zthis->fields)); - if ($blank1stItem && $zval=="") { + if ($blank1stItem && $zval == "") { $zthis->MoveNext(); continue; } - if ($fieldsize > 1) { - if (isset($zthis->fields[1])) - $zval2 = rtrim($zthis->fields[1]); - else - $zval2 = rtrim(next($zthis->fields)); + if ($hasvalue) { + if ($ADODB_FETCH_MODE == ADODB_FETCH_ASSOC) { + // Get 2nd field's value regardless of its name + $zval2 = current(array_slice($zthis->fields, 1, 1)); + } else { + // With NUM or BOTH fetch modes, we have a numeric index + $zval2 = $zthis->fields[1]; + } + $zval2 = trim($zval2); + $value = 'value="' . htmlspecialchars($zval2) . '"'; } - $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)."'"; + $s .= _adodb_getmenu_option($defstr, $compareFields0 ? $zval : $zval2, $value, $zval); - if (is_array($defstr)) { - - if (in_array($selected,$defstr)) - $s .= "\n<option selected='selected'$value>".htmlspecialchars($zval).'</option>'; - else - $s .= "\n<option".$value.'>'.htmlspecialchars($zval).'</option>'; - } - else { - if (strcasecmp($selected,$defstr)==0) - $s .= "\n<option selected='selected'$value>".htmlspecialchars($zval).'</option>'; - else - $s .= "\n<option".$value.'>'.htmlspecialchars($zval).'</option>'; - } $zthis->MoveNext(); } // while - // closing last optgroup - if($optgroup != null) { - $s .= "\n</optgroup>"; - } return $s ."\n</select>\n"; } -// Requires $ADODB_FETCH_MODE = ADODB_FETCH_NUM function _adodb_getmenu_gp(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=false, $size=0, $selectAttr='',$compareFields0=true) { - $hasvalue = false; + global $ADODB_FETCH_MODE; - if ($multiple or is_array($defstr)) { - if ($size==0) $size=5; - $attr = ' multiple size="'.$size.'"'; - if (!strpos($name,'[]')) $name .= '[]'; - } else if ($size) $attr = ' size="'.$size.'"'; - else $attr =''; + $s = _adodb_getmenu_select($name, $defstr, $blank1stItem, $multiple, $size, $selectAttr); - $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>"; + $hasvalue = $zthis->FieldCount() > 1; + $hasgroup = $zthis->FieldCount() > 2; + if (!$hasvalue) { + $compareFields0 = true; + } - if ($zthis->FieldCount() > 1) $hasvalue=true; - else $compareFields0 = true; - $value = ''; - $optgroup = null; - $firstgroup = true; - $fieldsize = sizeof($zthis->fields); + $optgroup = null; + $firstgroup = true; while(!$zthis->EOF) { $zval = rtrim(reset($zthis->fields)); + $group = ''; if ($blank1stItem && $zval=="") { $zthis->MoveNext(); @@ -334,57 +278,119 @@ continue; } - if ($fieldsize > 1) { - if (isset($zthis->fields[1])) - $zval2 = rtrim($zthis->fields[1]); - else - $zval2 = rtrim(next($zthis->fields)); + if ($hasvalue) { + if ($ADODB_FETCH_MODE == ADODB_FETCH_ASSOC) { + // Get 2nd field's value regardless of its name + $fields = array_slice($zthis->fields, 1); + $zval2 = current($fields); + if ($hasgroup) { + $group = trim(next($fields)); + } + } else { + // With NUM or BOTH fetch modes, we have a numeric index + $zval2 = $zthis->fields[1]; + if ($hasgroup) { + $group = trim($zthis->fields[2]); + } + } + $zval2 = trim($zval2); + $value = "value='".htmlspecialchars($zval2)."'"; } - $selected = ($compareFields0) ? $zval : $zval2; - $group = ''; - if (isset($zthis->fields[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 ($optgroup != $group) { + $optgroup = $group; + if ($firstgroup) { + $firstgroup = false; + } else { + $s .="\n</optgroup>"; + } + $s .="\n<optgroup label='". htmlspecialchars($group) ."'>"; } - if ($hasvalue) - $value = " value='".htmlspecialchars($zval2)."'"; + $s .= _adodb_getmenu_option($defstr, $compareFields0 ? $zval : $zval2, $value, $zval); - if (is_array($defstr)) { - - if (in_array($selected,$defstr)) - $s .= "\n<option selected='selected'$value>".htmlspecialchars($zval).'</option>'; - else - $s .= "\n<option".$value.'>'.htmlspecialchars($zval).'</option>'; - } - else { - if (strcasecmp($selected,$defstr)==0) - $s .= "\n<option selected='selected'$value>".htmlspecialchars($zval).'</option>'; - else - $s .= "\n<option".$value.'>'.htmlspecialchars($zval).'</option>'; - } $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"; } +/** + * Generate the opening SELECT tag for getmenu functions. + * + * ADOdb internal function, used by _adodb_getmenu() and _adodb_getmenu_gp(). + * + * @param string $name + * @param string $defstr + * @param bool $blank1stItem + * @param bool $multiple + * @param int $size + * @param string $selectAttr + * + * @return string HTML + */ +function _adodb_getmenu_select($name, $defstr = '', $blank1stItem = true, + $multiple = false, $size = 0, $selectAttr = '') +{ + if ($multiple || is_array($defstr)) { + if ($size == 0 ) { + $size = 5; + } + $attr = ' multiple size="' . $size . '"'; + if (!strpos($name,'[]')) { + $name .= '[]'; + } + } elseif ($size) { + $attr = ' size="' . $size . '"'; + } else { + $attr = ''; + } + $html = '<select name="' . $name . '"' . $attr . ' ' . $selectAttr . '>'; + if ($blank1stItem) { + if (is_string($blank1stItem)) { + $barr = explode(':',$blank1stItem); + if (sizeof($barr) == 1) { + $barr[] = ''; + } + $html .= "\n<option value=\"" . $barr[0] . "\">" . $barr[1] . "</option>"; + } else { + $html .= "\n<option></option>"; + } + } + + return $html; +} + +/** + * Print the OPTION tags for getmenu functions. + * + * ADOdb internal function, used by _adodb_getmenu() and _adodb_getmenu_gp(). + * + * @param string $defstr Default values + * @param string $compare Value to compare against defaults + * @param string $value Ready-to-print `value="xxx"` (or empty) string + * @param string $display Display value + * + * @return string HTML + */ +function _adodb_getmenu_option($defstr, $compare, $value, $display) +{ + if ( is_array($defstr) && in_array($compare, $defstr) + || !is_array($defstr) && strcasecmp($compare, $defstr) == 0 + ) { + $selected = ' selected="selected"'; + } else { + $selected = ''; + } + + return "\n<option $value$selected>" . htmlspecialchars($display) . '</option>'; +} + /* Count the number of records this sql statement will return by using query rewriting heuristics... @@ -416,7 +422,12 @@ } 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)"; @@ -430,7 +441,7 @@ } // fix by alexander zhukov, alex#unipack.ru, because count(*) and 'order by' fails // with mssql, access and postgresql. Also a good speedup optimization - skips sorting! - // also see http://phplens.com/lens/lensforum/msgs.php?id=12752 + // also see PHPLens Issue No: 12752 $rewritesql = adodb_strip_order_by($rewritesql); } @@ -766,7 +777,7 @@ 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); Modified: trunk/lib/WikiDB/adodb/adodb-memcache.lib.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb-memcache.lib.inc.php 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/adodb-memcache.lib.inc.php 2020-12-26 16:01:39 UTC (rev 10206) @@ -11,7 +11,7 @@ /* - @version v5.20.9 21-Dec-2016 + @version v5.20.19 13-Dec-2020 @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 @@ 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: Modified: trunk/lib/WikiDB/adodb/adodb-pager.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb-pager.inc.php 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/adodb-pager.inc.php 2020-12-26 16:01:39 UTC (rev 10206) @@ -1,7 +1,7 @@ <?php /* - @version v5.20.9 21-Dec-2016 + @version v5.20.19 13-Dec-2020 @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. Modified: trunk/lib/WikiDB/adodb/adodb-pear.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb-pear.inc.php 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/adodb-pear.inc.php 2020-12-26 16:01:39 UTC (rev 10206) @@ -1,6 +1,6 @@ <?php /** - * @version v5.20.9 21-Dec-2016 + * @version v5.20.19 13-Dec-2020 * @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 @@ */ 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); } Modified: trunk/lib/WikiDB/adodb/adodb-perf.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb-perf.inc.php 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/adodb-perf.inc.php 2020-12-26 16:01:39 UTC (rev 10206) @@ -1,6 +1,6 @@ <?php /* -@version v5.20.9 21-Dec-2016 +@version v5.20.19 13-Dec-2020 @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 @@ 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 @@ 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 @@ 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 @@ 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>' : '', @@ -764,7 +767,6 @@ echo $this->Tables(); break; } global $ADODB_vers; - echo "<p><div align=center><font size=1>$ADODB_vers Sponsored by <a href=http://phplens.com/>phpLens</a></font></div>"; } /* Modified: trunk/lib/WikiDB/adodb/adodb-php4.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb-php4.inc.php 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/adodb-php4.inc.php 2020-12-26 16:01:39 UTC (rev 10206) @@ -1,7 +1,7 @@ <?php /* - @version v5.20.9 21-Dec-2016 + @version v5.20.19 13-Dec-2020 @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. Modified: trunk/lib/WikiDB/adodb/adodb-time.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb-time.inc.php 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/adodb-time.inc.php 2020-12-26 16:01:39 UTC (rev 10206) @@ -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.19 13-Dec-2020 @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved. @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community @@ -65,14 +66,7 @@ jackbbs, which includes adodb_mktime, adodb_get_gmt_diff, adodb_is_leap_year and originally found at http://www.php.net/manual/en/function.mktime.php -============================================================================= -BUG REPORTS - -These should be posted to the ADOdb forums at - - http://phplens.com/lens/lensforum/topics.php?id=4 - ============================================================================= FUNCTION DESCRIPTIONS @@ -347,7 +341,7 @@ - 9 Aug 2003 0.10 Fixed bug with dates after 2038. -See http://phplens.com/lens/lensforum/msgs.php?id=6980 +See PHPLens Issue No: 6980 - 1 July 2003 0.09 Added support for Q (Quarter). @@ -420,6 +414,9 @@ 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 +813,7 @@ if ($marr[$m] < $d) return false; - if ($y < 1000 && $y > 3000) return false; + if ($y < 1000 || $y > 3000) return false; return true; } @@ -829,13 +826,23 @@ 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); @@ -1375,7 +1382,7 @@ $sep = substr($tstr,2,1); $hasAM = strrpos($tstr,'M') !== false; */ - # see http://phplens.com/lens/lensforum/msgs.php?id=14865 for reasoning, and changelog for version 0.24 + # see PHPLens Issue No: 14865 for reasoning, and changelog for version 0.24 $dstr = gmstrftime('%x',31366800); // 30 Dec 1970, 1 am $sep = substr($dstr,2,1); $tstr = strtoupper(gmstrftime('%X',31366800)); // 30 Dec 1970, 1 am @@ -1460,3 +1467,16 @@ $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; +} Modified: trunk/lib/WikiDB/adodb/adodb-xmlschema.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb-xmlschema.inc.php 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/adodb-xmlschema.inc.php 2020-12-26 16:01:39 UTC (rev 10206) @@ -1305,8 +1305,9 @@ 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 @@ * @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 ); + } } } Modified: trunk/lib/WikiDB/adodb/adodb-xmlschema03.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb-xmlschema03.inc.php 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/adodb-xmlschema03.inc.php 2020-12-26 16:01:39 UTC (rev 10206) @@ -1409,8 +1409,9 @@ 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 @@ * @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 ); + } } } Modified: trunk/lib/WikiDB/adodb/adodb.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb.inc.php 2020-12-26 12:48:06 UTC (rev 10205) +++ trunk/lib/WikiDB/adodb/adodb.inc.php 2020-12-26 16:01:39 UTC (rev 10206) @@ -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.19 13-Dec-2020 @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')) { @@ -224,15 +221,10 @@ } } - - // 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. - srand(((double)microtime())*1000000); - /** * ADODB version as a string. */ - $ADODB_vers = 'v5.20.9 21-Dec-2016'; + $ADODB_vers = 'v5.20.17 31-Mar-2020'; /** * Determines whether recordset->RecordCount() is used. @@ -310,8 +302,8 @@ //print "Errorno ($fn errno=$errno m=$errmsg) "; $thisConnection->_transOK = false; if ($thisConnection->_oldRaiseFn) { - $fn = $thisConnection->_oldRaiseFn; - $fn($dbms, $fn, $errno, $errmsg, $p1, $p2,$thisConnection); + $errfn = $thisConnection->_oldRaiseFn; + $errfn($dbms, $fn, $errno, $errmsg, $p1, $p2,$thisConnection); } } @@ -431,6 +423,7 @@ 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 +626,26 @@ } /** + * 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 * * @param [argHostname] Host to connect to @@ -647,9 +660,9 @@ 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; } @@ -730,9 +743,9 @@ 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; } @@ -1163,8 +1176,7 @@ foreach($inputarr as $arr) { $sql = ''; $i = 0; - //Use each() instead of foreach to reduce memory usage -mikefedyk - while(list(, $v) = each($arr)) { + foreach ($arr as $v) { $sql .= $sqlarr[$i]; // from Ron Baldwin <ron.baldwin#sourceprose.com> // Only quote string types @@ -1497,6 +1509,9 @@ * @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 +1526,7 @@ // 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 +1536,10 @@ 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 +2407,7 @@ */ function Close() { $rez = $this->_close(); + $this->_queryID = false; $this->_connectionID = false; return $rez; } @@ -3039,6 +3055,61 @@ 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 @@ -3315,65 +3386,121 @@ /** - * Generate a SELECT tag string from a recordset, and return the string. - * If the recordset has 2 cols, we treat the 1st col as the containing - * the text to display to the user, and 2nd col as the return value. Default - * strings are compared with the FIRST column. + * Generate a SELECT tag from a recordset, and return the HTML markup. * - * @param name name of SELECT tag - * @param [defstr] the value to hilite. Use an array for multiple hilites for listbox. - * @param [blank1stItem] true to leave the 1st item in list empty - * @param [multiple] true for listbox, false for popup - * @param [size] #rows to show for listbox. not used by popup - * @param [selectAttr] additional attributes to defined for SELECT tag. - * useful for holding javascript onChange='...' handlers. - & @param [compareFields0] when we have 2 cols in recordset, we compare the defstr with - * column 0 (1st col) if this is true. This is not documented. + * If the recordset has 2 columns, we treat the first one as the text to + * display to the user, and the second as the return value. Extra columns + * are discarded. * - * @return HTML + * @param string $name Name of SELECT tag + * @param string|array $defstr The value to highlight. Use an array for multiple highlight values. + * @param bool|string $blank1stItem True to create an empty item (default), False not to add one; + * 'string' to set its label and 'value:string' to assign a value to it. + * @param bool $multiple True for multi-select list + * @param int $size Number of rows to show (applies to multi-select box only) + * @param string $selectAttr Additional attributes to defined for SELECT tag, + * useful for holding javascript onChange='...' handlers, CSS class, etc. + * @param bool $compareFirstCol When true (default), $defstr is compared against the value (column 2), + * while false will compare against the description (column 1). * - * changes by gle...@cc... to support multiple hilited items + * @return string HTML */ - function GetMenu($name,$defstr='',$blank1stItem=true,$multiple=false, - $size=0, $selectAttr='',$compareFields0=true) + function getMenu($name, $defstr = '', $blank1stItem = true, $multiple = false, + $size = 0, $selectAttr = '', $compareFirstCol = true) { global $ADODB_INCLUDED_LIB; if (empty($ADODB_INCLUDED_LIB)) { include(ADODB_DIR.'/adodb-lib.inc.php'); } - return _adodb_getmenu($this, $name,$defstr,$blank1stItem,$multiple, - $size, $selectAttr,$compareFields0); + return _adodb_getmenu($this, $name, $defstr, $blank1stItem, $multiple, + $size, $selectAttr, $compareFirstCol); } - - /** - * Generate a SELECT tag string from a recordset, and return the string. - * If the recordset has 2 cols, we treat the 1st col as the containing - * the text to display to the user, and 2nd col as the return value. Default - * strings are compared with the SECOND column. + * Generate a SELECT tag with groups from a recordset, and return the HTML markup. * + * The recordset must have 3 columns and be ordered by the 3rd column. The + * first column contains the text to display to the user, the second is the + * return value and the third is the option group. Extra columns are discarded. + * Default strings are compared with the SECOND column. + * + * @param string $name Name of SELECT tag + * @param string|array $defstr The value to highlight. Use an array for multiple highlight values. + * @param bool|string $blank1stItem True to create an empty item (default), False not to add one; + * 'string' to set its label and 'value:string' to assign a value to it. + * @param bool $multiple True for multi-select list + * @param int $size Number of rows to show (applies to multi-select box only) + * @param string $selectAttr Additional attributes to defined for SELECT tag, + * useful for holding javascript onChange='...' handlers, CSS class, etc. + * @param bool $compareFirstCol When true (default), $defstr is compared against the value (column 2), + * while false will compare against the description (column 1). + * + * @return string HTML */ - function GetMenu2($name,$defstr='',$blank1stItem=true,$multiple=false,$size=0, $selectAttr='') { - return $this->GetMenu($name,$defstr,$blank1stItem,$multiple, - $size, $selectAttr,false); - } - - /* - Grouped Menu - */ - function GetMenu3($name,$defstr='',$blank1stItem=true,$multiple=false, - $size=0, $selectAttr='') + function getMenuGrouped($name, $defstr = '', $blank1stItem = true, $multiple = false, + $size = 0, $selectAttr = '', $compareFirstCol = true) { global $ADODB_INCLUDED_LIB; if (empty($ADODB_INCLUDED_LIB)) { include(ADODB_DIR.'/adodb-lib.inc.php'); } - return _adodb_getmenu_gp($this, $name,$defstr,$blank1stItem,$multiple, + return _adodb_getmenu_gp($this, $name, $defstr, $blank1stItem, $multiple, + $size, $selectAttr, $compareFirstCol); + } + + /** + * Generate a SELECT tag from a recordset, and return the HTML markup. + * + * Same as GetMenu(), except that default strings are compared with the + * FIRST column (the description). + * + * @param string $name Name of SELECT tag + * @param string|array $defstr The value to highlight. Use an array for multiple highlight values. + * @param bool|string $blank1stItem True to create an empty item (default), False not to add one; + * 'string' to set its label and 'value:string' to assign a value to it. + * @param bool $multiple True for multi-select list + * @param int $size Number of rows to show (applies to multi-select box only) + * @param string $selectAttr Additional attributes to defined for SELECT tag, + * useful for holding javascript onChange='...' handlers, CSS class, etc. + * + * @return string HTML + * + * @deprecated 5.21.0 Use getMenu() with $compareFirstCol = false instead. + */ + function getMenu2($name, $defstr = '', $blank1stItem = true, $multiple = false, + $size = 0, $selectAttr = '') + { + return $this->getMenu($name, $defstr, $blank1stItem, $multiple, $size, $selectAttr,false); } /** + * Generate a SELECT tag with groups from a recordset, and return the HTML ma... [truncated message content] |