diff options
192 files changed, 3952 insertions, 4618 deletions
diff --git a/adodb-active-record.inc.php b/adodb-active-record.inc.php index 8f3b0053..a5d0c258 100644 --- a/adodb-active-record.inc.php +++ b/adodb-active-record.inc.php @@ -1,25 +1,23 @@ <?php -/** - * Active Record implementation. Superset of Zend Framework's. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* + +@version v5.22.0-dev Unreleased +@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 https://adodb.org/ + + 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. + + Active Record implementation. Superset of Zend Framework's. + + Version 0.92 + + See http://www-128.ibm.com/developerworks/java/library/j-cb03076/?ca=dgr-lnxw01ActiveRecord + for info on Ruby on Rails Active Record implementation +*/ -include_once(ADODB_DIR.'/adodb-lib.inc.php'); global $_ADODB_ACTIVE_DBS; global $ADODB_ACTIVE_CACHESECS; // set to true to enable caching of metadata such as field info @@ -76,9 +74,10 @@ function ADODB_SetDatabaseAdapter(&$db, $index=false) class ADODB_Active_Record { static $_changeNames = true; // dynamically pluralize table names - - /** @var bool|string Allows override of global $ADODB_QUOTE_FIELDNAMES */ - public $_quoteNames; + /* + * Optional parameter that duplicates the ADODB_QUOTE_FIELDNAMES + */ + static $_quoteNames = false; static $_foreignSuffix = '_id'; // var $_dbat; // associative index pointing to ADODB_Active_DB eg. $ADODB_Active_DBS[_dbat] @@ -118,12 +117,7 @@ class ADODB_Active_Record { // php5 constructor function __construct($table = false, $pkeyarr=false, $db=false) { - global $_ADODB_ACTIVE_DBS, $ADODB_QUOTE_FIELDNAMES; - - // Set the local override for field quoting, only if not defined yet - if (!isset($this->_quoteNames)) { - $this->_quoteNames = $ADODB_QUOTE_FIELDNAMES; - } + global $_ADODB_ACTIVE_DBS; if ($db == false && is_object($pkeyarr)) { $db = $pkeyarr; @@ -886,7 +880,7 @@ class ADODB_Active_Record { $cnt += 1; } } - + $tableName = $this->nameQuoter($db,$this->_table); $sql = sprintf('INSERT INTO %s (%s) VALUES (%s)', $tableName, @@ -925,7 +919,7 @@ class ADODB_Active_Record { $where = $this->GenWhere($db,$table); $tableName = $this->nameQuoter($db,$this->_table); - + $sql = sprintf('DELETE FROM %s WHERE %s', $tableName, $where @@ -1001,19 +995,19 @@ class ADODB_Active_Record { } break; } - + $newArr = array(); foreach($arr as $k=>$v) $newArr[$this->nameQuoter($db,$k)] = $v; $arr = $newArr; - + $newPkey = array(); foreach($pkey as $k=>$v) $newPkey[$k] = $this->nameQuoter($db,$v); $pkey = $newPkey; - + $tableName = $this->nameQuoter($db,$this->_table); - + $ok = $db->Replace($tableName,$arr,$pkey); if ($ok) { $this->_saved = true; // 1= update 2=insert @@ -1101,7 +1095,7 @@ class ADODB_Active_Record { $tableName, implode(',',$pairs), $where); - + $ok = $db->Execute($sql,$valarr); if ($ok) { $this->_original = $neworig; @@ -1120,27 +1114,62 @@ class ADODB_Active_Record { } /** - * Quotes the table, column and field names. - * - * This honours the internal {@see $_quoteNames} property, which overrides - * the global $ADODB_QUOTE_FIELDNAMES directive. - * - * @param ADOConnection $db The database connection - * @param string $name The table or column name to quote - * - * @return string The quoted name - */ - private function nameQuoter($db, $name) + * Quotes the table and column and field names + * + * this honours the ADODB_QUOTE_FIELDNAMES directive. The routines that + * use it should really just call _adodb_getinsertsql and _adodb_getupdatesql + * which is a nice easy project if you are interested + * + * @param obj $db The database connection + * @param string $name The table or column name to quote + * + * @return string The quoted name + */ + private function nameQuoter($db,$string) { global $ADODB_QUOTE_FIELDNAMES; - - $save = $ADODB_QUOTE_FIELDNAMES; - $ADODB_QUOTE_FIELDNAMES = $this->_quoteNames; - - $string = _adodb_quote_fieldname($db, $name); - - $ADODB_QUOTE_FIELDNAMES = $save; - + + if (!$ADODB_QUOTE_FIELDNAMES && !$this->_quoteNames) + /* + * Nothing to be done + */ + return $string; + + if ($this->_quoteNames == 'NONE') + /* + * Force no quoting when ADODB_QUOTE_FIELDNAMES is set + */ + return $string; + + if ($this->_quoteNames) + /* + * Internal setting takes precedence + */ + $quoteMethod = $this->_quoteNames; + + else + $quoteMethod = $ADODB_QUOTE_FIELDNAMES; + + switch ($quoteMethod) + { + case 'LOWER': + $string = strtolower($string); + break; + case 'NATIVE': + /* + * Nothing to be done + */ + break; + case 'UPPER': + default: + $string = strtoupper($string); + } + + $string = sprintf( '%s%s%s', + $db->nameQuote, + $string, + $db->nameQuote + ); return $string; } @@ -1153,7 +1182,7 @@ global $_ADODB_ACTIVE_DBS; $save = $db->SetFetchMode(ADODB_FETCH_NUM); - + $qry = "select * from ".$table; if (!empty($whereOrderBy)) { diff --git a/adodb-active-recordx.inc.php b/adodb-active-recordx.inc.php index 5de5b130..94a6fd05 100644 --- a/adodb-active-recordx.inc.php +++ b/adodb-active-recordx.inc.php @@ -1,27 +1,27 @@ <?php -/** - * Active Record implementation. Superset of Zend Framework's. - * - * This is "Active Record eXtended" to support JOIN, WORK and LAZY mode - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* -// CFR: Active Records Definitions +@version v5.22.0-dev Unreleased +@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 https://adodb.org/ + + 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. + + Active Record implementation. Superset of Zend Framework's. + + This is "Active Record eXtended" to support JOIN, WORK and LAZY mode by Chris Ravenscroft chris#voilaweb.com + + Version 0.9 + + See http://www-128.ibm.com/developerworks/java/library/j-cb03076/?ca=dgr-lnxw01ActiveRecord + for info on Ruby on Rails Active Record implementation +*/ + + + // CFR: Active Records Definitions define('ADODB_JOIN_AR', 0x01); define('ADODB_WORK_AR', 0x02); define('ADODB_LAZY_AR', 0x03); diff --git a/adodb-csvlib.inc.php b/adodb-csvlib.inc.php index c81254bf..7dee8f7c 100644 --- a/adodb-csvlib.inc.php +++ b/adodb-csvlib.inc.php @@ -1,26 +1,4 @@ <?php -/** - * Library for CSV serialization. - * - * This is used by the csv/proxy driver and is the CacheExecute() - * serialization format. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -28,6 +6,22 @@ if (!defined('ADODB_DIR')) die(); global $ADODB_INCLUDED_CSV; $ADODB_INCLUDED_CSV = 1; +/* + + @version v5.22.0-dev Unreleased + @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 https://adodb.org/ + + Library for CSV serialization. This is used by the csv/proxy driver and is the + CacheExecute() serialization format. +*/ + /** * convert a recordset into special format * @@ -83,19 +77,19 @@ $ADODB_INCLUDED_CSV = 1; return $line.serialize($rs2); } - -/** -* Open CSV file and convert it into Data. -* -* @param url file/ftp/http url -* @param err returns the error message -* @param timeout dispose if recordset has been alive for $timeout secs -* -* @return recordset, or false if error occurred. If no -* error occurred in sql INSERT/UPDATE/DELETE, -* empty recordset is returned -*/ - function csv2rs($url,&$err,$timeout=0, $rsclass='ADORecordSet_array') + /** + * Open CSV file and convert it into Data. + * + * @param string $url file/ftp/http url + * @param string &$err returns the error message + * @param int $timeout dispose if recordset has been alive for $timeout secs + * @param string $rsclass RecordSet class to return + * + * @return ADORecordSet|false recordset, or false if error occurred. + * If no error occurred in sql INSERT/UPDATE/DELETE, + * empty recordset is returned. + */ + function csv2rs($url, &$err, $timeout=0, $rsclass='ADORecordSet_array') { $false = false; $err = false; diff --git a/adodb-datadict.inc.php b/adodb-datadict.inc.php index dbed95da..f2d7e4d2 100644 --- a/adodb-datadict.inc.php +++ b/adodb-datadict.inc.php @@ -1,30 +1,27 @@ <?php + /** - * ADOdb Data Dictionary base class. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4 for best viewing. + + DOCUMENTATION: + + See adodb/tests/test-datadict.php for docs and examples. +*/ + +/* + Test script for parser +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); -/** - * Test script for parser - */ function lens_ParseTest() { $str = "`zcol ACOL` NUMBER(32,2) DEFAULT 'The \"cow\" (and Jim''s dog) jumps over the moon' PRIMARY, INTI INT AUTO DEFAULT 0, zcol2\"afs ds"; @@ -427,6 +424,15 @@ class ADODB_DataDict { function actualType($meta) { + $meta = strtoupper($meta); + + /* + * Add support for custom meta types. We do this + * first, that allows us to override existing types + */ + if (isset($this->connection->customMetaTypes[$meta])) + return $this->connection->customMetaTypes[$meta]['actual']; + return $meta; } @@ -695,16 +701,25 @@ class ADODB_DataDict { case '0': case 'NAME': $fname = $v; break; case '1': - case 'TYPE': $ty = $v; $ftype = $this->actualType(strtoupper($v)); break; + case 'TYPE': + + $ty = $v; + $ftype = $this->actualType(strtoupper($v)); + break; case 'SIZE': - $dotat = strpos($v,'.'); if ($dotat === false) $dotat = strpos($v,','); - if ($dotat === false) $fsize = $v; - else { - $fsize = substr($v,0,$dotat); - $fprec = substr($v,$dotat+1); - } - break; + $dotat = strpos($v,'.'); + if ($dotat === false) + $dotat = strpos($v,','); + if ($dotat === false) + $fsize = $v; + else { + + $fsize = substr($v,0,$dotat); + $fprec = substr($v,$dotat+1); + + } + break; case 'UNSIGNED': $funsigned = true; break; case 'AUTOINCREMENT': case 'AUTO': $fautoinc = true; $fnotnull = true; break; diff --git a/adodb-error.inc.php b/adodb-error.inc.php index 517cf9b0..a05e904b 100644 --- a/adodb-error.inc.php +++ b/adodb-error.inc.php @@ -1,27 +1,19 @@ <?php /** - * Error handling code and constants. + * @version v5.22.0-dev Unreleased + * @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. * - * Adapted from the PEAR DB error handling code. - * Portions (c)1997-2002 The PHP Group + * Set tabs to 4 for best viewing. * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community + * The following code is adapted from the PEAR DB error handling code. + * Portions (c)1997-2002 The PHP Group. */ + if (!defined("DB_ERROR")) define("DB_ERROR",-1); if (!defined("DB_ERROR_SYNTAX")) { diff --git a/adodb-errorhandler.inc.php b/adodb-errorhandler.inc.php index 0cd3f218..cb59c9e3 100644 --- a/adodb-errorhandler.inc.php +++ b/adodb-errorhandler.inc.php @@ -1,23 +1,18 @@ <?php /** - * ADOdb Default Error Handler. + * @version v5.22.0-dev Unreleased + * @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. * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. + * Set tabs to 4 for best viewing. * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker + * Latest version is available at https://adodb.org/ * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +*/ + // added Claudio Bustos clbustos#entelchile.net if (!defined('ADODB_ERROR_HANDLER_TYPE')) define('ADODB_ERROR_HANDLER_TYPE',E_USER_ERROR); diff --git a/adodb-errorpear.inc.php b/adodb-errorpear.inc.php index 2bb15947..47404822 100644 --- a/adodb-errorpear.inc.php +++ b/adodb-errorpear.inc.php @@ -1,24 +1,17 @@ <?php /** - * Error Handler with PEAR support. + * @version v5.22.0-dev Unreleased + * @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. * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. + * Set tabs to 4 for best viewing. * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker + * Latest version is available at https://adodb.org/ * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ - +*/ include_once('PEAR.php'); if (!defined('ADODB_ERROR_HANDLER')) define('ADODB_ERROR_HANDLER','ADODB_Error_PEAR'); diff --git a/adodb-exceptions.inc.php b/adodb-exceptions.inc.php index 9f1176f0..dddbfc66 100644 --- a/adodb-exceptions.inc.php +++ b/adodb-exceptions.inc.php @@ -1,24 +1,21 @@ <?php + /** - * Error handling using Exceptions. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. + * @version v5.22.0-dev Unreleased + * @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. * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker + * Set tabs to 4 for best viewing. * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later + * Latest version is available at https://adodb.org/ * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community + * Exception-handling code using PHP5 exceptions (try-catch-throw). */ + if (!defined('ADODB_ERROR_HANDLER_TYPE')) define('ADODB_ERROR_HANDLER_TYPE',E_USER_ERROR); define('ADODB_ERROR_HANDLER','adodb_throw'); diff --git a/adodb-iterator.inc.php b/adodb-iterator.inc.php new file mode 100644 index 00000000..a5903a74 --- /dev/null +++ b/adodb-iterator.inc.php @@ -0,0 +1,26 @@ +<?php + +/* + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4. + + Declares the ADODB Base Class for PHP5 "ADODB_BASE_RS", and supports iteration with + the ADODB_Iterator class. + + $rs = $db->Execute("select * from adoxyz"); + foreach($rs as $k => $v) { + echo $k; print_r($v); echo "<br>"; + } + + + Iterator code based on http://cvs.php.net/cvs.php/php-src/ext/spl/examples/cachingiterator.inc?login=2 + + + Moved to adodb.inc.php to improve performance. + */ diff --git a/adodb-lib.inc.php b/adodb-lib.inc.php index ced5e126..35e9eca5 100644 --- a/adodb-lib.inc.php +++ b/adodb-lib.inc.php @@ -1,32 +1,22 @@ <?php -/** - * Helper functions. - * - * Less commonly used functions are placed here to reduce size of adodb.inc.php. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ - // security - hide paths if (!defined('ADODB_DIR')) die(); global $ADODB_INCLUDED_LIB; $ADODB_INCLUDED_LIB = 1; +/* + @version v5.21.1-dev Unreleased + @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. + + Less commonly used functions are placed here to reduce size of adodb.inc.php. +*/ + function adodb_strip_order_by($sql) { $rez = preg_match_all('/(\sORDER\s+BY\s(?:[^)](?!LIMIT))*)/is', $sql, $arr); @@ -673,50 +663,10 @@ function _adodb_pageexecute_no_last_page(&$zthis, $sql, $nrows, $page, $inputarr return $rsreturn; } -/** - * Performs case conversion and quoting of the given field name. - * - * See Global variable $ADODB_QUOTE_FIELDNAMES. - * - * @param ADOConnection $zthis - * @param string $fieldName - * - * @return string Quoted field name - */ -function _adodb_quote_fieldname($zthis, $fieldName) +function _adodb_getupdatesql(&$zthis, &$rs, $arrFields, $forceUpdate=false, $force=2) { global $ADODB_QUOTE_FIELDNAMES; - // Case conversion - defaults to UPPER - $case = is_bool($ADODB_QUOTE_FIELDNAMES) ? 'UPPER' : $ADODB_QUOTE_FIELDNAMES; - switch ($case) { - case 'LOWER': - $fieldName = strtolower($fieldName); - break; - case 'NATIVE': - // Do nothing - break; - case 'UPPER': - case 'BRACKETS': - default: - $fieldName = strtoupper($fieldName); - break; - } - - // Quote field if requested, or necessary (field contains space) - if ($ADODB_QUOTE_FIELDNAMES || strpos($fieldName, ' ') !== false ) { - if ($ADODB_QUOTE_FIELDNAMES === 'BRACKETS') { - return $zthis->leftBracket . $fieldName . $zthis->rightBracket; - } else { - return $zthis->nameQuote . $fieldName . $zthis->nameQuote; - } - } else { - return $fieldName; - } -} - -function _adodb_getupdatesql(&$zthis, &$rs, $arrFields, $forceUpdate=false, $force=2) -{ if (!$rs) { printf(ADODB_BAD_RS,'GetUpdateSQL'); return false; @@ -762,7 +712,21 @@ function _adodb_getupdatesql(&$zthis, &$rs, $arrFields, $forceUpdate=false, $for $type = 'C'; } - $fnameq = _adodb_quote_fieldname($zthis, $field->name); + if ((strpos($upperfname,' ') !== false) || ($ADODB_QUOTE_FIELDNAMES)) { + switch ($ADODB_QUOTE_FIELDNAMES) { + case 'BRACKETS': + $fnameq = $zthis->leftBracket.$upperfname.$zthis->rightBracket;break; + 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; + } //********************************************************// if (is_null($arrFields[$upperfname]) @@ -888,6 +852,7 @@ function _adodb_getinsertsql(&$zthis, &$rs, $arrFields, $force=2) static $cacheRS = false; static $cacheSig = 0; static $cacheCols; + global $ADODB_QUOTE_FIELDNAMES; $tableName = ''; $values = ''; @@ -938,7 +903,21 @@ static $cacheCols; $upperfname = strtoupper($field->name); if (adodb_key_exists($upperfname,$arrFields,$force)) { $bad = false; - $fnameq = _adodb_quote_fieldname($zthis, $field->name); + if ((strpos($upperfname,' ') !== false) || ($ADODB_QUOTE_FIELDNAMES)) { + switch ($ADODB_QUOTE_FIELDNAMES) { + case 'BRACKETS': + $fnameq = $zthis->leftBracket.$upperfname.$zthis->rightBracket;break; + 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); /********************************************************/ diff --git a/adodb-loadbalancer.inc.php b/adodb-loadbalancer.inc.php index 2e4f3928..777c7f56 100644 --- a/adodb-loadbalancer.inc.php +++ b/adodb-loadbalancer.inc.php @@ -8,20 +8,20 @@ * including dealing with connection failures and retrying queries on a different * connection instead. * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. + * 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.md. * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker + * Latest version is available at https://adodb.org/ * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2016 Mike Benoit and the ADOdb community + * @package ADOdb + * @version v5.22.0-dev Unreleased + * @author Mike Benoit + * @copyright (c) 2016 Mike Benoit and the ADOdb community + * @license BSD-3-Clause + * @license GNU Lesser General Public License (LGPL) v2.1 or later + * @link https://adodb.org/ + * @since v5.21.0 */ /** diff --git a/adodb-memcache.lib.inc.php b/adodb-memcache.lib.inc.php index 7f110e74..be9be1b1 100644 --- a/adodb-memcache.lib.inc.php +++ b/adodb-memcache.lib.inc.php @@ -1,23 +1,4 @@ <?php -/** - * Memory caching. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -26,183 +7,432 @@ global $ADODB_INCLUDED_MEMCACHE; $ADODB_INCLUDED_MEMCACHE = 1; global $ADODB_INCLUDED_CSV; -if (empty($ADODB_INCLUDED_CSV)) include_once(ADODB_DIR.'/adodb-csvlib.inc.php'); +if (empty($ADODB_INCLUDED_CSV)) + include_once(ADODB_DIR.'/adodb-csvlib.inc.php'); +/* - class ADODB_Cache_MemCache { - var $createdir = false; // create caching directory structure? + @version v5.22.0-dev Unreleased + @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. - // $library will be populated with the proper library on connect - // and is used later when there are differences in specific calls - // between memcache and memcached - var $library = false; + Latest version is available at https://adodb.org/ - //----------------------------- - // memcache specific variables - var $hosts; // array of hosts - var $port = 11211; - var $compress = false; // memcache compression with zlib - var $_connected = false; - var $_memcache = false; + Class instance is stored in $ADODB_CACHE +*/ - function __construct(&$obj) +class ADODB_Cache_MemCache +{ + /* + * Prevents parent class calling non-existant function + */ + public $createdir = false; + + /* + * populated with the proper library on connect + * and is used later when there are differences in specific calls + * between memcache and memcached + */ + private $memCacheLibrary = false; + + /* + * array of hosts + */ + private $hosts; + + /* + * Connection Port, uses default + */ + private $port = 11211; + + /* + * memcache compression with zlib + */ + private $compress = false; + + /* + * Array of options for memcached only + */ + private $options = false; + + /* + * Internal flag indicating successful connection + */ + private $isConnected = false; + + /* + * Handle for the Memcache library + */ + private $memcacheLibrary = false; + + /* + * New server feature controller lists available servers + */ + private $serverControllers = array(); + + /* + * New server feature controller uses granular + * server controller + */ + private $serverControllerTemplate = array( + 'host'=>'', + 'port'=>11211, + 'weight'=>0, + 'key'=>'' + ); + + + /* + * An integer index into the libraries + */ + const MCLIB = 1; + const MCLIBD = 2; + + /* + * Xrefs the library flag to the actual class name + */ + private $libraries = array( + 1=>'Memcache', + 2=>'Memcached' + ); + + /* + * An indicator of which library we are using + */ + private $libraryFlag; + + /** + * constructor passes in a ADONewConnection Object + * + * @param $db ADONewConnection object + * + * @return obj + */ + public function __construct(&$db) + { + $this->hosts = $db->memCacheHost; + $this->port = $db->memCachePort; + $this->compress = $db->memCacheCompress; + $this->options = $db->memCacheOptions; + + } + + /** + * implement as lazy connection. The connection only occurs on CacheExecute call + * + * @param string $err + * + * @return bool success of connecting to a server + */ + public function connect(&$err) + { + /* + * do we have memcache or memcached? see the note + * at adodb.org on memcache + */ + if (class_exists('Memcache')) + $this->libraryFlag = self::MCLIB; + elseif (class_exists('Memcached')) + $this->libraryFlag = self::MCLIB; + else { - $this->hosts = $obj->memCacheHost; - $this->port = $obj->memCachePort; - $this->compress = $obj->memCacheCompress; + $err = 'Neither the Memcache nor Memcached PECL extensions were found!'; + return false; } - - // implement as lazy connection. The connection only occurs on CacheExecute call - function connect(&$err) + + $usedLibrary = $this->libraries[$this->libraryFlag]; + + $this->memCacheLibrary = new $usedLibrary; + if (!$this->memcacheLibrary) + { + $err = 'Memcache library failed to initialize'; + return false; + } + + /* + * Convert simple compression flag for memcached + */ + if ($this->libraryFlag == self::MCLIBD && $this->compress) { - // do we have memcache or memcached? - if (class_exists('Memcache')) { - $this->library='Memcache'; - $memcache = new MemCache; - } elseif (class_exists('Memcached')) { - $this->library='Memcached'; - $memcache = new MemCached; - } else { - $err = 'Neither the Memcache nor Memcached PECL extensions were found!'; + /* + * Value of Memcached::OPT_COMPRESSION = 2; + */ + $this->options[2] == 1; + } + /* + * Are there any options available for memcached + */ + if ($this->libraryFlag == self::MCLIBD && count($this->options) > 0) + { + $optionSuccess = $this->memCacheLibrary->setOptions($this->options); + if (!$optionSuccess) + { + $err = 'Invalid option parameters passed to Memecached'; return false; } - - if (!is_array($this->hosts)) $this->hosts = array($this->hosts); - - $failcnt = 0; - foreach($this->hosts as $host) { - if (!@$memcache->addServer($host,$this->port)) { - $failcnt += 1; - } + } + + /* + * Have we passed a controller array + */ + if (!is_array($this->hosts)) + $this->hosts = array($this->hosts); + + if (array_values($this->hosts) == $this->hosts) + { + /* + * Old way, convert to controller + */ + foreach ($this->hosts as $ipAddress) + { + $connector = $this->serverControllerTemplate; + + $connector['host'] = $ipAddress; + $connector['port'] = $this->port; + + $this->serverControllers[] = $connector; } - if ($failcnt == sizeof($this->hosts)) { - $err = 'Can\'t connect to any memcache server'; - return false; + } + else + { + /* + * New way, must validate port, etc + */ + foreach ($this->hosts as $controller) + { + $connector = array_merge($this->serverControllerTemplate,$controller); + if ($this->libraryFlag == self::MCLIB) + { + /* + * Cannot use a key or weight in memcache, simply discard + */ + $connector['key'] = ''; + $connector['weight'] = 0; + + } + else + $connector['weight'] = $connector['weight'] ? (int)$connector['weight']:0; + + $this->serverControllers[] = $connector; } - $this->_connected = true; - $this->_memcache = $memcache; - return true; } - // returns true or false. true if successful save - function writecache($filename, $contents, $debug, $secs2cache) + /* + * Checks for existing connections ( but only for memcached ) + */ + if ($this->libraryFlag == self::MCLIBD) { - if (!$this->_connected) { - $err = ''; - if (!$this->connect($err) && $debug) ADOConnection::outp($err); + $existingServers = $memCache->getServerList(); + if (is_array($existingServers)) + { + /* + * Use the existing configuration + */ + $this->isConnected = true; + $this->memcacheLibrary = $memcache; + return true; } - if (!$this->_memcache) return false; - - $failed=false; - switch ($this->library) { - case 'Memcache': - if (!$this->_memcache->set($filename, $contents, $this->compress ? MEMCACHE_COMPRESSED : 0, $secs2cache)) { - $failed=true; - } - break; - case 'Memcached': - if (!$this->_memcache->set($filename, $contents, $secs2cache)) { - $failed=true; - } - break; + } + $failcnt = 0; + foreach($this->serverControllers as $controller) + { + switch($this->libraryFlag) + { + case self::MCLIB: + if (!@$this->memcacheLibrary->addServer($controller['host'],$controller['port'])) + $failcnt++; + break; default: - $failed=true; - break; - } - - if($failed) { - if ($debug) ADOConnection::outp(" Failed to save data at the memcache server!<br>\n"); - return false; + if (!@$this->memcacheLibrary->addServer($controller['host'],$controller['port'],$controller['weight'])) + $failcnt++; } - - return true; + } - - // returns a recordset - function readcache($filename, &$err, $secs2cache, $rsClass) + if ($failcnt == sizeof($this->serverControllers)) { - $false = false; - if (!$this->_connected) $this->connect($err); - if (!$this->_memcache) return $false; + $err = 'Can\'t connect to any memcache server'; + return false; - $rs = $this->_memcache->get($filename); - if (!$rs) { - $err = 'Item with such key doesn\'t exist on the memcache server.'; - return $false; - } + } + + /* + * A valid memcache connection is available + */ + $this->isConnected = true; + return true; + } - // hack, should actually use _csv2rs - $rs = explode("\n", $rs); - unset($rs[0]); - $rs = join("\n", $rs); - $rs = unserialize($rs); - if (! is_object($rs)) { - $err = 'Unable to unserialize $rs'; - return $false; - } - if ($rs->timeCreated == 0) return $rs; // apparently have been reports that timeCreated was set to 0 somewhere + /** + * Writes a cached query to the server + * + * @param string $filename The MD5 of the query to cache + * @param string $contents The query results + * @param bool $debug + * @param int $secs2cache + * + * @return bool true or false. true if successful save + */ + public function writeCache($filename, $contents, $debug, $secs2cache) + { + $err = ''; + if (!$this->isConnected && $debug) + { + /* + * Call to writecache before connect, try + * to connect + */ + if (!$this->connect($err)) + ADOConnection::outp($err); + } + else if (!$this->isConnected) + $this->connect($err); + + if (!$this->memcacheLibrary) + return false; - $tdiff = intval($rs->timeCreated+$secs2cache - time()); - if ($tdiff <= 2) { - switch($tdiff) { - case 2: - if ((rand() & 15) == 0) { - $err = "Timeout 2"; - return $false; - } - break; - case 1: - if ((rand() & 3) == 0) { - $err = "Timeout 1"; - return $false; - } - break; - default: - $err = "Timeout 0"; - return $false; + $failed=false; + switch ($this->libraryFlag) + { + case self::MCLIB: + if (!$this->memcacheLibrary->set($filename, $contents, $this->compress ? MEMCACHE_COMPRESSED : 0, $secs2cache)) { + $failed=true; } - } - return $rs; + break; + case self::MCLIBD: + if (!$this->memcacheLibrary->set($filename, $contents, $secs2cache)) { + $failed=true; + } + break; + default: + $failed=true; + break; } - function flushall($debug=false) - { - if (!$this->_connected) { - $err = ''; - if (!$this->connect($err) && $debug) ADOConnection::outp($err); - } - if (!$this->_memcache) return false; + if($failed) { + if ($debug) ADOConnection::outp(" Failed to save data at the memcache server!<br>\n"); + return false; + } - $del = $this->_memcache->flush(); + return true; + } - if ($debug) - if (!$del) ADOConnection::outp("flushall: failed!<br>\n"); - else ADOConnection::outp("flushall: succeeded!<br>\n"); + /** + * Reads a cached query to the server + * + * @param string $filename The MD5 of the query to read + * @param string $err The query results + * @param int $secs2cache + * @param obj $rsClass **UNUSED** + + * @return the record or false. + */ + public function readCache($filename, &$err, $secs2cache, $rsClass) + { + if (!$this->isConnected) $this->connect($err); + if (!$this->memcacheLibrary) + return false; - return $del; + $rs = $this->memcacheLibrary->get($filename); + if (!$rs) + { + $err = 'Item with such key doesn\'t exist on the memcache server.'; + return false; } - function flushcache($filename, $debug=false) + // hack, should actually use _csv2rs + $rs = explode("\n", $rs); + unset($rs[0]); + $rs = join("\n", $rs); + $rs = unserialize($rs); + if (! is_object($rs)) { + $err = 'Unable to unserialize $rs'; + return $false; + } + if ($rs->timeCreated == 0) + return $rs; // apparently have been reports that timeCreated was set to 0 somewhere + + $tdiff = intval($rs->timeCreated+$secs2cache - time()); + if ($tdiff <= 2) { - if (!$this->_connected) { - $err = ''; - if (!$this->connect($err) && $debug) ADOConnection::outp($err); + switch($tdiff) + { + case 2: + if ((rand() & 15) == 0) { + $err = "Timeout 2"; + return false; + } + break; + case 1: + if ((rand() & 3) == 0) { + $err = "Timeout 1"; + return false; + } + break; + default: + $err = "Timeout 0"; + return false; } - if (!$this->_memcache) return false; + } + return $rs; + } - $del = $this->_memcache->delete($filename); + /** + * Flushes all of the stored memcache data + * + * @param bool $debug + * + * @return int The response from the memcache server + */ + public function flushAll($debug=false) + { + if (!$this->isConnected) { + $err = ''; + if (!$this->connect($err) && $debug) ADOConnection::outp($err); + } + if (!$this->memcacheLibrary) + return false; - if ($debug) - if (!$del) ADOConnection::outp("flushcache: $key entry doesn't exist on memcache server!<br>\n"); - else ADOConnection::outp("flushcache: $key entry flushed from memcache server!<br>\n"); + $del = $this->memcacheLibrary->flush(); - return $del; - } + if ($debug) + if (!$del) + ADOConnection::outp("flushall: failed!<br>\n"); + else + ADOConnection::outp("flushall: succeeded!<br>\n"); + + return $del; + } - // not used for memcache - function createdir($dir, $hash) + /** + * Flushes the contents of a specified query + * + * @param str $filname The MD5 of the query to flush + * @param bool $debug + * + * @return int The response from the memcache server + */ + public function flushCache($filename, $debug=false) + { + if (!$this->isConnected) { - return true; + $err = ''; + if (!$this->connect($err) && $debug) ADOConnection::outp($err); } + if (!$this->memcacheLibrary) + return false; + + $del = $this->memcacheLibrary->delete($filename); + + if ($debug) + if (!$del) ADOConnection::outp("flushcache: $key entry doesn't exist on memcache server!<br>\n"); + else ADOConnection::outp("flushcache: $key entry flushed from memcache server!<br>\n"); + + return $del; } + +} diff --git a/adodb-pager.inc.php b/adodb-pager.inc.php index cfe981d3..3bea3307 100644 --- a/adodb-pager.inc.php +++ b/adodb-pager.inc.php @@ -1,24 +1,28 @@ <?php -/** - * Recordset pagination with First/Prev/Next/Last links - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* + @version v5.22.0-dev Unreleased + @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. + Set tabs to 4 for best viewing. + + This class provides recordset pagination with + First/Prev/Next/Last links. + + Feel free to modify this class for your own use as + it is very basic. To learn how to use it, see the + example in adodb/tests/testpaging.php. + + "Pablo Costa" <pablo@cbsp.com.br> implemented Render_PageLinks(). + + Please note, this class is entirely unsupported, + and no free support requests except for bug reports + will be entertained by the author. + +*/ class ADODB_Pager { var $id; // unique id for pager (defaults to 'adodb') var $db; // ADODB connection object diff --git a/adodb-pear.inc.php b/adodb-pear.inc.php index c48ef132..404b9e7c 100644 --- a/adodb-pear.inc.php +++ b/adodb-pear.inc.php @@ -1,25 +1,18 @@ <?php /** - * PEAR DB Emulation Layer for ADOdb. + * @version v5.22.0-dev Unreleased + * @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. * - * The following code is modelled on PEAR DB code by Stig Bakken <ssb@fast.no> - * and Tomas V.V.Cox <cox@idecnet.com>. Portions (c)1997-2002 The PHP Group. + * Set tabs to 4 for best viewing. * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. + * PEAR DB Emulation Layer for ADODB. * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community + * The following code is modelled on PEAR DB code by Stig Bakken <ssb@fast.no> | + * and Tomas V.V.Cox <cox@idecnet.com>. Portions (c)1997-2002 The PHP Group. */ /* diff --git a/adodb-perf.inc.php b/adodb-perf.inc.php index d9d8a993..c8a49e35 100644 --- a/adodb-perf.inc.php +++ b/adodb-perf.inc.php @@ -1,23 +1,22 @@ <?php -/** - * performance monitoring and tuning. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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 https://adodb.org/ + + Library for basic performance monitoring and tuning. + + My apologies if you see code mixed with presentation. The presentation suits + my needs. If you want to separate code from presentation, be my guest. Patches + are welcome. + +*/ if (!defined('ADODB_DIR')) include_once(dirname(__FILE__).'/adodb.inc.php'); include_once(ADODB_DIR.'/tohtml.inc.php'); diff --git a/adodb-php4.inc.php b/adodb-php4.inc.php new file mode 100644 index 00000000..827a9866 --- /dev/null +++ b/adodb-php4.inc.php @@ -0,0 +1,16 @@ +<?php + +/* + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4. +*/ + + +class ADODB_BASE_RS { +} diff --git a/adodb-time.inc.php b/adodb-time.inc.php index cfbdc6a5..ee0d262b 100644 --- a/adodb-time.inc.php +++ b/adodb-time.inc.php @@ -1,67 +1,72 @@ <?php -/** - * ADOdb Date Library. - * - * PHP native date functions use integer timestamps for computations. - * Because of this, dates are restricted to the years 1901-2038 on Unix - * and 1970-2038 on Windows due to integer overflow for dates beyond - * those years. This library overcomes these limitations by replacing the - * native function's signed integers (normally 32-bits) with PHP floating - * point numbers (normally 64-bits). - * - * Dates from 100 A.D. to 3000 A.D. and later have been tested. - * The minimum is 100 A.D. as <100 will invoke the 2 => 4 digit year - * conversion. The maximum is billions of years in the future, but this - * is a theoretical limit as the computation of that year would take too - * long with the current implementation of adodb_mktime(). - * - * Replaces native functions as follows: - * - getdate() with adodb_getdate() - * - date() with adodb_date() - * - gmdate() with adodb_gmdate() - * - mktime() with adodb_mktime() - * - gmmktime() with adodb_gmmktime() - * - strftime() with adodb_strftime() - * - strftime() with adodb_gmstrftime() - * - * The parameters are identical, except that adodb_date() accepts a subset - * of date()'s field formats. Mktime() will convert from local time to GMT, - * and date() will convert from GMT to local time, but daylight savings is - * not handled currently. - * - * To improve performance, the native date functions are used whenever - * possible, the library only switches to PHP code when the dates fall outside - * of the 32-bit signed integer range. - * - * This library is independent of the rest of ADOdb, and can be used - * as standalone code. - * - * GREGORIAN CORRECTION - * - * Pope Gregory shortened October of A.D. 1582 by ten days. Thursday, - * October 4, 1582 (Julian) was followed immediately by Friday, October 15, - * 1582 (Gregorian). We handle this correctly, so: - * adodb_mktime(0, 0, 0, 10, 15, 1582) - adodb_mktime(0, 0, 0, 10, 4, 1582) - * == 24 * 3600 (1 day) - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2003-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ - /* +ADOdb Date Library, part of the ADOdb abstraction library + +Latest version is available at https://adodb.org/ + +@version v5.22.0-dev Unreleased +@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved. +@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community + +PHP native date functions use integer timestamps for computations. +Because of this, dates are restricted to the years 1901-2038 on Unix +and 1970-2038 on Windows due to integer overflow for dates beyond +those years. This library overcomes these limitations by replacing the +native function's signed integers (normally 32-bits) with PHP floating +point numbers (normally 64-bits). + +Dates from 100 A.D. to 3000 A.D. and later +have been tested. The minimum is 100 A.D. as <100 will invoke the +2 => 4 digit year conversion. The maximum is billions of years in the +future, but this is a theoretical limit as the computation of that year +would take too long with the current implementation of adodb_mktime(). + +This library replaces native functions as follows: + +<pre> + getdate() with adodb_getdate() + date() with adodb_date() + gmdate() with adodb_gmdate() + mktime() with adodb_mktime() + gmmktime() with adodb_gmmktime() + strftime() with adodb_strftime() + strftime() with adodb_gmstrftime() +</pre> + +The parameters are identical, except that adodb_date() accepts a subset +of date()'s field formats. Mktime() will convert from local time to GMT, +and date() will convert from GMT to local time, but daylight savings is +not handled currently. + +This library is independent of the rest of ADOdb, and can be used +as standalone code. + +PERFORMANCE + +For high speed, this library uses the native date functions where +possible, and only switches to PHP code when the dates fall outside +the 32-bit signed integer range. + +GREGORIAN CORRECTION + +Pope Gregory shortened October of A.D. 1582 by ten days. Thursday, +October 4, 1582 (Julian) was followed immediately by Friday, October 15, +1582 (Gregorian). + +Since 0.06, we handle this correctly, so: + +adodb_mktime(0,0,0,10,15,1582) - adodb_mktime(0,0,0,10,4,1582) + == 24 * 3600 (1 day) + +============================================================================= + +COPYRIGHT + +(c) 2003-2014 John Lim and released under BSD-style license except for code by +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 + + ============================================================================= FUNCTION DESCRIPTIONS diff --git a/adodb-xmlschema.inc.php b/adodb-xmlschema.inc.php index 7c4901df..98afde3e 100644 --- a/adodb-xmlschema.inc.php +++ b/adodb-xmlschema.inc.php @@ -1,29 +1,21 @@ <?php +// Copyright (c) 2004 ars Cognita Inc., 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. +*******************************************************************************/ /** - * ADOdb XML Schema (v0.2). - * * xmlschema is a class that allows the user to quickly and easily * build a database on any ADOdb-supported platform using a simple * XML schema. * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later + * Last Editor: $Author: jlim $ + * @author Richard Tango-Lowy & Dan Cech + * @version $Revision: 1.12 $ * - * @copyright 2004-2005 ars Cognita Inc., all rights reserved - * @copyright 2005-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Richard Tango-Lowy - * @author Dan Cech + * @package axmls + * @tutorial getting_started.pkg */ /** diff --git a/adodb-xmlschema03.inc.php b/adodb-xmlschema03.inc.php index 4ab6f89b..37df6c2b 100644 --- a/adodb-xmlschema03.inc.php +++ b/adodb-xmlschema03.inc.php @@ -1,29 +1,21 @@ <?php +// Copyright (c) 2004-2005 ars Cognita Inc., 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. +*******************************************************************************/ /** - * ADOdb XML Schema (v0.3). - * * xmlschema is a class that allows the user to quickly and easily * build a database on any ADOdb-supported platform using a simple * XML schema. * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later + * Last Editor: $Author: jlim $ + * @author Richard Tango-Lowy & Dan Cech + * @version $Revision: 1.62 $ * - * @copyright 2004-2005 ars Cognita Inc., all rights reserved - * @copyright 2005-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Richard Tango-Lowy - * @author Dan Cech + * @package axmls + * @tutorial getting_started.pkg */ /** diff --git a/adodb.inc.php b/adodb.inc.php index 03fa9046..1b0a38a0 100644 --- a/adodb.inc.php +++ b/adodb.inc.php @@ -1,22 +1,34 @@ <?php -/** - * ADOdb Library main include file. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. +/* + * Set tabs to 4 for best viewing. * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker + * Latest version is available at https://adodb.org/ * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later + * This is the main include file for ADOdb. + * Database specific drivers are stored in the adodb/drivers/adodb-*.inc.php * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community + * The ADOdb files are formatted so that doxygen can be used to generate documentation. + * Doxygen is a documentation generation tool and can be downloaded from http://doxygen.org/ + */ + +/** + \mainpage + + @version v5.22.0-dev Unreleased + @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. You can choose which license + you prefer. + + PHP's database access functions are not standardised. This creates a need for a database + class library to hide the differences between the different database API's (encapsulate + the differences) so we can easily switch databases. + + We currently support MySQL, Oracle, Microsoft SQL Server, Sybase, Sybase SQL Anywhere, DB2, + 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. */ if (!defined('_ADODB_LAYER')) { @@ -240,12 +252,25 @@ if (!defined('_ADODB_LAYER')) { } + /** + * Parse date string to prevent injection attack. + * + * @param string $s + * + * @return string + */ function _adodb_safedate($s) { return str_replace(array("'", '\\'), '', $s); } - // parse date string to prevent injection attack - // date string will have one quote at beginning e.g. '3434343' + /** + * Parse date string to prevent injection attack. + * Date string will have one quote at beginning e.g. '3434343' + * + * @param string $s + * + * @return string + */ function _adodb_safedateq($s) { $len = strlen($s); if ($s[0] !== "'") { @@ -269,9 +294,17 @@ if (!defined('_ADODB_LAYER')) { return strlen($s2) == 0 ? 'null' : $s2; } - - // for transaction handling - + /** + * For transaction handling. + * + * @param $dbms + * @param $fn + * @param $errno + * @param $errmsg + * @param $p1 + * @param $p2 + * @param $thisConnection + */ function ADODB_TransMonitor($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnection) { //print "Errorno ($fn errno=$errno m=$errmsg) "; $thisConnection->_transOK = false; @@ -281,8 +314,9 @@ if (!defined('_ADODB_LAYER')) { } } - //------------------ - // class for caching + /** + * Class ADODB_Cache_File + */ class ADODB_Cache_File { var $createdir = true; // requires creation of temp dirs @@ -294,18 +328,42 @@ if (!defined('_ADODB_LAYER')) { } } - // write serialised recordset to cache item/file - function writecache($filename, $contents, $debug, $secs2cache) { + /** + * Write serialised RecordSet to cache item/file. + * + * @param $filename + * @param $contents + * @param $debug + * @param $secs2cache + * + * @return bool|int + */ + function writecache($filename, $contents, $debug, $secs2cache) { return adodb_write_file($filename, $contents,$debug); } - // load serialised recordset and unserialise it + /** + * load serialised RecordSet and unserialise it + * + * @param $filename + * @param $err + * @param $secs2cache + * @param $rsClass + * + * @return ADORecordSet + */ function &readcache($filename, &$err, $secs2cache, $rsClass) { $rs = csv2rs($filename,$err,$secs2cache,$rsClass); return $rs; } - // flush all items in cache + /** + * Flush all items in cache. + * + * @param bool $debug + * + * @return bool|void + */ function flushall($debug=false) { global $ADODB_CACHE_DIR; @@ -320,7 +378,12 @@ if (!defined('_ADODB_LAYER')) { return $rez; } - // flush one file in cache + /** + * Flush one file in cache. + * + * @param string $f + * @param bool $debug + */ function flushcache($f, $debug=false) { if (!@unlink($f)) { if ($debug) { @@ -329,6 +392,11 @@ if (!defined('_ADODB_LAYER')) { } } + /** + * @param string $hash + * + * @return string + */ function getdirname($hash) { global $ADODB_CACHE_DIR; if (!isset($this->notSafeMode)) { @@ -337,7 +405,14 @@ if (!defined('_ADODB_LAYER')) { return ($this->notSafeMode) ? $ADODB_CACHE_DIR.'/'.substr($hash,0,2) : $ADODB_CACHE_DIR; } - // create temp directories + /** + * Create temp directories. + * + * @param string $hash + * @param bool $debug + * + * @return string + */ function createdir($hash, $debug) { global $ADODB_CACHE_PERMS; @@ -440,11 +515,38 @@ if (!defined('_ADODB_LAYER')) { var $isoDates = false; /// accepts dates in ISO format var $cacheSecs = 3600; /// cache for 1 hour - // memcache - var $memCache = false; /// should we use memCache instead of caching in files - var $memCacheHost; /// memCache host - var $memCachePort = 11211; /// memCache port - var $memCacheCompress = false; /// Use 'true' to store the item compressed (uses zlib, not supported w/memcached library) + /***************************************** + * memcached server options + ******************************************/ + /* + * Should we use memCache instead of caching in files + */ + public $memCache = false; + /* + * A string, array of hosts or array of memcache connection + * options (see adodb.org) + */ + public $memCacheHost; + + /* + * Default port, may be ignored if connection object array + * is set + */ + public $memCachePort = 11211; + + /* + * Use 'true' to store the item compressed + * uses zlib, Direct option for memcache, else + * For memcached, use the memcacheOptions feature + */ + public $memCacheCompress = false; + + /* + * If using mecached, an array of options + * @link https://www.php.net/manual/en/memcached.constants.php + */ + public $memCacheOptions = array(); + var $sysDate = false; /// name of function that returns the current date var $sysTimeStamp = false; /// name of function that returns the current timestamp @@ -512,6 +614,24 @@ if (!defined('_ADODB_LAYER')) { */ protected $connectionParameters = array(); + /* + * A simple associative array of user-defined custom actual/meta types + */ + public $customActualTypes = array(); + + /* + * An array of user-defined custom meta/actual types + * + $this->customMetaTypes[$meta] = array( + 'actual'=>'', + 'dictionary'=>'', + 'handler'=>'', + 'callback'=>'' + ); + */ + public $customMetaTypes = array(); + + /** * Default Constructor. * We define it even though it does not actually do anything. This avoids @@ -573,10 +693,53 @@ if (!defined('_ADODB_LAYER')) { } /** + * Set a custom meta type with a corresponding actual + * + * @param string $metaType The Custom ADOdb metatype + * @param string $dictionaryType The database dictionary type + * @param string $actualType The database actual type + * @param bool $handleAsType handle like an existing Metatype + * @param mixed $callBack A pre-processing function + * + * @return bool success if the actual exists + */ + final public function setCustomMetaType( + $metaType, + $dictionaryType, + $actualType, + $handleAsType=false, + $callback=false){ + + $this->customMetaTypes[strtoupper($metaType)] = array( + 'actual'=>$actualType, + 'dictionary'=>strtoupper($dictionaryType), + 'handler'=>$handleAsType, + 'callback'=>$callback + ); + + /* + * Create a reverse lookup for the actualType + */ + $this->customActualTypes[$actualType] = $metaType; + + return true; + } + + /** + * Get a list of custom meta types. + * + * @return string[] + */ + final public function getCustomMetaTypes() + { + return $this->customMetaTypes; + } + + + /** * Get server version info. * - * @return string[] An array with 2 elements: $arr['string'] is the description string, - * and $arr[version] is the version (also a string). + * @return string[] Array with 2 string elements: version and description */ function ServerInfo() { return array('description' => '', 'version' => ''); @@ -591,6 +754,13 @@ if (!defined('_ADODB_LAYER')) { return !empty($this->_connectionID); } + /** + * Find version string. + * + * @param string $str + * + * @return string + */ function _findvers($str) { if (preg_match('/([0-9]+\.([0-9\.])+)/',$str, $arr)) { return $arr[1]; @@ -729,6 +899,16 @@ if (!defined('_ADODB_LAYER')) { return false; } + /** + * Always force a new connection to database. + * + * @param string $argHostname Host to connect to + * @param string $argUsername Userid to login + * @param string $argPassword Associated password + * @param string $argDatabaseName Database name + * + * @return bool + */ function _nconnect($argHostname, $argUsername, $argPassword, $argDatabaseName) { return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabaseName); } @@ -807,7 +987,13 @@ if (!defined('_ADODB_LAYER')) { return $ret; } - function outp_throw($msg,$src='WARN',$sql='') { + /** + * Throw an exception if the handler is defined or prints the message if not. + * @param string $msg Message + * @param string $src the name of the calling function (in uppercase) + * @param string $sql Optional offending SQL statement + */ + function outp_throw($msg, $src='WARN', $sql='') { if (defined('ADODB_ERROR_HANDLER') && ADODB_ERROR_HANDLER == 'adodb_throw') { adodb_throw($this->databaseType,$src,-9999,$msg,$sql,false,$this); return; @@ -897,6 +1083,12 @@ if (!defined('_ADODB_LAYER')) { return $this->qstr($s); } + /** + * Quotes a string so that all strings are escaped. + * Wrapper for qstr with magic_quotes = false. + * + * @param string &$s + */ function q(&$s) { //if (!empty($this->qNull && $s == 'null') { // return $s; @@ -905,8 +1097,9 @@ if (!defined('_ADODB_LAYER')) { } /** - * PEAR DB Compat - do not use internally. - */ + * PEAR DB Compat - do not use internally. + * @return int + */ function ErrorNative() { return $this->ErrorNo(); } @@ -914,18 +1107,23 @@ if (!defined('_ADODB_LAYER')) { /** * PEAR DB Compat - do not use internally. + * @param string $seq_name + * @return int */ function nextId($seq_name) { return $this->GenID($seq_name); } /** - * Lock a row, will escalate and lock the table if row locking not supported - * will normally free the lock at the end of the transaction + * Lock a row. + * Will escalate and lock the table if row locking is not supported. + * Will normally free the lock at the end of the transaction. + * + * @param string $table name of table to lock + * @param string $where where clause to use, eg: "WHERE row=12". If left empty, will escalate to table lock + * @param string $col * - * @param string $table name of table to lock - * @param string $where where clause to use, eg: "WHERE row=12". If left empty, will escalate to table lock - * @param string $col + * @return bool */ function RowLock($table,$where,$col='1 as adodbignore') { return false; @@ -968,7 +1166,6 @@ if (!defined('_ADODB_LAYER')) { return $old; } - /** * PEAR DB Compat - do not use internally. * @@ -985,7 +1182,6 @@ if (!defined('_ADODB_LAYER')) { return $rs; } - /** * PEAR DB Compat - do not use internally */ @@ -1026,35 +1222,53 @@ if (!defined('_ADODB_LAYER')) { return '?'; } - /* - InParameter and OutParameter are self-documenting versions of Parameter(). - */ - function InParameter(&$stmt,&$var,$name,$maxLen=4000,$type=false) { + /** + * Self-documenting version of Parameter(). + * + * @param $stmt + * @param &$var + * @param $name + * @param int $maxLen + * @param bool $type + * + * @return bool + */ + function InParameter(&$stmt, &$var, $name, $maxLen=4000, $type=false) { return $this->Parameter($stmt,$var,$name,false,$maxLen,$type); } - /* - */ + /** + * Self-documenting version of Parameter(). + * + * @param $stmt + * @param $var + * @param $name + * @param int $maxLen + * @param bool $type + * + * @return bool + */ function OutParameter(&$stmt,&$var,$name,$maxLen=4000,$type=false) { return $this->Parameter($stmt,$var,$name,true,$maxLen,$type); } - - /* - Usage in oracle - $stmt = $db->Prepare('select * from table where id =:myid and group=:group'); - $db->Parameter($stmt,$id,'myid'); - $db->Parameter($stmt,$group,'group',64); - $db->Execute(); - - @param $stmt Statement returned by Prepare() or PrepareSP(). - @param $var PHP variable to bind to - @param $name Name of stored procedure variable name to bind to. - @param [$isOutput] Indicates direction of parameter 0/false=IN 1=OUT 2= IN/OUT. This is ignored in oci8. - @param [$maxLen] Holds an maximum length of the variable. - @param [$type] The data type of $var. Legal values depend on driver. - + /** + * + * Usage in oracle + * $stmt = $db->Prepare('select * from table where id =:myid and group=:group'); + * $db->Parameter($stmt,$id,'myid'); + * $db->Parameter($stmt,$group,'group',64); + * $db->Execute(); + * + * @param mixed &$stmt Statement returned by Prepare() or PrepareSP(). + * @param mixed &$var PHP variable to bind to + * @param string $name Name of stored procedure variable name to bind to. + * @param int|bool $isOutput Indicates direction of parameter 0/false=IN 1=OUT 2= IN/OUT. This is ignored in oci8. + * @param int $maxLen Holds an maximum length of the variable. + * @param mixed $type The data type of $var. Legal values depend on driver. + * + * @return bool */ function Parameter(&$stmt,&$var,$name,$isOutput=false,$maxLen=4000,$type=false) { return false; @@ -1936,16 +2150,6 @@ if (!defined('_ADODB_LAYER')) { return $rv; } - function Transpose(&$rs,$addfieldnames=true) { - $rs2 = $this->_rs2rs($rs); - if (!$rs2) { - return false; - } - - $rs2->_transpose($addfieldnames); - return $rs2; - } - /* Calculate the offset of a date for a particular database and generate appropriate SQL. Useful for calculating future/past dates and storing @@ -2443,37 +2647,47 @@ if (!defined('_ADODB_LAYER')) { /** - * Update a blob column, given a where clause. There are more sophisticated - * blob handling functions that we could have implemented, but all require - * a very complex API. Instead we have chosen something that is extremely - * simple to understand and use. - * - * Note: $blobtype supports 'BLOB' and 'CLOB', default is BLOB of course. - * - * Usage to update a $blobvalue which has a primary key blob_id=1 into a - * field blobtable.blobcolumn: - * - * UpdateBlob('blobtable', 'blobcolumn', $blobvalue, 'blob_id=1'); - * - * Insert example: - * - * $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)'); - * $conn->UpdateBlob('blobtable','blobcol',$blob,'id=1'); - */ - function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB') { + * Update a BLOB column, given a where clause. + * + * There are more sophisticated blob handling functions that we could have + * implemented, but all require a very complex API. Instead we have chosen + * something that is extremely simple to understand and use. + * + * Sample usage: + * - update a BLOB in field table.blob_col with value $blobValue, for a + * record having primary key id=1 + * $conn->updateBlob('table', 'blob_col', $blobValue, 'id=1'); + * - insert example: + * $conn->execute('INSERT INTO table (id, blob_col) VALUES (1, null)'); + * $conn->updateBlob('table', 'blob_col', $blobValue, 'id=1'); + * + * @param string $table + * @param string $column + * @param string $val Filename containing blob data + * @param mixed $where {@see updateBlob()} + * @param string $blobtype supports 'BLOB' (default) and 'CLOB' + * + * @return bool success + */ + function updateBlob($table, $column, $val, $where, $blobtype='BLOB') { return $this->Execute("UPDATE $table SET $column=? WHERE $where",array($val)) != false; } /** - * Usage: - * UpdateBlob('TABLE', 'COLUMN', '/path/to/file', 'ID=1'); - * - * $blobtype supports 'BLOB' and 'CLOB' - * - * $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)'); - * $conn->UpdateBlob('blobtable','blobcol',$blobpath,'id=1'); - */ - function UpdateBlobFile($table,$column,$path,$where,$blobtype='BLOB') { + * Update a BLOB from a file. + * + * Usage example: + * $conn->updateBlobFile('table', 'blob_col', '/path/to/file', 'id=1'); + * + * @param string $table + * @param string $column + * @param string $path Filename containing blob data + * @param mixed $where {@see updateBlob()} + * @param string $blobtype supports 'BLOB' and 'CLOB' + * + * @return bool success + */ + function updateBlobFile($table, $column, $path, $where, $blobtype='BLOB') { $fd = fopen($path,'rb'); if ($fd === false) { return false; @@ -2642,7 +2856,9 @@ if (!defined('_ADODB_LAYER')) { } /** - * Begin a Transaction. Must be followed by CommitTrans() or RollbackTrans(). + * Begin a Transaction. + * + * Must be followed by CommitTrans() or RollbackTrans(). * * @return bool true if succeeded or false if database does not support transactions */ @@ -2704,11 +2920,14 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 } /** - * If database does not support transactions, always return true as data always committed + * Commits a transaction. * - * @param bool $ok set to false to rollback transaction, true to commit + * If database does not support transactions, return true as data is + * always committed. * - * @return true/false. + * @param bool $ok True to commit, false to rollback the transaction. + * + * @return bool true if successful */ function CommitTrans($ok=true) { return true; @@ -2716,9 +2935,12 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 /** - * If database does not support transactions, rollbacks always fail, so return false + * Rolls back a transaction. * - * @return bool + * If database does not support transactions, return false as rollbacks + * always fail. + * + * @return bool true if successful */ function RollbackTrans() { return false; @@ -3417,10 +3639,9 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 class ADOFetchObj { }; - //============================================================================================== - // CLASS ADORecordSet_empty - //============================================================================================== - + /** + * Class ADODB_Iterator_empty + */ class ADODB_Iterator_empty implements Iterator { private $rs; @@ -3543,10 +3764,9 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 include_once(ADODB_DIR.'/adodb-time.inc.php'); } - //============================================================================================== - // CLASS ADORecordSet - //============================================================================================== - + /** + * Class ADODB_Iterator + */ class ADODB_Iterator implements Iterator { private $rs; @@ -3586,13 +3806,14 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 } - /** - * RecordSet class that represents the dataset returned by the database. - * To keep memory overhead low, this class holds only the current row in memory. - * No prefetching of data is done, so the RecordCount() can return -1 ( which - * means recordcount not known). - */ - class ADORecordSet implements IteratorAggregate { +/** + * RecordSet class that represents the dataset returned by the database. + * + * To keep memory overhead low, this class holds only the current row in memory. + * No prefetching of data is done, so the RecordCount() can return -1 (which + * means recordcount not known). + */ +class ADORecordSet implements IteratorAggregate { /** * public variables @@ -3613,15 +3834,14 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 var $bind = false; /// used by Fields() to hold array - should be private? var $fetchMode; /// default fetch mode - var $connection = false; /// the parent connection - + /** @var ADOConnection The parent connection */ + var $connection = false; /** * private variables */ var $_numOfRows = -1; /** number of rows, or -1 */ var $_numOfFields = -1; /** number of fields in recordset */ - /** @var resource result link identifier */ - var $_queryID = -1; + var $_queryID = -1; /** This variable keeps the result link identifier. */ var $_currentRow = -1; /** This variable keeps the current row in the Recordset. */ var $_closed = false; /** has recordset been closed */ var $_inited = false; /** Init() should only be called once */ @@ -3635,16 +3855,14 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 var $_maxRecordCount = 0; var $datetime = false; - /** - * @var ADOFieldObject[] Field metadata cache - * @see fieldTypesArray() - */ - protected $fieldObjectsCache; + public $customActualTypes; + public $customMetaTypes; + /** * Constructor * - * @param resource|int queryID this is the queryID returned by ADOConnection->_query() + * @param resource|int $queryID Query ID returned by ADOConnection->_query() * */ function __construct($queryID) { @@ -3671,7 +3889,7 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 } $this->_inited = true; if ($this->_queryID) { - @$this->_initrs(); + @$this->_initRS(); } else { $this->_numOfRows = 0; $this->_numOfFields = 0; @@ -3686,6 +3904,16 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 } } + /** + * Recordset initialization stub + */ + protected function _initRS() {} + + /** + * Row fetch stub + * @return bool + */ + protected function _fetch() {} /** * Generate a SELECT tag from a recordset, and return the HTML markup. @@ -3824,24 +4052,28 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 return $this->GetArray($nRows); } - /* - * Some databases allow multiple recordsets to be returned. This function - * will return true if there is a next recordset, or false if no more. - */ + /** + * Checks if there is another available recordset. + * + * Some databases allow multiple recordsets to be returned. + * + * @return boolean true if there is a next recordset, or false if no more + */ function NextRecordSet() { return false; } /** - * return recordset as a 2-dimensional array. + * Return recordset as a 2-dimensional array. + * * Helper function for ADOConnection->SelectLimit() * - * @param offset is the row to start calculations from (1-based) - * @param [nrows] is the number of rows to return + * @param int $nrows Number of rows to return + * @param int $offset Starting row (1-based) * * @return array an array indexed by the rows (0-based) from the recordset */ - function GetArrayLimit($nrows,$offset=-1) { + function getArrayLimit($nrows, $offset=-1) { if ($offset <= 0) { return $this->GetArray($nrows); } @@ -3862,11 +4094,11 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 /** * Synonym for GetArray() for compatibility with ADO. * - * @param [nRows] is the number of rows to return. -1 means every row. + * @param int $nRows Number of rows to return. -1 means every row. * * @return array an array indexed by the rows (0-based) from the recordset */ - function GetRows($nRows = -1) { + function getRows($nRows = -1) { return $this->GetArray($nRows); } @@ -4079,8 +4311,8 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 /** - * PEAR DB Compat - do not use internally - */ + * PEAR DB Compat - do not use internally + */ function Free() { return $this->Close(); } @@ -4254,6 +4486,14 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 return false; } + /** + * Adjusts the result pointer to an arbitrary row in the result. + * + * @param int $row The row to seek to. + * + * @return bool False if the recordset contains no rows, otherwise true. + */ + function _seek($row) {} /** * Get the value of a field in the current row by column name. @@ -4327,8 +4567,9 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 * Use associative array to get fields array for databases that do not support * associative arrays. Submitted by Paolo S. Asioli paolo.asioli#libero.it * - * @param int [$upper] Case for the array keys, defaults to uppercase + * @param int $upper Case for the array keys, defaults to uppercase * (see ADODB_ASSOC_CASE_xxx constants) + * @return array */ function GetRowAssoc($upper = ADODB_ASSOC_CASE) { $record = array(); @@ -4364,15 +4605,14 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 } /** - * Synonyms RecordCount and RowCount + * Number of rows in recordset. * * @return int Number of rows or -1 if this is not supported */ - function RecordCount() { + function recordCount() { return $this->_numOfRows; } - /** * If we are using PageExecute(), this will return the maximum possible rows * that can be returned when paging a recordset. @@ -4380,26 +4620,32 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 * @return int */ function MaxRecordCount() { - return ($this->_maxRecordCount) ? $this->_maxRecordCount : $this->RecordCount(); + return ($this->_maxRecordCount) ? $this->_maxRecordCount : $this->recordCount(); } /** - * synonyms RecordCount and RowCount + * Number of rows in recordset. + * Alias for {@see recordCount()} * - * @return the number of rows or -1 if this is not supported + * @return int Number of rows or -1 if this is not supported */ - function RowCount() { - return $this->_numOfRows; + function rowCount() { + return $this->recordCount(); } - - /** - * Portable RecordCount. Pablo Roca <pabloroca@mvps.org> + /** + * Portable RecordCount. * - * @return the number of records from a previous SELECT. All databases support this. + * Be aware of possible problems in multiuser environments. + * For better speed the table must be indexed by the condition. + * Heavy test this before deploying. + * + * @param string $table + * @param string $condition * - * But aware possible problems in multiuser environments. For better speed the table - * must be indexed by the condition. Heavy test this before deploying. + * @return int Number of records from a previous SELECT. All databases support this. + * + * @author Pablo Roca <pabloroca@mvps.org> */ function PO_RecordCount($table="", $condition="") { @@ -4445,16 +4691,15 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 } /** - * Get a Field's metadata from database. - * - * Must be defined by child class. + * Get Field metadata for of a specific column. * - * @param int $fieldOffset + * @param fieldoffset is the column position to access(0-based). * - * @return ADOFieldObject|false + * @return ADOFieldObject|false for that column, or false. */ - function fetchField($fieldOffset) - { + function fetchField($fieldoffset = -1) { + // must be defined by child class + return false; } @@ -4464,12 +4709,13 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 * @return ADOFieldObject[] */ function fieldTypesArray() { - if (empty($this->fieldObjectsCache)) { - for ($i = 0; $i < $this->_numOfFields; $i++) { - $this->fieldObjectsCache[] = $this->fetchField($i); + static $arr = array(); + if (empty($arr)) { + for ($i=0, $max=$this->_numOfFields; $i < $max; $i++) { + $arr[] = $this->FetchField($i); } } - return $this->fieldObjectsCache; + return $arr; } /** @@ -4486,11 +4732,11 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 * Return the fields array of the current row as an object for convenience. * The default case is uppercase. * - * @param $isupper to set the object property names to uppercase + * @param bool $isUpper to set the object property names to uppercase * - * @return the object with the properties set to the fields of the current row + * @return ADOFetchObj The object with properties set to the fields of the current row */ - function FetchObject($isupper=true) { + function FetchObject($isUpper=true) { if (empty($this->_obj)) { $this->_obj = new ADOFetchObj(); $this->_names = array(); @@ -4499,12 +4745,11 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 $this->_names[] = $f->name; } } - $i = 0; $o = clone($this->_obj); for ($i=0; $i <$this->_numOfFields; $i++) { $name = $this->_names[$i]; - if ($isupper) { + if ($isUpper) { $n = strtoupper($name); } else { $n = $name; @@ -4519,8 +4764,8 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 * Return the fields array of the current row as an object for convenience. * The default is lower-case field names. * - * @return the object with the properties set to the fields of the current row, - * or false if EOF + * @return ADOFetchObj|false The object with properties set to the fields of the current row + * or false if EOF. * * Fixed bug reported by tim@orotech.net */ @@ -4533,17 +4778,17 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 * Return the fields array of the current row as an object for convenience. * The default is upper case field names. * - * @param $isupper to set the object property names to uppercase + * @param bool $isUpper to set the object property names to uppercase * - * @return the object with the properties set to the fields of the current row, - * or false if EOF + * @return ADOFetchObj|false The object with properties set to the fields of the current row + * or false if EOF. * * Fixed bug reported by tim@orotech.net */ - function FetchNextObject($isupper=true) { + function FetchNextObject($isUpper=true) { $o = false; if ($this->_numOfRows != 0 && !$this->EOF) { - $o = $this->FetchObject($isupper); + $o = $this->FetchObject($isUpper); $this->_currentRow++; if ($this->_fetch()) { return $o; @@ -4554,37 +4799,29 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 } /** - * Get the metatype of the column. This is used for formatting. This is because - * many databases use different names for the same type, so we transform the original - * type to our standardised version which uses 1 character codes: + * Get the ADOdb metatype. * - * @param t is the type passed in. Normally is ADOFieldObject->type. - * @param len is the maximum length of that field. This is because we treat character - * fields bigger than a certain size as a 'B' (blob). - * @param fieldobj is the field object returned by the database driver. Can hold - * additional info (eg. primary_key for mysql). + * Many databases use different names for the same type, so we transform + * the native type to our standardised one, which uses 1 character codes. + * @see https://adodb.org/dokuwiki/doku.php?id=v5:dictionary:dictionary_index#portable_data_types * - * @return the general type of the data: - * C for character < 250 chars - * X for teXt (>= 250 chars) - * B for Binary - * N for numeric or floating point - * D for date - * T for timestamp - * L for logical/Boolean - * I for integer - * R for autoincrement counter/integer + * @param string|ADOFieldObject $t Native type (usually ADOFieldObject->type) + * It is also possible to provide an + * ADOFieldObject here. + * @param int $len The field's maximum length. This is because we treat + * character fields bigger than a certain size as a 'B' (blob). + * @param ADOFieldObject $fieldObj Field object returned by the database driver; + * can hold additional info (eg. primary_key for mysql). * - * - */ - function MetaType($t,$len=-1,$fieldobj=false) { - if (is_object($t)) { - $fieldobj = $t; - $t = $fieldobj->type; - $len = $fieldobj->max_length; + * @return string The ADOdb Standard type + */ + function metaType($t, $len = -1, $fieldObj = false) { + if ($t instanceof ADOFieldObject) { + $fieldObj = $t; + $t = $fieldObj->type; + $len = $fieldObj->max_length; } - // changed in 2.32 to hashing instead of switch stmt for speed... static $typeMap = array( 'VARCHAR' => 'C', @@ -4691,8 +4928,6 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 "SQLBOOL" => 'L' ); - - $tmap = false; $t = strtoupper($t); $tmap = (isset($typeMap[$t])) ? $typeMap[$t] : ADODB_DEFAULT_METATYPE; switch ($tmap) { @@ -4708,7 +4943,7 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 return 'C'; case 'I': - if (!empty($fieldobj->primary_key)) { + if (!empty($fieldObj->primary_key)) { return 'R'; } return 'I'; @@ -4717,8 +4952,8 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 return 'N'; case 'B': - if (isset($fieldobj->binary)) { - return ($fieldobj->binary) ? 'B' : 'X'; + if (isset($fieldObj->binary)) { + return ($fieldObj->binary) ? 'B' : 'X'; } return 'B'; @@ -4769,8 +5004,10 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 /** * set/returns the current recordset page when paginating + * @param int $page + * @return int */ - function AbsolutePage($page=-1) { + function absolutePage($page=-1) { if ($page != -1) { $this->_currentPage = $page; } @@ -4779,6 +5016,8 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 /** * set/returns the status of the atFirstPage flag when paginating + * @param bool $status + * @return bool */ function AtFirstPage($status=false) { if ($status != false) { @@ -4787,6 +5026,10 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 return $this->_atFirstPage; } + /** + * @param bool $page + * @return bool + */ function LastPageNo($page = false) { if ($page != false) { $this->_lastPageNo = $page; @@ -4796,6 +5039,8 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 /** * set/returns the status of the atLastPage flag when paginating + * @param bool $status + * @return bool */ function AtLastPage($status=false) { if ($status != false) { @@ -4843,38 +5088,6 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 $this->fetchMode = $ADODB_FETCH_MODE; } - function _transpose($addfieldnames=true) { - global $ADODB_INCLUDED_LIB; - - if (empty($ADODB_INCLUDED_LIB)) { - include_once(ADODB_DIR.'/adodb-lib.inc.php'); - } - $hdr = true; - - $fobjs = $addfieldnames ? $this->_fieldobjects : false; - adodb_transpose($this->_array, $newarr, $hdr, $fobjs); - //adodb_pr($newarr); - - $this->_skiprow1 = false; - $this->_array = $newarr; - $this->_colnames = $hdr; - - adodb_probetypes($newarr,$this->_types); - - $this->_fieldobjects = array(); - - foreach($hdr as $k => $name) { - $f = new ADOFieldObject(); - $f->name = $name; - $f->type = $this->_types[$k]; - $f->max_length = -1; - $this->_fieldobjects[] = $f; - } - $this->fields = reset($this->_array); - - $this->_initrs(); - - } /** * Setup the array. diff --git a/composer.json b/composer.json index 807866b6..133210ee 100644 --- a/composer.json +++ b/composer.json @@ -30,10 +30,6 @@ "php" : "^5.5.9 || ^7.0 || ^8.0" }, - "require-dev" : { - "phpunit/phpunit": "^8.5" - }, - "autoload" : { "files" : ["adodb.inc.php"] } diff --git a/datadict/datadict-access.inc.php b/datadict/datadict-access.inc.php index 3667acae..d916ff29 100644 --- a/datadict/datadict-access.inc.php +++ b/datadict/datadict-access.inc.php @@ -1,23 +1,16 @@ <?php + /** - * Data Dictionary for Access. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4 for best viewing. + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -50,7 +43,8 @@ class ADODB2_access extends ADODB_DataDict { case 'B': return 'BINARY'; case 'TS': - case 'D': return 'DATETIME'; + case 'D': + return 'DATETIME'; case 'T': return 'DATETIME'; case 'L': return 'BYTE'; diff --git a/datadict/datadict-db2.inc.php b/datadict/datadict-db2.inc.php index 9ac106bb..3acb23df 100644 --- a/datadict/datadict-db2.inc.php +++ b/datadict/datadict-db2.inc.php @@ -1,24 +1,15 @@ <?php /** - * Data Dictionary for DB2. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + @version v5.22.0-dev Unreleased + @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. + Set tabs to 4 for best viewing. + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/datadict/datadict-firebird.inc.php b/datadict/datadict-firebird.inc.php index ba80699d..226086d8 100644 --- a/datadict/datadict-firebird.inc.php +++ b/datadict/datadict-firebird.inc.php @@ -1,23 +1,16 @@ <?php + /** - * Data Dictionary for Firebird. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4 for best viewing. + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/datadict/datadict-generic.inc.php b/datadict/datadict-generic.inc.php index 0a462b8f..262e2c3b 100644 --- a/datadict/datadict-generic.inc.php +++ b/datadict/datadict-generic.inc.php @@ -1,23 +1,16 @@ <?php + /** - * Generic Data Dictionary. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4 for best viewing. + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -28,7 +21,8 @@ class ADODB2_generic extends ADODB_DataDict { var $seqField = false; - function ActualType($meta) + + function ActualType($meta) { $meta = strtoupper($meta); diff --git a/datadict/datadict-ibase.inc.php b/datadict/datadict-ibase.inc.php index d0da9597..41a374fd 100644 --- a/datadict/datadict-ibase.inc.php +++ b/datadict/datadict-ibase.inc.php @@ -1,23 +1,16 @@ <?php + /** - * Data Dictionary for Interbase. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4 for best viewing. + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -28,7 +21,7 @@ class ADODB2_ibase extends ADODB_DataDict { var $seqField = false; - function ActualType($meta) + function ActualType($meta) { $meta = strtoupper($meta); diff --git a/datadict/datadict-informix.inc.php b/datadict/datadict-informix.inc.php index 9e151633..7e3f785c 100644 --- a/datadict/datadict-informix.inc.php +++ b/datadict/datadict-informix.inc.php @@ -1,23 +1,16 @@ <?php + /** - * Data Dictionary for Informix. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4 for best viewing. + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/datadict/datadict-mssql.inc.php b/datadict/datadict-mssql.inc.php index 17df9e39..f5a804d9 100644 --- a/datadict/datadict-mssql.inc.php +++ b/datadict/datadict-mssql.inc.php @@ -1,23 +1,16 @@ <?php + /** - * Data Dictionary for Microsoft SQL Server (mssql) - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4 for best viewing. + +*/ /* In ADOdb, named quotes for MS SQL Server use ". From the MSSQL Docs: diff --git a/datadict/datadict-mssqlnative.inc.php b/datadict/datadict-mssqlnative.inc.php index 59228cbe..ba4a7b5a 100644 --- a/datadict/datadict-mssqlnative.inc.php +++ b/datadict/datadict-mssqlnative.inc.php @@ -1,25 +1,16 @@ <?php + /** - * Data Dictionary for Microsoft SQL Server native (mssqlnative) + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4 for best viewing. - * FileDescription - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +*/ /* In ADOdb, named quotes for MS SQL Server use ". From the MSSQL Docs: diff --git a/datadict/datadict-mysql.inc.php b/datadict/datadict-mysql.inc.php index 9efbba1f..64b4088c 100644 --- a/datadict/datadict-mysql.inc.php +++ b/datadict/datadict-mysql.inc.php @@ -1,23 +1,16 @@ <?php + /** - * Data Dictionary for MySQL. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4 for best viewing. + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/datadict/datadict-oci8.inc.php b/datadict/datadict-oci8.inc.php index 6d2cd244..ddbb4e88 100644 --- a/datadict/datadict-oci8.inc.php +++ b/datadict/datadict-oci8.inc.php @@ -1,23 +1,16 @@ <?php + /** - * Data Dictionary for Oracle (oci8) - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4 for best viewing. + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/datadict/datadict-postgres.inc.php b/datadict/datadict-postgres.inc.php index 94cfec2e..c02495d4 100644 --- a/datadict/datadict-postgres.inc.php +++ b/datadict/datadict-postgres.inc.php @@ -1,23 +1,16 @@ <?php + /** - * Data Dictionary for PostgreSQL. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4 for best viewing. + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -52,13 +45,13 @@ class ADODB2_postgres extends ADODB_DataDict !empty($fieldobj->has_default) && substr($fieldobj->default_value,0,8) == 'nextval('; switch ($t) { - + case 'INTERVAL': case 'CHAR': case 'CHARACTER': case 'VARCHAR': case 'NAME': - case 'BPCHAR': + case 'BPCHAR': if ($len <= $this->blobSize) return 'C'; case 'TEXT': diff --git a/datadict/datadict-sapdb.inc.php b/datadict/datadict-sapdb.inc.php index 25f91c93..e765497e 100644 --- a/datadict/datadict-sapdb.inc.php +++ b/datadict/datadict-sapdb.inc.php @@ -1,23 +1,17 @@ <?php + /** - * Data Dictionary for SAP DB. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4 for best viewing. + + Modified from datadict-generic.inc.php for sapdb by RalfBecker-AT-outdoor-training.de +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -28,7 +22,7 @@ class ADODB2_sapdb extends ADODB_DataDict { var $seqField = false; var $renameColumn = 'RENAME COLUMN %s.%s TO %s'; - function ActualType($meta) + function ActualType($meta) { $meta = strtoupper($meta); diff --git a/datadict/datadict-sqlite.inc.php b/datadict/datadict-sqlite.inc.php index d190cb99..ef014b75 100644 --- a/datadict/datadict-sqlite.inc.php +++ b/datadict/datadict-sqlite.inc.php @@ -1,23 +1,18 @@ <?php + /** - * Data Dictionary for SQLite. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4 for best viewing. + + SQLite datadict Andrei Besleaga + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -32,19 +27,19 @@ class ADODB2_sqlite extends ADODB_DataDict { public $blobAllowsDefaultValue = true; public $blobAllowsNotNull = true; - + function ActualType($meta) { - + $meta = strtoupper($meta); - + /* * Add support for custom meta types. We do this * first, that allows us to override existing types */ if (isset($this->connection->customMetaTypes[$meta])) return $this->connection->customMetaTypes[$meta]['actual']; - + switch(strtoupper($meta)) { case 'C': return 'VARCHAR'; // TEXT , TEXT affinity case 'XL':return 'LONGTEXT'; // TEXT , TEXT affinity diff --git a/datadict/datadict-sybase.inc.php b/datadict/datadict-sybase.inc.php index ff018315..2813c1c4 100644 --- a/datadict/datadict-sybase.inc.php +++ b/datadict/datadict-sybase.inc.php @@ -1,23 +1,16 @@ <?php + /** - * Data Dictionary for SyBase. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4 for best viewing. + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -61,14 +54,14 @@ class ADODB2_sybase extends ADODB_DataDict { function ActualType($meta) { $meta = strtoupper($meta); - + /* * Add support for custom meta types. We do this * first, that allows us to override existing types */ if (isset($this->connection->customMetaTypes[$meta])) return $this->connection->customMetaTypes[$meta]['actual']; - + switch(strtoupper($meta)) { case 'C': return 'VARCHAR'; case 'XL': diff --git a/docs/changelog.md b/docs/changelog.md index 2a934c67..bf6f274e 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -47,57 +47,14 @@ Older changelogs: [#635](https://github.com/ADOdb/ADOdb/issues/635) -## [5.21.1] - 2021-08-15 - -### Changed - -- Standardized source code file headers - [#728](https://github.com/ADOdb/ADOdb/issues/728) -- Code cleanup: PHPDoc, code style, whitespace, etc. - [#691](https://github.com/ADOdb/ADOdb/issues/691) - (and others) +## [5.21.1] - Unreleased ### Fixed -- Caching in FieldTypesArray() causes problems - [#687](https://github.com/ADOdb/ADOdb/issues/687) -- setConnectionParameter() method should not be final - [#694](https://github.com/ADOdb/ADOdb/issues/694) -- Final private methods throw warning (PHP 8) - [#711](https://github.com/ADOdb/ADOdb/issues/711) -- Fix record count when executing SQL with subqueries - [#715](https://github.com/ADOdb/ADOdb/issues/715) -- Incorrect handling of $ADODB_QUOTE_FIELDNAMES = true - [#721](https://github.com/ADOdb/ADOdb/issues/721) -- db2: fix columns always returned in lowercase - [#719](https://github.com/ADOdb/ADOdb/issues/719) -- PDO: Bind parameters fail if sent in associative array - [#705](https://github.com/ADOdb/ADOdb/issues/705) -- mssql: _insertid() doesn't work anymore - [#692](https://github.com/ADOdb/ADOdb/issues/692) - mssql: PHP warnings in dropColumnSQL() [#696](https://github.com/ADOdb/ADOdb/issues/696) -- mssql: duplicate key in SQLDate convert formats - [#748](https://github.com/ADOdb/ADOdb/issues/748) -- mysql: affected_rows() returns number instead of false - [#604](https://github.com/ADOdb/ADOdb/issues/604) - mysql: TypeError when calling get/setChangeSet on unset connection (PHP 8) [#686](https://github.com/ADOdb/ADOdb/issues/686) -- mysql: TypeError when calling setConnectionParameter() with non-numeric value (PHP 8) - [#693](https://github.com/ADOdb/ADOdb/issues/693) -- pdo: Affected_Rows() throws Notice and returns 0 when rows affected - [#733](https://github.com/ADOdb/ADOdb/issues/733) -- pgsql: sub-selects require aliasing - [#736](https://github.com/ADOdb/ADOdb/issues/736) -- xml: Invalid SQL in extractSchema() - [#707](https://github.com/ADOdb/ADOdb/issues/707) - -### Removed - -- Use of _ADODB_COUNT as workaround for counting in complex queries - (introduced in [#88](https://github.com/ADOdb/ADOdb/issues/88)) - [#715](https://github.com/ADOdb/ADOdb/issues/715) - ## [5.21.0] - 2021-02-27 @@ -1140,9 +1097,9 @@ Released together with [v4.95](changelog_v4.x.md#495---17-may-2007) - Adodb5 version,more error checking code now will use exceptions if available. -[Unreleased]: https://github.com/adodb/adodb/compare/v5.21.1...master +[Unreleased]: https://github.com/adodb/adodb/compare/v5.21.0...master -[5.21.1]: https://github.com/adodb/adodb/compare/v5.21.0...v5.21.1 +[5.21.1]: https://github.com/adodb/adodb/compare/v5.21.0...hotfix/5.21 [5.21.0]: https://github.com/adodb/adodb/compare/v5.21.0-rc.1...v5.21.0 [5.21.0-rc.1]: https://github.com/adodb/adodb/compare/v5.21.0-beta.1...v5.21.0-rc.1 [5.21.0-beta.1]: https://github.com/adodb/adodb/compare/v5.20.20...v5.21.0-beta.1 diff --git a/drivers/adodb-access.inc.php b/drivers/adodb-access.inc.php index 13461a35..51f3247a 100644 --- a/drivers/adodb-access.inc.php +++ b/drivers/adodb-access.inc.php @@ -1,26 +1,17 @@ <?php -/** - * Microsoft Access driver. - * - * Requires ODBC. Works only on Microsoft Windows. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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 https://adodb.org/ + Microsoft Access data driver. Requires ODBC. Works only on Microsoft Windows. +*/ if (!defined('_ADODB_ODBC_LAYER')) { if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-ado.inc.php b/drivers/adodb-ado.inc.php index 67a032d7..6b343d89 100644 --- a/drivers/adodb-ado.inc.php +++ b/drivers/adodb-ado.inc.php @@ -1,25 +1,17 @@ <?php -/** - * Microsoft ADO driver. - * - * Requires ADO. Works only on MS Windows. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. +Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + + Microsoft ADO data driver. Requires ADO. Works only on MS Windows. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -504,6 +496,9 @@ class ADORecordSet_ado extends ADORecordSet { $t = $fieldobj->type; $len = $fieldobj->max_length; } + + if (array_key_exists($t,$this->connection->customActualTypes)) + return $this->connection->customActualTypes[$t]; if (!is_numeric($t)) return $t; diff --git a/drivers/adodb-ado5.inc.php b/drivers/adodb-ado5.inc.php index f673d092..c7266a90 100644 --- a/drivers/adodb-ado5.inc.php +++ b/drivers/adodb-ado5.inc.php @@ -1,25 +1,17 @@ <?php -/** - * Microsoft ADO driver (PHP5 compat version). - * - * Requires ADO. Works only on MS Windows. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. +Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + + Microsoft ADO data driver. Requires ADO. Works only on MS Windows. PHP5 compat version. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -545,8 +537,14 @@ class ADORecordSet_ado extends ADORecordSet { $t = $fieldobj->type; $len = $fieldobj->max_length; } + + $t = strtoupper($t); + + if (array_key_exists($t,$this->connection->customActualTypes)) + return $this->connection->customActualTypes[$t]; - if (!is_numeric($t)) return $t; + if (!is_numeric($t)) + return $t; switch ($t) { case 0: diff --git a/drivers/adodb-ado_access.inc.php b/drivers/adodb-ado_access.inc.php index ad7ab38c..0a7cd272 100644 --- a/drivers/adodb-ado_access.inc.php +++ b/drivers/adodb-ado_access.inc.php @@ -1,25 +1,17 @@ <?php -/** - * Microsoft Access ADO driver. - * - * Requires ADO and ODBC. Works only on MS Windows. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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 https://adodb.org/ + + Microsoft Access ADO data driver. Requires ADO and ODBC. Works only on MS Windows. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-ado_mssql.inc.php b/drivers/adodb-ado_mssql.inc.php index d0e9c196..ba8e1a61 100644 --- a/drivers/adodb-ado_mssql.inc.php +++ b/drivers/adodb-ado_mssql.inc.php @@ -1,25 +1,21 @@ <?php -/** - * Microsoft SQL Server ADO driver. - * - * Requires ADO and MSSQL client. Works only on MS Windows. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. +Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + + Microsoft SQL Server ADO data driver. Requires ADO and MSSQL client. + Works only on MS Windows. + + Warning: Some versions of PHP (esp PHP4) leak memory when ADO/COM is used. + Please check http://bugs.php.net/ for more info. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-ads.inc.php b/drivers/adodb-ads.inc.php index b9d4adb5..c87f5e25 100644 --- a/drivers/adodb-ads.inc.php +++ b/drivers/adodb-ads.inc.php @@ -1,29 +1,20 @@ <?php -/** - * ADOdb driver for ADS. - * - * NOTE: This driver requires the Advantage PHP client libraries, which - * can be downloaded for free via: - * @link http://devzone.advantagedatabase.com/dz/content.aspx?key=20 - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ - /* + (c) 2000-2014 John Lim (jlim#natsoft.com.my). All rights reserved. + Portions Copyright (c) 2007-2009, iAnywhere Solutions, Inc. + All rights reserved. All unpublished 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. + +Set tabs to 4 for best viewing. + + +NOTE: This driver requires the Advantage PHP client libraries, which + can be downloaded for free via: + http://devzone.advantagedatabase.com/dz/content.aspx?key=20 + DELPHI FOR PHP USERS: The following steps can be taken to utilize this driver from the CodeGear Delphi for PHP product: @@ -44,7 +35,6 @@ DELPHI FOR PHP USERS: Database object's DriverName property. */ - // security - hide paths if (!defined('ADODB_DIR')) { die(); diff --git a/drivers/adodb-borland_ibase.inc.php b/drivers/adodb-borland_ibase.inc.php index da2c7618..a6abe839 100644 --- a/drivers/adodb-borland_ibase.inc.php +++ b/drivers/adodb-borland_ibase.inc.php @@ -1,25 +1,18 @@ <?php -/** - * Borland Interbase driver. - * - * Support Borland Interbase 6.5 and later - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. +Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + + Support Borland Interbase 6.5 and later + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-csv.inc.php b/drivers/adodb-csv.inc.php index 8a59626e..4c0e3d6e 100644 --- a/drivers/adodb-csv.inc.php +++ b/drivers/adodb-csv.inc.php @@ -1,30 +1,21 @@ <?php -/** - * FileDescription - * - * Currently unsupported: MetaDatabases, MetaTables and MetaColumns, - * and also inputarr in Execute. - * Native types have been converted to MetaTypes. - * Transactions not supported yet. - * - * Limitation of url length. For IIS, see MaxClientRequestBuffer registry value. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 4. + + Currently unsupported: MetaDatabases, MetaTables and MetaColumns, and also inputarr in Execute. + Native types have been converted to MetaTypes. + Transactions not supported yet. + + Limitation of url length. For IIS, see MaxClientRequestBuffer registry value. + + http://support.microsoft.com/default.aspx?scid=kb;en-us;260694 +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-db2.inc.php b/drivers/adodb-db2.inc.php index 8f616fa6..4b63ef10 100644 --- a/drivers/adodb-db2.inc.php +++ b/drivers/adodb-db2.inc.php @@ -1,40 +1,36 @@ <?php /** - * IBM DB2 Native Client driver. - * - * Originally DB2 drivers were dependent on an ODBC driver, and some installations - * may still use that. To use an ODBC driver connection, use the odbc_db2 - * ADOdb driver. For Linux, you need the 'ibm_db2' PECL extension for PHP, - * For Windows, you need to locate an appropriate version of the php_ibm_db2.dll, - * as well as the IBM data server client software. - * This is basically a full rewrite of the original driver, for information - * about all the changes, see the update information on the ADOdb website - * for version 5.21.0. - * - * @link http://pecl.php.net/package/ibm_db2 PECL Extension For DB2 - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Mark Newnham - */ + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4 for best viewing. + +* Driver for use with IBM DB2 Native Client +* +* Originally DB2 drivers were dependent on an ODBC driver, and some installations +* may still use that. To use an ODBC driver connection, use the odbc_db2 +* ADOdb driver. For Linux, you need the 'ibm_db2' PECL extension for PHP, +* For Windows, you need to locate an appropriate version of the php_ibm_db2.dll, +* as well as the IBM data server client software. +* This is basically a full rewrite of the original driver, for information +* about all the changes, see the update information on the ADOdb website +* for version 5.21.0 +* +* @link http://pecl.php.net/package/ibm_db2 Pecl Extension For DB2 +* @author Mark Newnham +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); -define("_ADODB_DB2_LAYER", 2 ); + define("_ADODB_DB2_LAYER", 2 ); + +/*-------------------------------------------------------------------- +----------------------------------------------------------------------*/ class ADODB_db2 extends ADOConnection { diff --git a/drivers/adodb-db2oci.inc.php b/drivers/adodb-db2oci.inc.php index eea63d94..392fdce9 100644 --- a/drivers/adodb-db2oci.inc.php +++ b/drivers/adodb-db2oci.inc.php @@ -1,27 +1,17 @@ <?php -/** - * IBM DB2 / Oracle compatibility driver. - * - * This driver re-maps ibm :0 bind variables to oracle compatible ? variables. - * - * @deprecated - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. +Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + + Microsoft Visual FoxPro data driver. Requires ODBC. Works only on MS Windows. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-db2ora.inc.php b/drivers/adodb-db2ora.inc.php index d343a8ae..bbbafd74 100644 --- a/drivers/adodb-db2ora.inc.php +++ b/drivers/adodb-db2ora.inc.php @@ -1,28 +1,17 @@ <?php -/** - * IBM DB2 / Oracle compatibility driver. - * - * This driver provides undocumented bind variable mapping from ibm to oracle. - * The functionality appears to overlap the db2_oci driver. - * - * @deprecated - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. +Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + + Microsoft Visual FoxPro data driver. Requires ODBC. Works only on MS Windows. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-fbsql.inc.php b/drivers/adodb-fbsql.inc.php index 0fb895a1..a60a0295 100644 --- a/drivers/adodb-fbsql.inc.php +++ b/drivers/adodb-fbsql.inc.php @@ -1,24 +1,14 @@ <?php -/** - * Frontbase driver. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Frank M. Kromann <frank@frontbase.com> - */ +/* + @version v5.22.0-dev Unreleased + @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. + Contribution by Frank M. Kromann <frank@frontbase.com>. + Set tabs to 8. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -232,7 +222,19 @@ class ADORecordSet_fbsql extends ADORecordSet{ $t = $fieldobj->type; $len = $fieldobj->max_length; } + + $t = strtoupper($t); + + if (array_key_exists($t,$this->connection->customActualTypes)) + return $this->connection->customActualTypes[$t]; + $len = -1; // fbsql max_length is not accurate + + switch ($t) { + + + + switch (strtoupper($t)) { case 'CHARACTER': case 'CHARACTER VARYING': diff --git a/drivers/adodb-firebird.inc.php b/drivers/adodb-firebird.inc.php index 2fafbe4f..a164c71f 100644 --- a/drivers/adodb-firebird.inc.php +++ b/drivers/adodb-firebird.inc.php @@ -1,25 +1,18 @@ <?php -/** - * Firebird driver. - * - * Requires firebird client. Works on Windows and Unix. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. +Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + + firebird data driver. Requires firebird client. Works on Windows and Unix. + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -206,7 +199,7 @@ class ADODB_firebird extends ADOConnection { return $ret; } - function &MetaIndexes ($table, $primary = FALSE, $owner=false) + function metaIndexes ($table, $primary = FALSE, $owner=false) { // save old fetch mode global $ADODB_FETCH_MODE; @@ -233,10 +226,9 @@ class ADODB_firebird extends ADOConnection { $ADODB_FETCH_MODE = $save; return $false; } - $indexes = array(); while ($row = $rs->FetchRow()) { - $index = $row[0]; + $index = trim(preg_replace("/[\n\r]+/",'',$row[0])); if (!isset($indexes[$index])) { if (is_null($row[3])) { $row[3] = 0; @@ -836,10 +828,11 @@ class ADORecordset_firebird extends ADORecordSet global $ADODB_ANSI_PADDING_OFF; //$ADODB_ANSI_PADDING_OFF=1; $rtrim = !empty($ADODB_ANSI_PADDING_OFF); - + for ($i=0, $max = $this->_numOfFields; $i < $max; $i++) { if ($this->_cacheType[$i]=="BLOB") { - if (isset($f[$i])) { + if (isset($f[$i])) + { $f[$i] = $this->connection->_BlobDecode($f[$i]); } else { $f[$i] = null; @@ -892,7 +885,14 @@ class ADORecordset_firebird extends ADORecordSet $t = $fieldobj->type; $len = $fieldobj->max_length; } - switch (strtoupper($t)) { + + $t = strtoupper($t); + + if (array_key_exists($t,$this->connection->customActualTypes)) + return $this->connection->customActualTypes[$t]; + + switch ($t) { + case 'CHAR': return 'C'; diff --git a/drivers/adodb-ibase.inc.php b/drivers/adodb-ibase.inc.php index 69de30dc..a3d08f45 100644 --- a/drivers/adodb-ibase.inc.php +++ b/drivers/adodb-ibase.inc.php @@ -1,25 +1,29 @@ <?php -/** - * Interbase driver. - * - * Requires interbase client. Works on Windows and Unix. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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 https://adodb.org/ + + Interbase data driver. Requires interbase client. Works on Windows and Unix. + + 3 Jan 2002 -- suggestions by Hans-Peter Oeri <kampfcaspar75@oeri.ch> + changed transaction handling and added experimental blob stuff + + Docs to interbase at the website + http://www.synectics.co.za/php3/tutorial/IB_PHP3_API.html + + To use gen_id(), see + http://www.volny.cz/iprenosil/interbase/ip_ib_code.htm#_code_creategen + + $rs = $conn->Execute('select gen_id(adodb,1) from rdb$database'); + $id = $rs->fields[0]; + $conn->Execute("insert into table (id, col1,...) values ($id, $val1,...)"); +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -860,7 +864,14 @@ class ADORecordset_ibase extends ADORecordSet $t = $fieldobj->type; $len = $fieldobj->max_length; } - switch (strtoupper($t)) { + + $t = strtoupper($t); + + if (array_key_exists($t,$this->connection->customActualTypes)) + return $this->connection->customActualTypes[$t]; + + switch ($t) { + case 'CHAR': return 'C'; diff --git a/drivers/adodb-informix.inc.php b/drivers/adodb-informix.inc.php index 8e99137c..eb6e73ec 100644 --- a/drivers/adodb-informix.inc.php +++ b/drivers/adodb-informix.inc.php @@ -1,27 +1,19 @@ <?php /** - * Informix 9 driver. - * - * Supports SELECT FIRST. - * - * @deprecated - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +* @version v5.22.0-dev Unreleased +* @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. +* +* Set tabs to 4 for best viewing. +* +* Latest version is available at https://adodb.org/ +* +* Informix 9 driver that supports SELECT FIRST +* +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-informix72.inc.php b/drivers/adodb-informix72.inc.php index a9c43e23..4be09d37 100644 --- a/drivers/adodb-informix72.inc.php +++ b/drivers/adodb-informix72.inc.php @@ -1,27 +1,20 @@ <?php -/** - * Informix driver. - * - * @deprecated - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Mitchell T. Young <mitch@youngfamily.org> - * @author Samuel Carriere <samuel_carriere@hotmail.com> - */ +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + + Informix port by Mitchell T. Young (mitch@youngfamily.org) + + Further mods by "Samuel CARRIERE" <samuel_carriere@hotmail.com> + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-ldap.inc.php b/drivers/adodb-ldap.inc.php index 323b3585..8374c076 100644 --- a/drivers/adodb-ldap.inc.php +++ b/drivers/adodb-ldap.inc.php @@ -1,26 +1,20 @@ <?php -/** - * LDAP driver. - * - * Provides a subset of ADOdb commands, allowing read-only access to an LDAP database. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Joshua Eldridge <joshuae74@hotmail.com> - */ +/* + @version v5.22.0-dev Unreleased + @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. + Set tabs to 8. + + Revision 1: (02/25/2005) Updated codebase to include the _inject_bind_options function. This allows + users to access the options in the ldap_set_option function appropriately. Most importantly + LDAP Version 3 is now supported. See the examples for more information. Also fixed some minor + bugs that surfaced when PHP error levels were set high. + + Joshua Eldridge (joshuae74#hotmail.com) +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-mssql.inc.php b/drivers/adodb-mssql.inc.php index 3de3f8d3..784177b6 100644 --- a/drivers/adodb-mssql.inc.php +++ b/drivers/adodb-mssql.inc.php @@ -1,25 +1,21 @@ <?php -/** - * Native MSSQL driver. - * - * Requires mssql client. Works on Windows. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. +Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + + Native mssql driver. Requires mssql client. Works on Windows. + To configure for Unix, see + http://phpbuilder.com/columns/alberto20000919.php3 + +*/ + // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-mssql_n.inc.php b/drivers/adodb-mssql_n.inc.php index 236c1546..b8c650f1 100644 --- a/drivers/adodb-mssql_n.inc.php +++ b/drivers/adodb-mssql_n.inc.php @@ -1,27 +1,47 @@ <?php + +/// $Id $ + +/////////////////////////////////////////////////////////////////////////// +// // +// NOTICE OF COPYRIGHT // +// // +// ADOdb - Database Abstraction Library for PHP // +// // +// Latest version is available at https://adodb.org // +// // +// Copyright (c) 2000-2014 John Lim (jlim\@natsoft.com.my) // +// All rights reserved. // +// Released under both BSD license and LGPL library license. // +// Whenever there is any discrepancy between the two licenses, // +// the BSD license will take precedence // +// // +// Moodle - Modular Object-Oriented Dynamic Learning Environment // +// http://moodle.com // +// // +// Copyright (C) 2001-3001 Martin Dougiamas http://dougiamas.com // +// (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details: // +// // +// http://www.gnu.org/copyleft/gpl.html // +// // +/////////////////////////////////////////////////////////////////////////// + /** - * MSSQL Driver with auto-prepended "N" for correct unicode storage of SQL literal strings. - * - * Intended to be used with MSSQL drivers that are sending UCS-2 data to MSSQL - * (FreeTDS and ODBTP) in order to get true cross-db compatibility from the - * application point of view. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +* MSSQL Driver with auto-prepended "N" for correct unicode storage +* of SQL literal strings. Intended to be used with MSSQL drivers that +* are sending UCS-2 data to MSSQL (FreeTDS and ODBTP) in order to get +* true cross-db compatibility from the application point of view. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -40,7 +60,7 @@ class ADODB_mssql_n extends ADODB_mssql { return ADODB_mssql::_query($sql,$inputarr); } - /** + /** * This function will intercept all the literals used in the SQL, prepending the "N" char to them * in order to allow mssql to store properly data sent in the correct UCS-2 encoding (by freeTDS * and ODBTP) keeping SQL compatibility at ADOdb level (instead of hacking every project to add diff --git a/drivers/adodb-mssqlnative.inc.php b/drivers/adodb-mssqlnative.inc.php index 36dc5433..2943743e 100644 --- a/drivers/adodb-mssqlnative.inc.php +++ b/drivers/adodb-mssqlnative.inc.php @@ -1,26 +1,24 @@ <?php -/** - * Native MSSQL driver. - * - * Requires mssql client. Works on Windows. - * https://docs.microsoft.com/sql/connect/php - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. +Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + + Native mssql driver. Requires mssql client. Works on Windows. + http://www.microsoft.com/sql/technologies/php/default.mspx + To configure for Unix, see + http://phpbuilder.com/columns/alberto20000919.php3 + + $stream = sqlsrv_get_field($stmt, $index, SQLSRV_SQLTYPE_STREAM(SQLSRV_ENC_BINARY)); + stream_filter_append($stream, "convert.iconv.ucs-2/utf-8"); // Voila, UTF-8 can be read directly from $stream + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -298,25 +296,22 @@ class ADODB_mssqlnative extends ADOConnection { // Format date column in sql string given an input format that understands Y M D function SQLDate($fmt, $col=false) { - if (!$col) { - $col = $this->sysTimeStamp; - } + if (!$col) $col = $this->sysTimeStamp; $s = ''; $ConvertableFmt=array( - "m/d/Y"=>101, "m/d/y"=>101 // US - ,"Y.m.d"=>102, "y.m.d"=>102 // ANSI - ,"d/m/Y"=>103, "d/m/y"=>103 // French /english - ,"d.m.Y"=>104, "d.m.y"=>104 // German - ,"d-m-Y"=>105, "d-m-y"=>105 // Italian - ,"m-d-Y"=>110, "m-d-y"=>110 // US Dash - ,"Y/m/d"=>111, "y/m/d"=>111 // Japan - ,"Ymd"=>112, "ymd"=>112 // ISO - ,"H:i:s"=>108 // Time + "m/d/Y"=>101,"m/d/y"=>101 // US + ,"Y.m.d"=>102,"y/m/d"=>102 // ANSI + ,"d/m/Y"=>103,"d/m/y"=>103 // French /english + ,"d.m.Y"=>104,"d.m.y"=>104 // German + ,"d-m-Y"=>105,"d-m-y"=>105 // Italian + ,"m-d-Y"=>110,"m-d-y"=>110 // US Dash + ,"Y/m/d"=>111,"y/m/d"=>111 // Japan + ,"Ymd"=>112,"ymd"=>112 // ISO + ,"H:i:s"=>108 // Time ); - if (key_exists($fmt,$ConvertableFmt)) { - return "convert (varchar ,$col," . $ConvertableFmt[$fmt] . ")"; - } + if(key_exists($fmt,$ConvertableFmt)) + return "convert (varchar ,$col,".$ConvertableFmt[$fmt].")"; $len = strlen($fmt); for ($i=0; $i < $len; $i++) { @@ -766,7 +761,7 @@ class ADODB_mssqlnative extends ADOConnection { function MetaDatabases() { $this->SelectDB("master"); - $rs = $this->Execute($this->metaDatabasesSQL); + $rs =& $this->Execute($this->metaDatabasesSQL); $rows = $rs->GetRows(); $ret = array(); for($i=0;$i<count($rows);$i++) { @@ -1008,6 +1003,37 @@ class ADODB_mssqlnative extends ADOConnection { return $metaProcedures; } + + /** + * An SQL Statement that adds a specific number of + * days or part to local datetime + * + * @param float $dayFraction + * @param string $date + * + * @return string + */ + public function offsetDate($dayFraction, $date = false) + { + if (!$date) + /* + * Use GETDATE() via systTimestamp; + */ + $date = $this->sysTimeStamp; + + /* + * seconds, number of seconds, date base + */ + $dateFormat = "DATEADD(s, %s, %s)"; + + /* + * Adjust the offset back to seconds + */ + $fraction = $dayFraction * 24 * 3600; + + return sprintf($dateFormat,$fraction,$date); + + } } @@ -1022,8 +1048,13 @@ class ADORecordset_mssqlnative extends ADORecordSet { var $fieldOffset = 0; // _mths works only in non-localised system - /** - * @var bool True if we have retrieved the fields metadata + /* + * Holds a cached version of the metadata + */ + private $fieldObjects = false; + + /* + * Flags if we have retrieved the metadata */ private $fieldObjectsRetrieved = false; @@ -1032,6 +1063,7 @@ class ADORecordset_mssqlnative extends ADORecordSet { */ private $fieldObjectsIndex = array(); + /* * Cross references the dateTime objects for faster decoding */ @@ -1142,56 +1174,48 @@ class ADORecordset_mssqlnative extends ADORecordSet { * the next field that wasn't yet retrieved by fetchField() * is retrieved. * - * @param int $fieldOffset (optional default=-1 for all - * @return mixed an ADOFieldObject, or array of objects + * $param int $fieldOffset (optional default=-1 for all + * @return ADOFieldObject|ADOFieldObject[]|false */ private function _fetchField($fieldOffset = -1) { - if ($this->fieldObjectsRetrieved) { - if ($this->fieldObjectsCache) { - // Already got the information - if ($fieldOffset == -1) { - return $this->fieldObjectsCache; - } else { - return $this->fieldObjectsCache[$fieldOffset]; + if (!$this->fieldObjectsRetrieved) { + // Retrieve all metadata in one go + $fieldMetaData = sqlsrv_field_metadata($this->_queryID); + if ($fieldMetaData) { + $this->_numOfFields = count($fieldMetaData); + foreach ($fieldMetaData as $key => $value) { + $fld = new ADOFieldObject; + // Caution - keys are case-sensitive, must respect casing of values + $fld->name = $value['Name']; + $fld->max_length = $value['Size']; + $fld->column_source = $value['Name']; + $fld->type = $this->_typeConversion[$value['Type']]; + + $this->fieldObjects[$key] = $fld; + $this->fieldObjectsIndex[$fld->name] = $key; } } else { - // No metadata available - return false; + $this->_numOfFields = -1; + $this->fieldObjects = false; + $this->fieldObjectsIndex = array(); } + $this->fieldObjectsRetrieved = true; } - $this->fieldObjectsRetrieved = true; - /* - * Retrieve all metadata in one go. This is always returned as a - * numeric array. - */ - $fieldMetaData = sqlsrv_field_metadata($this->_queryID); - - if (!$fieldMetaData) { - // Not a statement that gives us metaData - return false; - } - - $this->_numOfFields = count($fieldMetaData); - foreach ($fieldMetaData as $key=>$value) { - $fld = new ADOFieldObject; - // Caution - keys are case-sensitive, must respect casing of values - $fld->name = $value['Name']; - $fld->max_length = $value['Size']; - $fld->column_source = $value['Name']; - $fld->type = $this->_typeConversion[$value['Type']]; - - $this->fieldObjectsCache[$key] = $fld; - $this->fieldObjectsIndex[$fld->name] = $key; - } - if ($fieldOffset == -1) { - return $this->fieldObjectsCache; + if ($this->fieldObjects) { + if ($fieldOffset == -1) { + return $this->fieldObjects; + } else { + return $this->fieldObjects[$fieldOffset]; + } } - return $this->fieldObjectsCache[$fieldOffset]; + // No metadata available + return false; } + /* * Fetchfield copies the oracle method, it loads the field information * into the _fieldobjs array once, to save multiple calls to the @@ -1206,7 +1230,7 @@ class ADORecordset_mssqlnative extends ADORecordSet { */ function fetchField($fieldOffset = -1) { - return $this->fieldObjectsCache[$fieldOffset]; + return $this->fieldObjects[$fieldOffset]; } function _seek($row) diff --git a/drivers/adodb-mssqlpo.inc.php b/drivers/adodb-mssqlpo.inc.php index f2d2f6fb..700725f4 100644 --- a/drivers/adodb-mssqlpo.inc.php +++ b/drivers/adodb-mssqlpo.inc.php @@ -1,27 +1,29 @@ <?php /** - * Portable MSSQL Driver that supports || instead of +. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +* @version v5.22.0-dev Unreleased +* @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. +* +* Set tabs to 4 for best viewing. +* +* Latest version is available at https://adodb.org/ +* +* Portable MSSQL Driver that supports || instead of + +* +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); + +/* + The big difference between mssqlpo and it's parent mssql is that mssqlpo supports + the more standard || string concatenation operator. +*/ + include_once(ADODB_DIR.'/drivers/adodb-mssql.inc.php'); class ADODB_mssqlpo extends ADODB_mssql { diff --git a/drivers/adodb-mysql.inc.php b/drivers/adodb-mysql.inc.php index f07c081b..5232571d 100644 --- a/drivers/adodb-mysql.inc.php +++ b/drivers/adodb-mysql.inc.php @@ -1,30 +1,22 @@ <?php -/** - * MySQL driver - * - * @deprecated - * - * This driver only supports the original non-transactional MySQL driver, - * which was deprecated in PHP version 5.5 and removed in PHP version 7. - * It is deprecated as of ADOdb version 5.20.0, use the mysqli driver - * instead, which supports both transactional and non-transactional updates. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 8. + + This driver only supports the original non-transactional MySQL driver. It + is deprecated in PHP version 5.5 and removed in PHP version 7. It is deprecated + as of ADOdb version 5.20.0. Use the mysqli driver instead, which supports both + transactional and non-transactional updates + + Requires mysql client. Works on Windows and Unix. + + 28 Feb 2001: MetaColumns bug fix - suggested by Freek Dijkstra (phpeverywhere@macfreek.com) +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -869,9 +861,15 @@ class ADORecordSet_mysql extends ADORecordSet{ $t = $fieldobj->type; $len = $fieldobj->max_length; } + + $t = strtoupper($t); + + if (array_key_exists($t,$this->connection->customActualTypes)) + return $this->connection->customActualTypes[$t]; $len = -1; // mysql max_length is not accurate - switch (strtoupper($t)) { + + switch ($t) { case 'STRING': case 'CHAR': case 'VARCHAR': diff --git a/drivers/adodb-mysqli.inc.php b/drivers/adodb-mysqli.inc.php index 352810cc..1539580a 100644 --- a/drivers/adodb-mysqli.inc.php +++ b/drivers/adodb-mysqli.inc.php @@ -1,28 +1,23 @@ <?php -/** - * MySQL improved driver (mysqli) - * - * This is the preferred driver for MySQL connections. It supports both - * transactional and non-transactional table types. You can use this as a - * drop-in replacement for both the mysql and mysqlt drivers. - * As of ADOdb Version 5.20.0, all other native MySQL drivers are deprecated. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 8. + + This is the preferred driver for MySQL connections, and supports both transactional + and non-transactional table types. You can use this as a drop-in replacement for both + the mysql and mysqlt drivers. As of ADOdb Version 5.20.0, all other native MySQL drivers + are deprecated + + Requires mysql client. Works on Windows and Unix. + +21 October 2003: MySQLi extension implementation by Arjen de Rijke (a.de.rijke@xs4all.nl) +Based on adodb 3.40 +*/ // security - hide paths if (!defined('ADODB_DIR')) { @@ -81,11 +76,8 @@ class ADODB_mysqli extends ADOConnection { */ private $usePreparedStatement = false; private $useLastInsertStatement = false; - - /** - * @var bool True if the last executed statement is a SELECT {@see _query()} - */ - private $isSelectStatement = false; + private $usingBoundVariables = false; + private $statementAffectedRows = -1; /** * Sets the isolation level of a transaction. @@ -189,6 +181,8 @@ class ADODB_mysqli extends ADOConnection { // SSL Connections for MySQLI if ($this->ssl_key || $this->ssl_cert || $this->ssl_ca || $this->ssl_capath || $this->ssl_cipher) { mysqli_ssl_set($this->_connectionID, $this->ssl_key, $this->ssl_cert, $this->ssl_ca, $this->ssl_capath, $this->ssl_cipher); + $this->socket = MYSQLI_CLIENT_SSL; + $this->clientFlags = MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT; } #if (!empty($this->port)) $argHostname .= ":".$this->port; @@ -439,12 +433,9 @@ class ADODB_mysqli extends ADOConnection { */ function _affectedrows() { - if ($this->isSelectStatement) { - // Affected rows works fine against selects, returning - // the rowcount, but ADOdb does not do that. - return false; - } - + if ($this->usingBoundVariables) + return $this->statementAffectedRows; + $result = @mysqli_affected_rows($this->_connectionID); if ($result == -1) { if ($this->debug) ADOConnection::outp("mysqli_affected_rows() failed : " . $this->errorMsg()); @@ -1039,6 +1030,7 @@ class ADODB_mysqli extends ADOConnection { /** * Prepares an SQL statement and returns a handle to use. + * This is not used by bound parameters anymore * * @link https://adodb.org/dokuwiki/doku.php?id=v5:reference:connection:prepare * @todo update this function to handle prepared statements correctly @@ -1067,13 +1059,86 @@ class ADODB_mysqli extends ADOConnection { } /** - * Return the query id. + * Execute SQL * - * @param string|array $sql - * @param array $inputarr + * @param string $sql SQL statement to execute, or possibly an array + * holding prepared statement ($sql[0] will hold sql text) + * @param array|bool $inputarr holds the input data to bind to. + * Null elements will be set to null. * - * @return bool|mysqli_result + * @return ADORecordSet|bool */ + public function execute($sql, $inputarr = false) { + + if ($this->fnExecute) { + $fn = $this->fnExecute; + $ret = $fn($this,$sql,$inputarr); + if (isset($ret)) { + return $ret; + } + } + + if ($inputarr === false) { + return $this->_execute($sql,false); + } + + if (!is_array($inputarr)) { + $inputarr = array($inputarr); + } + + if (!is_array($sql)) { + + + + $typeString = ''; + $typeArray = array(''); //placeholder for type list + + foreach ($inputarr as $v) + { + $typeArray[] = $v; + if (is_integer($v) || is_bool($v)) + $typeString .= 'i'; + + else if (is_float($v)) + $typeString .= 'd'; + + else if(is_object($v)) + /* + * Assume a blob + */ + $typeString .= 'b'; + + else + $typeString .= 's'; + + } + + /* + * Place the field type list at the front of the + * parameter array. This is the mysql specific + * format + */ + $typeArray[0] = $typeString; + + $ret = $this->_execute($sql,$typeArray); + if (!$ret) { + return $ret; + } + + } else { + $ret = $this->_execute($sql,$inputarr); + } + return $ret; + } + + /** + * Return the query id. + * + * @param string|array $sql + * @param array $inputarr + * + * @return bool|mysqli_result + */ function _query($sql, $inputarr) { global $ADODB_COUNTRECS; @@ -1108,6 +1173,90 @@ class ADODB_mysqli extends ADOConnection { $ret = mysqli_stmt_execute($stmt); return $ret; } + else if (is_string($sql) && is_array($inputarr)) + { + /* + * This is support for true prepared queries + * with bound parameters + * + * set prepared statement flags + */ + $this->usePreparedStatement = true; + $this->usingBoundVariables = true; + + /* + * Prepare the statement with the placeholders, + * prepare will fail if the statement is invalid + * so we trap and error if necessary. Note that we + * are calling MySQL prepare here, not ADOdb + */ + $stmt = $this->_connectionID->prepare($sql); + if ($stmt === false) + { + $this->outp_throw( + "SQL Statement failed on preparation: " . htmlspecialchars($sql) . "'", + 'Execute' + ); + return false; + } + /* + * Make sure the number of parameters provided in the input + * array matches what the query expects. We must discount + * the first parameter which contains the data types in + * our inbound parameters + */ + $nparams = $stmt->param_count; + + if ($nparams != count($inputarr) - 1) { + $this->outp_throw( + "Input array has " . count($inputarr) . + " params, does not match query: '" . htmlspecialchars($sql) . "'", + 'Execute' + ); + return false; + } + + /* + * Must pass references into call_user_func_array + */ + $paramsByReference = array(); + foreach($inputarr as $key => $value) + $paramsByReference[$key] = &$inputarr[$key]; + + /* + * Bind the params + */ + call_user_func_array(array($stmt, 'bind_param'), $paramsByReference); + + /* + * Execute + */ + $ret = mysqli_stmt_execute($stmt); + + /* + * Did we throw an error? + */ + if ($ret == false) + return false; + + /* + * Is the statement a non-select + */ + if ($stmt->affected_rows > -1) + { + $this->statementAffectedRows = $stmt->affected_rows; + return true; + } + /* + * Turn the statement into a result set + */ + $result = $stmt->get_result(); + /* + * Return the object for the select + */ + return $result; + + } else { /* @@ -1126,7 +1275,7 @@ class ADODB_mysqli extends ADOConnection { return $mysql_res; */ - + if ($this->multiQuery) { $rs = mysqli_multi_query($this->_connectionID, $sql.';'); if ($rs) { @@ -1135,10 +1284,8 @@ class ADODB_mysqli extends ADOConnection { } } else { $rs = mysqli_query($this->_connectionID, $sql, $ADODB_COUNTRECS ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT); - if ($rs) { - $this->isSelectStatement = is_object($rs); - return $rs; - } + + if ($rs) return $rs; } if($this->debug) @@ -1511,6 +1658,7 @@ class ADORecordSet_mysqli extends ADORecordSet{ 12 = MYSQLI_TYPE_DATETIME 13 = MYSQLI_TYPE_YEAR 14 = MYSQLI_TYPE_NEWDATE +245 = MYSQLI_TYPE_JSON 247 = MYSQLI_TYPE_ENUM 248 = MYSQLI_TYPE_SET 249 = MYSQLI_TYPE_TINY_BLOB @@ -1531,7 +1679,7 @@ class ADORecordSet_mysqli extends ADORecordSet{ * * @return string The MetaType */ - function MetaType($t, $len = -1, $fieldobj = false) + function metaType($t, $len = -1, $fieldobj = false) { if (is_object($t)) { $fieldobj = $t; @@ -1539,8 +1687,16 @@ class ADORecordSet_mysqli extends ADORecordSet{ $len = $fieldobj->max_length; } + $t = strtoupper($t); + /* + * Add support for custom actual types. We do this + * first, that allows us to override existing types + */ + if (array_key_exists($t,$this->connection->customActualTypes)) + return $this->connection->customActualTypes[$t]; + $len = -1; // mysql max_length is not accurate - switch (strtoupper($t)) { + switch ($t) { case 'STRING': case 'CHAR': case 'VARCHAR': @@ -1618,6 +1774,8 @@ class ADORecordSet_mysqli extends ADORecordSet{ case 'DEC': case 'FIXED': default: + + //if (!is_numeric($t)) echo "<p>--- Error in type matching $t -----</p>"; return 'N'; } @@ -1647,9 +1805,15 @@ class ADORecordSet_array_mysqli extends ADORecordSet_array $t = $fieldobj->type; $len = $fieldobj->max_length; } + + $t = strtoupper($t); + + if (array_key_exists($t,$this->connection->customActualTypes)) + return $this->connection->customActualTypes[$t]; $len = -1; // mysql max_length is not accurate - switch (strtoupper($t)) { + + switch ($t) { case 'STRING': case 'CHAR': case 'VARCHAR': diff --git a/drivers/adodb-mysqlpo.inc.php b/drivers/adodb-mysqlpo.inc.php index 8aa7779a..3908fc50 100644 --- a/drivers/adodb-mysqlpo.inc.php +++ b/drivers/adodb-mysqlpo.inc.php @@ -1,30 +1,24 @@ <?php -/** - * Portable MySQL driver - * - * @deprecated - * - * Extends the deprecated mysql driver, and was originally designed to be a - * portable driver in the same manner as oci8po and mssqlpo. Its functionality - * is exactly duplicated in the mysqlt driver, which is itself deprecated. - * This driver will be removed in ADOdb version 6.0.0. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 8. + + MySQL code that supports transactions. For MySQL 3.23 or later. + Code from James Poon <jpoon88@yahoo.com> + + This driver extends the deprecated mysql driver, and was originally designed to be a + portable driver in the same manner as oci8po and mssqlpo. Its functionality + is exactly duplicated in the mysqlt driver, which is itself deprecated. + This driver will be removed in ADOdb version 6.0.0. + + Requires mysql client. Works on Windows and Unix. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-mysqlt.inc.php b/drivers/adodb-mysqlt.inc.php index cccd93f8..02a3c99c 100644 --- a/drivers/adodb-mysqlt.inc.php +++ b/drivers/adodb-mysqlt.inc.php @@ -1,30 +1,21 @@ <?php -/** - * MySQL driver in transactional mode - * - * @deprecated - * - * This driver only supports the original MySQL driver in transactional mode. It - * is deprecated in PHP version 5.5 and removed in PHP version 7. It is deprecated - * as of ADOdb version 5.20.0. Use the mysqli driver instead, which supports both - * transactional and non-transactional updates - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 8. + + This driver only supports the original MySQL driver in transactional mode. It + is deprecated in PHP version 5.5 and removed in PHP version 7. It is deprecated + as of ADOdb version 5.20.0. Use the mysqli driver instead, which supports both + transactional and non-transactional updates + + Requires mysql client. Works on Windows and Unix. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-netezza.inc.php b/drivers/adodb-netezza.inc.php index dc7c58e4..071c2578 100644 --- a/drivers/adodb-netezza.inc.php +++ b/drivers/adodb-netezza.inc.php @@ -1,35 +1,21 @@ <?php -/** - * Netezza Driver - * - * @link https://www.ibm.com/products/netezza - * Based on the previous postgres drivers. Major Additions/Changes: - * - MetaDatabasesSQL, MetaTablesSQL, MetaColumnsSQL - * Note: You have to have admin privileges to access the system tables - * - Removed non-working keys code (Netezza has no concept of keys) - * - Fixed the way data types and lengths are returned in MetaColumns() - * as well as added the default lengths for certain types - * - Updated public variables for Netezza - * TODO: Still need to remove blob functions, as Netezza doesn't support blob - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Josh Eldridge <joshuae74@hotmail.com> - */ +/* + @version v5.22.0-dev Unreleased + @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved. + @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community + First cut at the Netezza Driver by Josh Eldridge joshuae74#hotmail.com + Based on the previous postgres drivers. + http://www.netezza.com/ + Major Additions/Changes: + MetaDatabasesSQL, MetaTablesSQL, MetaColumnsSQL + Note: You have to have admin privileges to access the system tables + Removed non-working keys code (Netezza has no concept of keys) + Fixed the way data types and lengths are returned in MetaColumns() + as well as added the default lengths for certain types + Updated public variables for Netezza + Still need to remove blob functions, as Netezza doesn't support blob +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-oci8.inc.php b/drivers/adodb-oci8.inc.php index e541b6b6..ade82b38 100644 --- a/drivers/adodb-oci8.inc.php +++ b/drivers/adodb-oci8.inc.php @@ -1,25 +1,20 @@ <?php -/** - * FileDescription - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author John Lim - * @author George Fourlanos <fou@infomap.gr> - */ +/* + + @version v5.22.0-dev Unreleased + @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 https://adodb.org/ + + Code contributed by George Fourlanos <fou@infomap.gr> + + 13 Nov 2000 jlim - removed all ora_* references. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -1809,8 +1804,13 @@ class ADORecordset_oci8 extends ADORecordSet { $t = $fieldobj->type; $len = $fieldobj->max_length; } + + $t = strtoupper($t); + + if (array_key_exists($t,$this->connection->customActualTypes)) + return $this->connection->customActualTypes[$t]; - switch (strtoupper($t)) { + switch ($t) { case 'VARCHAR': case 'VARCHAR2': case 'CHAR': diff --git a/drivers/adodb-oci805.inc.php b/drivers/adodb-oci805.inc.php index 01958282..c74419d6 100644 --- a/drivers/adodb-oci805.inc.php +++ b/drivers/adodb-oci805.inc.php @@ -1,27 +1,18 @@ <?php /** - * Oracle 8.0.5 (oci8) driver + * @version v5.22.0-dev Unreleased + * @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. * - * @deprecated + * Set tabs to 4 for best viewing. * - * Optimizes selectLimit() performance with FIRST_ROWS hint. + * Latest version is available at https://adodb.org/ * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + * Oracle 8.0.5 driver +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-oci8po.inc.php b/drivers/adodb-oci8po.inc.php index 50630cad..a64e5207 100644 --- a/drivers/adodb-oci8po.inc.php +++ b/drivers/adodb-oci8po.inc.php @@ -1,28 +1,23 @@ <?php -/** - * Portable version of Oracle oci8 driver - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * Portable version of oci8 driver, to make it more similar to other database - * drivers. The main differences are - * 1. that the OCI_ASSOC names are in lowercase instead of uppercase. - * 2. bind variables are mapped using ? instead of :<bindvar> - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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 https://adodb.org/ + + Portable version of oci8 driver, to make it more similar to other database drivers. + The main differences are + + 1. that the OCI_ASSOC names are in lowercase instead of uppercase. + 2. bind variables are mapped using ? instead of :<bindvar> + + Should some emulation of RecordCount() be implemented? + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-oci8quercus.inc.php b/drivers/adodb-oci8quercus.inc.php index f9312c9d..8fd7abf6 100644 --- a/drivers/adodb-oci8quercus.inc.php +++ b/drivers/adodb-oci8quercus.inc.php @@ -1,23 +1,23 @@ <?php -/** - * Oracle "quercus" driver. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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 https://adodb.org/ + + Portable version of oci8 driver, to make it more similar to other database drivers. + The main differences are + + 1. that the OCI_ASSOC names are in lowercase instead of uppercase. + 2. bind variables are mapped using ? instead of :<bindvar> + + Should some emulation of RecordCount() be implemented? + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-odbc.inc.php b/drivers/adodb-odbc.inc.php index a9705e2d..e8a067d9 100644 --- a/drivers/adodb-odbc.inc.php +++ b/drivers/adodb-odbc.inc.php @@ -1,24 +1,17 @@ <?php -/** - * Base ODBC driver - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. +Set tabs to 4 for best viewing. + Latest version is available at https://adodb.org/ + + Requires ODBC. Works on Windows and Unix. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-odbc_db2.inc.php b/drivers/adodb-odbc_db2.inc.php index 8f0e60cb..9468b86f 100644 --- a/drivers/adodb-odbc_db2.inc.php +++ b/drivers/adodb-odbc_db2.inc.php @@ -1,23 +1,92 @@ <?php -/** - * DB2 driver via ODBC - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. +Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + + DB2 data driver. Requires ODBC. + +From phpdb list: + +Hi Andrew, + +thanks a lot for your help. Today we discovered what +our real problem was: + +After "playing" a little bit with the php-scripts that try +to connect to the IBM DB2, we set the optional parameter +Cursortype when calling odbc_pconnect(....). + +And the exciting thing: When we set the cursor type +to SQL_CUR_USE_ODBC Cursor Type, then +the whole query speed up from 1 till 10 seconds +to 0.2 till 0.3 seconds for 100 records. Amazing!!! + +Therefore, PHP is just almost fast as calling the DB2 +from Servlets using JDBC (don't take too much care +about the speed at whole: the database was on a +completely other location, so the whole connection +was made over a slow network connection). + +I hope this helps when other encounter the same +problem when trying to connect to DB2 from +PHP. + +Kind regards, +Christian Szardenings + +2 Oct 2001 +Mark Newnham has discovered that the SQL_CUR_USE_ODBC is not supported by +IBM's DB2 ODBC driver, so this must be a 3rd party ODBC driver. + +From the IBM CLI Reference: + +SQL_ATTR_ODBC_CURSORS (DB2 CLI v5) +This connection attribute is defined by ODBC, but is not supported by DB2 +CLI. Any attempt to set or get this attribute will result in an SQLSTATE of +HYC00 (Driver not capable). + +A 32-bit option specifying how the Driver Manager uses the ODBC cursor +library. + +So I guess this means the message [above] was related to using a 3rd party +odbc driver. + +Setting SQL_CUR_USE_ODBC +======================== +To set SQL_CUR_USE_ODBC for drivers that require it, do this: + +$db = NewADOConnection('odbc_db2'); +$db->curMode = SQL_CUR_USE_ODBC; +$db->Connect($dsn, $userid, $pwd); + + + +USING CLI INTERFACE +=================== + +I have had reports that the $host and $database params have to be reversed in +Connect() when using the CLI interface. From Halmai Csongor csongor.halmai#nexum.hu: + +> The symptom is that if I change the database engine from postgres or any other to DB2 then the following +> connection command becomes wrong despite being described this version to be correct in the docs. +> +> $connection_object->Connect( $DATABASE_HOST, $DATABASE_AUTH_USER_NAME, $DATABASE_AUTH_PASSWORD, $DATABASE_NAME ) +> +> In case of DB2 I had to swap the first and last arguments in order to connect properly. + + +System Error 5 +============== +IF you get a System Error 5 when trying to Connect/Load, it could be a permission problem. Give the user connecting +to DB2 full rights to the DB2 SQLLIB directory, and place the user in the DBUSERS group. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-odbc_mssql.inc.php b/drivers/adodb-odbc_mssql.inc.php index 37185aac..2c06885c 100644 --- a/drivers/adodb-odbc_mssql.inc.php +++ b/drivers/adodb-odbc_mssql.inc.php @@ -1,23 +1,18 @@ <?php -/** - * MSSQL driver via ODBC - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. +Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + + MSSQL support via ODBC. Requires ODBC. Works on Windows and Unix. + For Unix configuration, see http://phpbuilder.com/columns/alberto20000919.php3 +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-odbc_mssql2012.inc.php b/drivers/adodb-odbc_mssql2012.inc.php index 79fa3251..558ee2ee 100644 --- a/drivers/adodb-odbc_mssql2012.inc.php +++ b/drivers/adodb-odbc_mssql2012.inc.php @@ -1,23 +1,14 @@ <?php -/** - * Microsoft SQL Server 2012 driver via ODBC - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* + @version v5.22.0-dev Unreleased + @copyright (c) 2015 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. + Set tabs to 4. + + Microsoft SQL Server 2012 via ODBC +*/ if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-odbc_oracle.inc.php b/drivers/adodb-odbc_oracle.inc.php index d8461e1a..a2e389a5 100644 --- a/drivers/adodb-odbc_oracle.inc.php +++ b/drivers/adodb-odbc_oracle.inc.php @@ -1,24 +1,17 @@ <?php -/** - * Oracle driver via ODBC - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. +Set tabs to 4 for best viewing. + Latest version is available at https://adodb.org/ + + Oracle support via ODBC. Requires ODBC. Works on Windows. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-odbtp.inc.php b/drivers/adodb-odbtp.inc.php index bd167a1c..c829744f 100644 --- a/drivers/adodb-odbtp.inc.php +++ b/drivers/adodb-odbtp.inc.php @@ -1,26 +1,15 @@ <?php -/** - * ODBTP driver - * - * @deprecated will be removed in ADOdb version 6 - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author stefan bogdan <sbogdan@rsb.ro> - */ +/* + @version v5.22.0-dev Unreleased + @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 https://adodb.org/ +*/ +// Code contributed by "stefan bogdan" <sbogdan#rsb.ro> // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-odbtp_unicode.inc.php b/drivers/adodb-odbtp_unicode.inc.php index 190c3ab5..bbe67af7 100644 --- a/drivers/adodb-odbtp_unicode.inc.php +++ b/drivers/adodb-odbtp_unicode.inc.php @@ -1,36 +1,30 @@ <?php -/** - * ODBTP Unicode driver. - * - * @deprecated will be removed in ADOdb version 6 - * - * Because the ODBTP server sends and reads UNICODE text data using UTF-8 - * encoding, the following HTML meta tag must be included within the HTML - * head section of every HTML form and script page: - * <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - * Also, all SQL query strings must be submitted as UTF-8 encoded text. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Robert Twitty <rtwitty@neutron.ushmm.org> - */ +/* + @version v5.22.0-dev Unreleased + @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 https://adodb.org/ +*/ + +// Code contributed by "Robert Twitty" <rtwitty#neutron.ushmm.org> // security - hide paths if (!defined('ADODB_DIR')) die(); +/* + Because the ODBTP server sends and reads UNICODE text data using UTF-8 + encoding, the following HTML meta tag must be included within the HTML + head section of every HTML form and script page: + + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + + Also, all SQL query strings must be submitted as UTF-8 encoded text. +*/ + if (!defined('_ADODB_ODBTP_LAYER')) { include_once(ADODB_DIR."/drivers/adodb-odbtp.inc.php"); } diff --git a/drivers/adodb-oracle.inc.php b/drivers/adodb-oracle.inc.php index 1a2735b1..256533b8 100644 --- a/drivers/adodb-oracle.inc.php +++ b/drivers/adodb-oracle.inc.php @@ -1,25 +1,18 @@ <?php -/** - * Oracle data driver - * - * @deprecated Use oci8 driver instead - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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 https://adodb.org/ + + Oracle data driver. Requires Oracle client. Works on Windows and Unix and Oracle 7. + + If you are using Oracle 8 or later, use the oci8 driver which is much better and more reliable. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-pdo.inc.php b/drivers/adodb-pdo.inc.php index 0933bf14..e59dbd90 100644 --- a/drivers/adodb-pdo.inc.php +++ b/drivers/adodb-pdo.inc.php @@ -1,23 +1,23 @@ <?php /** - * ADOdb base PDO driver - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + + Requires ODBC. Works on Windows and Unix. + + Problems: + Where is float/decimal type in pdo_param_type + LOB handling for CLOB/BLOB differs significantly +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -238,6 +238,26 @@ class ADODB_pdo extends ADOConnection { return call_user_func_array('parent::Concat', $args); } + /** + * Triggers a driver-specific request for a bind parameter + * + * @param string $name + * @param string $type + * + * @return string + */ + public function param($name,$type='C') { + + $args = func_get_args(); + if(method_exists($this->_driver, 'param')) { + // Return the driver specific entry, that mimics the native driver + return call_user_func_array(array($this->_driver, 'param'), $args); + } + + // No driver specific method defined, use mysql format '?' + return call_user_func_array('parent::param', $args); + } + // returns true or false function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename) { @@ -273,10 +293,10 @@ class ADODB_pdo extends ADOConnection { return $this->_driver->MetaColumns($table,$normalize); } - public function metaIndexes($table,$normalize=true) + public function metaIndexes($table,$normalize=true,$owner=false) { if (method_exists($this->_driver,'metaIndexes')) - return $this->_driver->metaIndexes($table,$normalize); + return $this->_driver->metaIndexes($table,$normalize,$owner); } /** @@ -565,6 +585,7 @@ class ADODB_pdo extends ADOConnection { $this->_driver->debug = $this->debug; } if ($inputarr) { + /* * inputarr must be numeric */ diff --git a/drivers/adodb-pdo_dblib.inc.php b/drivers/adodb-pdo_dblib.inc.php index aae561bf..f2ea97e6 100644 --- a/drivers/adodb-pdo_dblib.inc.php +++ b/drivers/adodb-pdo_dblib.inc.php @@ -2,21 +2,13 @@ /** * ADOdb PDO dblib driver. * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. + * 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. * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2019 Damien Regad, Mark Newnham and the ADOdb community + * @version v5.22.0-dev Unreleased + * @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved. + * @copyright (c) 2019 Damien Regad, Mark Newnham and the ADOdb community */ class ADODB_pdo_dblib extends ADODB_pdo diff --git a/drivers/adodb-pdo_firebird.inc.php b/drivers/adodb-pdo_firebird.inc.php index 0ee5e02b..6e1f0544 100644 --- a/drivers/adodb-pdo_firebird.inc.php +++ b/drivers/adodb-pdo_firebird.inc.php @@ -1,24 +1,19 @@ <?php /** - * PDO Firebird driver + * ADOdb PDO Firebird driver * - * This version has only been tested on Firebird 3.0 and PHP 7 + * @version v5.22.0-dev Unreleased + * @copyright (c) 2019 Damien Regad, Mark Newnham and the ADOdb community * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. + * 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. * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker + * Set tabs to 4 for best viewing. * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later + * Latest version is available at https://adodb.org/ * - * @copyright 2000-2013 John Lim - * @copyright 2019 Damien Regad, Mark Newnham and the ADOdb community + * This version has only been tested on Firebird 3.0 and PHP 7 */ /** diff --git a/drivers/adodb-pdo_mssql.inc.php b/drivers/adodb-pdo_mssql.inc.php index ef63b654..2c02377a 100644 --- a/drivers/adodb-pdo_mssql.inc.php +++ b/drivers/adodb-pdo_mssql.inc.php @@ -1,23 +1,16 @@ <?php -/** - * PDO MSSQL driver - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + + +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 8. + +*/ class ADODB_pdo_mssql extends ADODB_pdo { diff --git a/drivers/adodb-pdo_mysql.inc.php b/drivers/adodb-pdo_mysql.inc.php index c8812453..18bb1655 100644 --- a/drivers/adodb-pdo_mysql.inc.php +++ b/drivers/adodb-pdo_mysql.inc.php @@ -1,23 +1,14 @@ <?php -/** - * PDO MySQL driver - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 8. + +*/ class ADODB_pdo_mysql extends ADODB_pdo { diff --git a/drivers/adodb-pdo_oci.inc.php b/drivers/adodb-pdo_oci.inc.php index 9a05ee6a..28794ed9 100644 --- a/drivers/adodb-pdo_oci.inc.php +++ b/drivers/adodb-pdo_oci.inc.php @@ -1,23 +1,16 @@ <?php -/** - * PDO Oracle (oci) driver - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + + +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 8. + +*/ class ADODB_pdo_oci extends ADODB_pdo_base { @@ -75,15 +68,15 @@ class ADODB_pdo_oci extends ADODB_pdo_base { $retarr = array(); while (!$rs->EOF) { //print_r($rs->fields); $fld = new ADOFieldObject(); - $fld->name = $rs->fields[0]; - $fld->type = $rs->fields[1]; - $fld->max_length = $rs->fields[2]; + $fld->name = $rs->fields[0]; + $fld->type = $rs->fields[1]; + $fld->max_length = $rs->fields[2]; $fld->scale = $rs->fields[3]; if ($rs->fields[1] == 'NUMBER' && $rs->fields[3] == 0) { $fld->type ='INT'; - $fld->max_length = $rs->fields[4]; - } - $fld->not_null = (strncmp($rs->fields[5], 'NOT',3) === 0); + $fld->max_length = $rs->fields[4]; + } + $fld->not_null = (strncmp($rs->fields[5], 'NOT',3) === 0); $fld->binary = (strpos($fld->type,'BLOB') !== false); $fld->default_value = $rs->fields[6]; @@ -98,12 +91,25 @@ class ADODB_pdo_oci extends ADODB_pdo_base { return $retarr; } - /** - * @param bool $auto_commit - * @return void - */ - function SetAutoCommit($auto_commit) - { - $this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT, $auto_commit); - } + /** + * @param bool $auto_commit + * @return void + */ + function SetAutoCommit($auto_commit) + { + $this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT, $auto_commit); + } + + /** + * Returns a driver-specific format for a bind parameter + * + * @param string $name + * @param string $type (ignored in driver) + * + * @return string + */ + public function param($name,$type='C') + { + return sprintf(':%s', $name); + } } diff --git a/drivers/adodb-pdo_pgsql.inc.php b/drivers/adodb-pdo_pgsql.inc.php index 0212d4fd..c3b5b84c 100644 --- a/drivers/adodb-pdo_pgsql.inc.php +++ b/drivers/adodb-pdo_pgsql.inc.php @@ -1,31 +1,23 @@ <?php -/** - * PDO PostgreSQL (pgsql) driver - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 8. + +*/ class ADODB_pdo_pgsql extends ADODB_pdo { var $metaDatabasesSQL = "select datname from pg_database where datname not in ('template0','template1') order by 1"; - var $metaTablesSQL = "select tablename,'T' from pg_tables where tablename not like 'pg\_%' - and tablename not in ('sql_features', 'sql_implementation_info', 'sql_languages', - 'sql_packages', 'sql_sizing', 'sql_sizing_profiles') - union - select viewname,'V' from pg_views where viewname not like 'pg\_%'"; + var $metaTablesSQL = "select tablename,'T' from pg_tables where tablename not like 'pg\_%' + and tablename not in ('sql_features', 'sql_implementation_info', 'sql_languages', + 'sql_packages', 'sql_sizing', 'sql_sizing_profiles') + union + select viewname,'V' from pg_views where viewname not like 'pg\_%'"; //"select tablename from pg_tables where tablename not like 'pg_%' order by 1"; var $isoDates = true; // accepts dates in ISO format var $sysDate = "CURRENT_DATE"; @@ -34,15 +26,15 @@ class ADODB_pdo_pgsql extends ADODB_pdo { var $metaColumnsSQL = "SELECT a.attname,t.typname,a.attlen,a.atttypmod,a.attnotnull,a.atthasdef,a.attnum FROM pg_class c, pg_attribute a,pg_type t WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s')) and a.attname not like '....%%' -AND a.attnum > 0 AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum"; + AND a.attnum > 0 AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum"; // used when schema defined var $metaColumnsSQL1 = "SELECT a.attname, t.typname, a.attlen, a.atttypmod, a.attnotnull, a.atthasdef, a.attnum -FROM pg_class c, pg_attribute a, pg_type t, pg_namespace n -WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s')) - and c.relnamespace=n.oid and n.nspname='%s' - and a.attname not like '....%%' AND a.attnum > 0 - AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum"; + FROM pg_class c, pg_attribute a, pg_type t, pg_namespace n + WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s')) + and c.relnamespace=n.oid and n.nspname='%s' + and a.attname not like '....%%' AND a.attnum > 0 + AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum"; // get primary key etc -- from Freek Dijkstra var $metaKeySQL = "SELECT ic.relname AS index_name, a.attname AS column_name,i.indisunique AS unique_key, i.indisprimary AS primary_key @@ -97,23 +89,27 @@ WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s')) { $info = $this->ServerInfo(); if ($info['version'] >= 7.3) { - $this->metaTablesSQL = "select tablename,'T' from pg_tables where tablename not like 'pg\_%' - and schemaname not in ( 'pg_catalog','information_schema') - union - select viewname,'V' from pg_views where viewname not like 'pg\_%' and schemaname not in ( 'pg_catalog','information_schema') "; + $this->metaTablesSQL = " +select tablename,'T' from pg_tables +where tablename not like 'pg\_%' and schemaname not in ( 'pg_catalog','information_schema') +union +select viewname,'V' from pg_views +where viewname not like 'pg\_%' and schemaname not in ( 'pg_catalog','information_schema')"; } if ($mask) { $save = $this->metaTablesSQL; $mask = $this->qstr(strtolower($mask)); if ($info['version']>=7.3) $this->metaTablesSQL = " -select tablename,'T' from pg_tables where tablename like $mask and schemaname not in ( 'pg_catalog','information_schema') - union -select viewname,'V' from pg_views where viewname like $mask and schemaname not in ( 'pg_catalog','information_schema') "; +select tablename,'T' from pg_tables +where tablename like $mask and schemaname not in ( 'pg_catalog','information_schema') +union +select viewname,'V' from pg_views +where viewname like $mask and schemaname not in ( 'pg_catalog','information_schema')"; else $this->metaTablesSQL = " select tablename,'T' from pg_tables where tablename like $mask - union +union select viewname,'V' from pg_views where viewname like $mask"; } $ret = ADOConnection::MetaTables($ttype,$showSchema); @@ -297,4 +293,23 @@ select viewname,'V' from pg_views where viewname like $mask"; if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode; $this->_connectionID->query("SET TRANSACTION ".$transaction_mode); } + + /** + * Returns a driver-specific format for a bind parameter + * + * Unlike the native driver, we use :name parameters + * instead of offsets + * + * @param string $name + * @param string $type (ignored in driver) + * + * @return string + */ + public function param($name,$type='C') { + if (!$name) { + return ''; + } + + return sprintf(':%s', $name); + } } diff --git a/drivers/adodb-pdo_sqlite.inc.php b/drivers/adodb-pdo_sqlite.inc.php index b62ca35e..99ad9e50 100644 --- a/drivers/adodb-pdo_sqlite.inc.php +++ b/drivers/adodb-pdo_sqlite.inc.php @@ -1,25 +1,19 @@ <?php -/** - * PDO SQLite driver - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Diogo Toscano <diogo@scriptcase.net> - * @author Sid Dunayer <sdunayer@interserv.com> - */ + +/* + @version v5.22.0-dev Unreleased + @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 https://adodb.org/ + + Thanks Diogo Toscano (diogo#scriptcase.net) for the code. + And also Sid Dunayer [sdunayer#interserv.com] for extensive fixes. +*/ class ADODB_pdo_sqlite extends ADODB_pdo { var $metaTablesSQL = "SELECT name FROM sqlite_master WHERE type='table'"; @@ -34,7 +28,7 @@ class ADODB_pdo_sqlite extends ADODB_pdo { var $_genSeq2SQL = 'INSERT INTO %s VALUES(%s)'; var $_dropSeqSQL = 'DROP TABLE %s'; var $concat_operator = '||'; - var $pdoDriver = false; + var $pdoDriver = false; var $random='abs(random())'; function _init($parentDriver) @@ -156,40 +150,48 @@ class ADODB_pdo_sqlite extends ADODB_pdo { // mark newnham function MetaColumns($tab,$normalize=true) { - global $ADODB_FETCH_MODE; + global $ADODB_FETCH_MODE; - $parent = $this->pdoDriver; - $false = false; - $save = $ADODB_FETCH_MODE; - $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; - if ($parent->fetchMode !== false) $savem = $parent->SetFetchMode(false); - $rs = $parent->Execute("PRAGMA table_info('$tab')"); - if (isset($savem)) $parent->SetFetchMode($savem); - if (!$rs) { - $ADODB_FETCH_MODE = $save; - return $false; - } - $arr = array(); - while ($r = $rs->FetchRow()) { - $type = explode('(',$r['type']); - $size = ''; - if (sizeof($type)==2) - $size = trim($type[1],')'); - $fn = strtoupper($r['name']); - $fld = new ADOFieldObject; - $fld->name = $r['name']; - $fld->type = $type[0]; - $fld->max_length = $size; - $fld->not_null = $r['notnull']; - $fld->primary_key = $r['pk']; - $fld->default_value = $r['dflt_value']; - $fld->scale = 0; - if ($save == ADODB_FETCH_NUM) $arr[] = $fld; - else $arr[strtoupper($fld->name)] = $fld; - } - $rs->Close(); - $ADODB_FETCH_MODE = $save; - return $arr; + $parent = $this->pdoDriver; + $false = false; + $save = $ADODB_FETCH_MODE; + $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; + if ($parent->fetchMode !== false) { + $savem = $parent->SetFetchMode(false); + } + $rs = $parent->Execute("PRAGMA table_info('$tab')"); + if (isset($savem)) { + $parent->SetFetchMode($savem); + } + if (!$rs) { + $ADODB_FETCH_MODE = $save; + return $false; + } + $arr = array(); + while ($r = $rs->FetchRow()) { + $type = explode('(', $r['type']); + $size = ''; + if (sizeof($type) == 2) { + $size = trim($type[1], ')'); + } + $fn = strtoupper($r['name']); + $fld = new ADOFieldObject; + $fld->name = $r['name']; + $fld->type = $type[0]; + $fld->max_length = $size; + $fld->not_null = $r['notnull']; + $fld->primary_key = $r['pk']; + $fld->default_value = $r['dflt_value']; + $fld->scale = 0; + if ($save == ADODB_FETCH_NUM) { + $arr[] = $fld; + } else { + $arr[strtoupper($fld->name)] = $fld; + } + } + $rs->Close(); + $ADODB_FETCH_MODE = $save; + return $arr; } function MetaTables($ttype=false,$showSchema=false,$mask=false) @@ -208,5 +210,18 @@ class ADODB_pdo_sqlite extends ADODB_pdo { $this->metaTablesSQL = $save; } return $ret; - } + } + + /** + * Returns a driver-specific format for a bind parameter + * + * @param string $name + * @param string $type (ignored in driver) + * + * @return string + */ + public function param($name,$type='C') + { + return sprintf(':%s', $name); + } } diff --git a/drivers/adodb-pdo_sqlsrv.inc.php b/drivers/adodb-pdo_sqlsrv.inc.php index ed73f3a2..ba5180ec 100644 --- a/drivers/adodb-pdo_sqlsrv.inc.php +++ b/drivers/adodb-pdo_sqlsrv.inc.php @@ -1,25 +1,8 @@ <?php + /** - * PDO sqlsrv driver - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Ned Andre + * Provided by Ned Andre to support sqlsrv library */ - class ADODB_pdo_sqlsrv extends ADODB_pdo { var $hasTop = 'top'; diff --git a/drivers/adodb-postgres.inc.php b/drivers/adodb-postgres.inc.php index 070ac1c7..6ba96566 100644 --- a/drivers/adodb-postgres.inc.php +++ b/drivers/adodb-postgres.inc.php @@ -1,25 +1,15 @@ <?php -/** - * ADOdb PostgreSQL driver - * - * NOTE: Since ADOdb 3.31, this file is no longer used, and the "postgres" - * driver is remapped to the latest available postgres version. Maintaining - * multiple postgres drivers is no easy job, so hopefully this will ensure - * greater consistency and fewer bugs. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* + @version v5.22.0-dev Unreleased + @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. + Set tabs to 4. + + NOTE: Since 3.31, this file is no longer used, and the "postgres" driver is + remapped to lastest available postgres version. Maintaining multiple + postgres drivers is no easy job, so hopefully this will ensure greater + consistency and fewer bugs. +*/ diff --git a/drivers/adodb-postgres64.inc.php b/drivers/adodb-postgres64.inc.php index 5c1f08fc..24952581 100644 --- a/drivers/adodb-postgres64.inc.php +++ b/drivers/adodb-postgres64.inc.php @@ -1,23 +1,48 @@ <?php -/** - * ADOdb PostgreSQL 6.4 driver - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* + @version v5.22.0-dev Unreleased + @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. + Set tabs to 8. + + Original version derived from Alberto Cerezal (acerezalp@dbnet.es) - DBNet Informatica & Comunicaciones. + 08 Nov 2000 jlim - Minor corrections, removing mysql stuff + 09 Nov 2000 jlim - added insertid support suggested by "Christopher Kings-Lynne" <chriskl@familyhealth.com.au> + jlim - changed concat operator to || and data types to MetaType to match documented pgsql types + see http://www.postgresql.org/devel-corner/docs/postgres/datatype.htm + 22 Nov 2000 jlim - added changes to FetchField() and MetaTables() contributed by "raser" <raser@mail.zen.com.tw> + 27 Nov 2000 jlim - added changes to _connect/_pconnect from ideas by "Lennie" <leen@wirehub.nl> + 15 Dec 2000 jlim - added changes suggested by Additional code changes by "Eric G. Werk" egw@netguide.dk. + 31 Jan 2002 jlim - finally installed postgresql. testing + 01 Mar 2001 jlim - Freek Dijkstra changes, also support for text type + + See http://www.varlena.com/varlena/GeneralBits/47.php + + -- What indexes are on my table? + select * from pg_indexes where tablename = 'tablename'; + + -- What triggers are on my table? + select c.relname as "Table", t.tgname as "Trigger Name", + t.tgconstrname as "Constraint Name", t.tgenabled as "Enabled", + t.tgisconstraint as "Is Constraint", cc.relname as "Referenced Table", + p.proname as "Function Name" + from pg_trigger t, pg_class c, pg_class cc, pg_proc p + where t.tgfoid = p.oid and t.tgrelid = c.oid + and t.tgconstrrelid = cc.oid + and c.relname = 'tablename'; + + -- What constraints are on my table? + select r.relname as "Table", c.conname as "Constraint Name", + contype as "Constraint Type", conkey as "Key Columns", + confkey as "Foreign Columns", consrc as "Source" + from pg_class r, pg_constraint c + where r.oid = c.conrelid + and relname = 'tablename'; + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); @@ -951,9 +976,10 @@ class ADORecordSet_postgres64 extends ADORecordSet{ return $row; } - function _initRS() + + function _initrs() { - global $ADODB_COUNTRECS; + global $ADODB_COUNTRECS; $qid = $this->_queryID; $this->_numOfRows = ($ADODB_COUNTRECS)? @pg_num_rows($qid):-1; $this->_numOfFields = @pg_num_fields($qid); @@ -968,11 +994,10 @@ class ADORecordSet_postgres64 extends ADORecordSet{ } } - function fields($colname) + /* Use associative array to get fields array */ + function Fields($colname) { - if ($this->fetchMode != PGSQL_NUM) { - return @$this->fields[$colname]; - } + if ($this->fetchMode != PGSQL_NUM) return @$this->fields[$colname]; if (!$this->bind) { $this->bind = array(); @@ -984,7 +1009,7 @@ class ADORecordSet_postgres64 extends ADORecordSet{ return $this->fields[$this->bind[strtoupper($colname)]]; } - function fetchField($fieldOffset) + function FetchField($off = 0) { // offsets begin at 0 @@ -1069,7 +1094,14 @@ class ADORecordSet_postgres64 extends ADORecordSet{ $t = $fieldobj->type; $len = $fieldobj->max_length; } - switch (strtoupper($t)) { + + $t = strtoupper($t); + + if (array_key_exists($t,$this->connection->customActualTypes)) + return $this->connection->customActualTypes[$t]; + + switch ($t) { + case 'MONEY': // stupid, postgres expects money to be a string case 'INTERVAL': case 'CHAR': diff --git a/drivers/adodb-postgres7.inc.php b/drivers/adodb-postgres7.inc.php index 59174f67..f793d000 100644 --- a/drivers/adodb-postgres7.inc.php +++ b/drivers/adodb-postgres7.inc.php @@ -1,23 +1,17 @@ <?php -/** - * ADOdb PostgreSQL 7 driver - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* + @version v5.22.0-dev Unreleased + @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. + Set tabs to 4. + + Postgres7 support. + 28 Feb 2001: Currently indicate that we support LIMIT + 01 Dec 2001: dannym added support for default values +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-postgres8.inc.php b/drivers/adodb-postgres8.inc.php index 37c2aae1..fded8aa6 100644 --- a/drivers/adodb-postgres8.inc.php +++ b/drivers/adodb-postgres8.inc.php @@ -1,23 +1,15 @@ <?php -/** - * ADOdb PostgreSQL 8 driver - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* + @version v5.22.0-dev Unreleased + @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. + Set tabs to 4. + + Postgres8 support. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-postgres9.inc.php b/drivers/adodb-postgres9.inc.php index fb9c6785..1dbf1465 100644 --- a/drivers/adodb-postgres9.inc.php +++ b/drivers/adodb-postgres9.inc.php @@ -1,23 +1,15 @@ <?php -/** - * ADOdb PostgreSQL 9+ driver - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* + @version v5.22.0-dev Unreleased + @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. + Set tabs to 4. + + Postgres9 support. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-proxy.inc.php b/drivers/adodb-proxy.inc.php index 3be13179..4aee6e9b 100644 --- a/drivers/adodb-proxy.inc.php +++ b/drivers/adodb-proxy.inc.php @@ -1,25 +1,15 @@ <?php -/** - * ADOdb Proxy Server driver - * - * @deprecated - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 4. + + Synonym for csv driver. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-sapdb.inc.php b/drivers/adodb-sapdb.inc.php index 34eb4a55..453a2ed5 100644 --- a/drivers/adodb-sapdb.inc.php +++ b/drivers/adodb-sapdb.inc.php @@ -1,23 +1,18 @@ <?php -/** - * SAPDB data driver - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. +Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + + SAPDB data driver. Requires ODBC. + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-sqlanywhere.inc.php b/drivers/adodb-sqlanywhere.inc.php index 88897af9..c4f550a2 100644 --- a/drivers/adodb-sqlanywhere.inc.php +++ b/drivers/adodb-sqlanywhere.inc.php @@ -1,23 +1,47 @@ <?php -/** - * SAP SQL Anywhere driver (previously Sybase SQL Anywhere) - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights +@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community +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. +Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + + 21.02.2002 - Wade Johnson wade@wadejohnson.de + Extended ODBC class for Sybase SQLAnywhere. + 1) Added support to retrieve the last row insert ID on tables with + primary key column using autoincrement function. + + 2) Added blob support. Usage: + a) create blob variable on db server: + + $dbconn->create_blobvar($blobVarName); + + b) load blob var from file. $filename must be complete path + + $dbcon->load_blobvar_from_file($blobVarName, $filename); + + c) Use the $blobVarName in SQL insert or update statement in the values + clause: + + $recordSet = $dbconn->Execute('INSERT INTO tabname (idcol, blobcol) ' + . + 'VALUES (\'test\', ' . $blobVarName . ')'); + + instead of loading blob from a file, you can also load from + an unformatted (raw) blob variable: + $dbcon->load_blobvar_from_var($blobVarName, $varName); + + d) drop blob variable on db server to free up resources: + $dbconn->drop_blobvar($blobVarName); + + Sybase_SQLAnywhere data driver. Requires ODBC. + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-sqlite.inc.php b/drivers/adodb-sqlite.inc.php index 0711f1dd..07fd8b51 100644 --- a/drivers/adodb-sqlite.inc.php +++ b/drivers/adodb-sqlite.inc.php @@ -1,27 +1,21 @@ <?php -/** - * SQLite driver - * - * @link https://www.sqlite.org/ - * - * @deprecated Use SQLite3 driver instead - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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 https://adodb.org/ + + SQLite info: http://www.hwaci.com/sw/sqlite/ + + Install Instructions: + ==================== + 1. Place this in adodb/drivers + 2. Rename the file, remove the .txt prefix. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-sqlite3.inc.php b/drivers/adodb-sqlite3.inc.php index 548727d8..85634fdc 100644 --- a/drivers/adodb-sqlite3.inc.php +++ b/drivers/adodb-sqlite3.inc.php @@ -1,29 +1,28 @@ <?php -/** - * SQLite3 driver - * - * @link https://www.sqlite.org/ - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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 https://adodb.org/ + + SQLite info: http://www.hwaci.com/sw/sqlite/ + + Install Instructions: + ==================== + 1. Place this in adodb/drivers + 2. Rename the file, remove the .txt prefix. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); +/** + * Class ADODB_sqlite3 + */ class ADODB_sqlite3 extends ADOConnection { var $databaseType = "sqlite3"; var $dataProvider = "sqlite"; @@ -34,10 +33,13 @@ class ADODB_sqlite3 extends ADOConnection { var $hasInsertID = true; /// supports autoincrement ID? var $hasAffectedRows = true; /// supports affected rows for update/delete? var $metaTablesSQL = "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name"; - var $sysDate = "adodb_date('Y-m-d')"; - var $sysTimeStamp = "adodb_date('Y-m-d H:i:s')"; + var $sysDate = "DATE('now','localtime')"; + var $sysTimeStamp = "DATETIME('now','localtime')"; var $fmtTimeStamp = "'Y-m-d H:i:s'"; + /** @var SQLite3 */ + var $_connectionID; + function ServerInfo() { $version = SQLite3::version(); @@ -51,7 +53,7 @@ class ADODB_sqlite3 extends ADOConnection { if ($this->transOff) { return true; } - $ret = $this->Execute("BEGIN TRANSACTION"); + $this->Execute("BEGIN TRANSACTION"); $this->transCnt += 1; return true; } @@ -95,6 +97,9 @@ class ADODB_sqlite3 extends ADOConnection { $t = strtoupper($t); + if (array_key_exists($t,$this->customActualTypes)) + return $this->customActualTypes[$t]; + /* * We are using the Sqlite affinity method here * @link https://www.sqlite.org/datatype3.html @@ -214,7 +219,7 @@ class ADODB_sqlite3 extends ADOConnection { ) WHERE type != 'meta' AND sql NOTNULL - AND LOWER(name) ='" . strtolower($table) . "'"; + AND LOWER(name) ='" . strtolower($table) . "'"; $tableSql = $this->getOne($sql); @@ -304,8 +309,7 @@ class ADODB_sqlite3 extends ADOConnection { $this->_connectionID->createFunction('adodb_date2', 'adodb_date2', 2); } - - // returns true or false + /** @noinspection PhpUnusedParameterInspection */ function _connect($argHostname, $argUsername, $argPassword, $argDatabasename) { if (empty($argHostname) && $argDatabasename) { @@ -317,7 +321,6 @@ class ADODB_sqlite3 extends ADOConnection { return true; } - // returns true or false function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) { // There's no permanent connect in SQLite3 @@ -394,7 +397,7 @@ class ADODB_sqlite3 extends ADOConnection { return false; } - function CreateSequence($seqname='adodbseq',$start=1) + function createSequence($seqname='adodbseq', $startID=1) { if (empty($this->_genSeqSQL)) { return false; @@ -403,8 +406,8 @@ class ADODB_sqlite3 extends ADOConnection { if (!$ok) { return false; } - $start -= 1; - return $this->Execute("insert into $seqname values($start)"); + $startID -= 1; + return $this->Execute("insert into $seqname values($startID)"); } var $_dropSeqSQL = 'drop table %s'; @@ -559,14 +562,13 @@ class ADODB_sqlite3 extends ADOConnection { * * This uses the more efficient strftime native function to process * - * @param str $fld The name of the field to process + * @param string $fld The name of the field to process * - * @return str The SQL Statement + * @return string The SQL Statement */ function month($fld) { - $x = "strftime('%m',$fld)"; - return $x; + return "strftime('%m',$fld)"; } /** @@ -574,13 +576,12 @@ class ADODB_sqlite3 extends ADOConnection { * * This uses the more efficient strftime native function to process * - * @param str $fld The name of the field to process + * @param string $fld The name of the field to process * - * @return str The SQL Statement + * @return string The SQL Statement */ function day($fld) { - $x = "strftime('%d',$fld)"; - return $x; + return "strftime('%d',$fld)"; } /** @@ -588,14 +589,116 @@ class ADODB_sqlite3 extends ADOConnection { * * This uses the more efficient strftime native function to process * - * @param str $fld The name of the field to process + * @param string $fld The name of the field to process * - * @return str The SQL Statement + * @return string The SQL Statement */ function year($fld) { - $x = "strftime('%Y',$fld)"; - return $x; + return "strftime('%Y',$fld)"; + } + + /** + * SQLite update for blob + * + * SQLite must be a fully prepared statement (all variables must be bound), + * so $where can either be an array (array params) or a string that we will + * do our best to unpack and turn into a prepared statement. + * + * @param string $table + * @param string $column + * @param string $val Blob value to set + * @param mixed $where An array of parameters (key => value pairs), + * or a string (where clause). + * @param string $blobtype ignored + * + * @return bool success + */ + function updateBlob($table, $column, $val, $where, $blobtype = 'BLOB') + { + if (is_array($where)) { + // We were passed a set of key=>value pairs + $params = $where; + } else { + // Given a where clause string, we have to disassemble the + // statements into keys and values + $params = array(); + $temp = preg_split('/(where|and)/i', $where); + $where = array_filter($temp); + + foreach ($where as $wValue) { + $wTemp = preg_split('/[= \']+/', $wValue); + $wTemp = array_filter($wTemp); + $wTemp = array_values($wTemp); + $params[$wTemp[0]] = $wTemp[1]; + } + } + + $paramWhere = array(); + foreach ($params as $bindKey => $bindValue) { + $paramWhere[] = $bindKey . '=?'; + } + + $sql = "UPDATE $table SET $column=? WHERE " + . implode(' AND ', $paramWhere); + + // Prepare the statement + $stmt = $this->_connectionID->prepare($sql); + + // Set the first bind value equal to value we want to update + if (!$stmt->bindValue(1, $val, SQLITE3_BLOB)) { + return false; + } + + // Build as many keys as available + $bindIndex = 2; + foreach ($params as $bindValue) { + if (is_integer($bindValue) || is_bool($bindValue) || is_float($bindValue)) { + $type = SQLITE3_NUM; + } elseif (is_object($bindValue)) { + // Assume a blob, this should never appear in + // the binding for a where statement anyway + $type = SQLITE3_BLOB; + } else { + $type = SQLITE3_TEXT; + } + + if (!$stmt->bindValue($bindIndex, $bindValue, $type)) { + return false; + } + + $bindIndex++; + } + + // Now execute the update. NB this is SQLite execute, not ADOdb + $ok = $stmt->execute(); + return is_object($ok); + } + + /** + * SQLite update for blob from a file + * + * @param string $table + * @param string $column + * @param string $path Filename containing blob data + * @param mixed $where {@see updateBlob()} + * @param string $blobtype ignored + * + * @return bool success + */ + function updateBlobFile($table, $column, $path, $where, $blobtype = 'BLOB') + { + if (!file_exists($path)) { + return false; + } + + // Read file information + $fileContents = file_get_contents($path); + if ($fileContents === false) + // Distinguish between an empty file and failure + return false; + + return $this->updateBlob($table, $column, $fileContents, $where, $blobtype); } } @@ -609,9 +712,12 @@ class ADORecordset_sqlite3 extends ADORecordSet { var $databaseType = "sqlite3"; var $bind = false; + /** @var SQLite3Result */ + var $_queryID; + + /** @noinspection PhpMissingParentConstructorInspection */ function __construct($queryID,$mode=false) { - if ($mode === false) { global $ADODB_FETCH_MODE; $mode = $ADODB_FETCH_MODE; @@ -697,4 +803,4 @@ class ADORecordset_sqlite3 extends ADORecordSet { { } -} +}
\ No newline at end of file diff --git a/drivers/adodb-sqlitepo.inc.php b/drivers/adodb-sqlitepo.inc.php index cb69ff9e..b804ac4a 100644 --- a/drivers/adodb-sqlitepo.inc.php +++ b/drivers/adodb-sqlitepo.inc.php @@ -1,31 +1,23 @@ <?php -/** - * SQLite Portable driver. - * - * Make it more similar to other database drivers. The main differences are - * - When selecting (joining) multiple tables, in assoc mode the table - * names are included in the assoc keys in the "sqlite" driver. - * In "sqlitepo" driver, the table names are stripped from the returned - * column names. When this results in a conflict, the first field gets - * preference. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Herman Kuiper <herman@ozuzo.net> - */ +/* +@version v5.22.0-dev Unreleased +@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. + + Portable version of sqlite driver, to make it more similar to other database drivers. + The main differences are + + 1. When selecting (joining) multiple tables, in assoc mode the table + names are included in the assoc keys in the "sqlite" driver. + + In "sqlitepo" driver, the table names are stripped from the returned column names. + When this results in a conflict, the first field get preference. + + Contributed by Herman Kuiper herman#ozuzo.net +*/ if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-sybase.inc.php b/drivers/adodb-sybase.inc.php index b8db0747..c34c8a8e 100644 --- a/drivers/adodb-sybase.inc.php +++ b/drivers/adodb-sybase.inc.php @@ -1,24 +1,21 @@ <?php -/** - * Sybase driver - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Toni Tunkkari <toni.tunkkari@finebyte.com> - */ +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + + Sybase driver contributed by Toni (toni.tunkkari@finebyte.com) + + - MSSQL date patch applied. + + Date patch by Toni 15 Feb 2002 +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-sybase_ase.inc.php b/drivers/adodb-sybase_ase.inc.php index d301ba99..90ca74e8 100644 --- a/drivers/adodb-sybase_ase.inc.php +++ b/drivers/adodb-sybase_ase.inc.php @@ -1,24 +1,17 @@ <?php -/** - * SAP Adaptive Server Enterprise driver (formerly Sybase ASE) - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Cristian Marin, Interakt Online <cristic@interaktonline.com> - */ +/* + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4. + + Contributed by Interakt Online. Thx Cristian MARIN cristic#interaktonline.com +*/ + require_once ADODB_DIR."/drivers/adodb-sybase.inc.php"; diff --git a/drivers/adodb-text.inc.php b/drivers/adodb-text.inc.php index 77ad06a0..4c99f31b 100644 --- a/drivers/adodb-text.inc.php +++ b/drivers/adodb-text.inc.php @@ -1,25 +1,63 @@ <?php -/** - * ADOdb Plain Text driver - * - * @deprecated - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. +*/ + +/* +Setup: + + $db = NewADOConnection('text'); + $db->Connect($array,[$types],[$colnames]); + + Parameter $array is the 2 dimensional array of data. The first row can contain the + column names. If column names is not defined in first row, you MUST define $colnames, + the 3rd parameter. + + Parameter $types is optional. If defined, it should contain an array matching + the number of columns in $array, with each element matching the correct type defined + by MetaType: (B,C,I,L,N). If undefined, we will probe for $this->_proberows rows + to guess the type. Only C,I and N are recognised. + + Parameter $colnames is optional. If defined, it is an array that contains the + column names of $array. If undefined, we assume the first row of $array holds the + column names. + + The Execute() function will return a recordset. The recordset works like a normal recordset. + We have partial support for SQL parsing. We process the SQL using the following rules: + + 1. SQL order by's always work for the first column ordered. Subsequent cols are ignored + + 2. All operations take place on the same table. No joins possible. In fact the FROM clause + is ignored! You can use any name for the table. + + 3. To simplify code, all columns are returned, except when selecting 1 column + + $rs = $db->Execute('select col1,col2 from table'); // sql ignored, will generate all cols + + We special case handling of 1 column because it is used in filter popups + + $rs = $db->Execute('select col1 from table'); + // sql accepted and processed -- any table name is accepted + + $rs = $db->Execute('select distinct col1 from table'); + // sql accepted and processed + +4. Where clauses are ignored, but searching with the 3rd parameter of Execute is permitted. + This has to use PHP syntax and we will eval() it. You can even use PHP functions. + + $rs = $db->Execute('select * from table',false,"\$COL1='abc' and $\COL2=3") + // the 3rd param is searched -- make sure that $COL1 is a legal column name + // and all column names must be in upper case. + +4. Group by, having, other clauses are ignored + +5. Expression columns, min(), max() are ignored + +6. All data is readonly. Only SELECTs permitted. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/drivers/adodb-vfp.inc.php b/drivers/adodb-vfp.inc.php index bb435168..5890aeac 100644 --- a/drivers/adodb-vfp.inc.php +++ b/drivers/adodb-vfp.inc.php @@ -1,25 +1,17 @@ <?php -/** - * Microsoft Visual FoxPro driver - * - * @deprecated - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. +Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + + Microsoft Visual FoxPro data driver. Requires ODBC. Works only on MS Windows. +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/lang/adodb-ar.inc.php b/lang/adodb-ar.inc.php index 920c9943..0b8f12ff 100644 --- a/lang/adodb-ar.inc.php +++ b/lang/adodb-ar.inc.php @@ -1,25 +1,5 @@ <?php -/** - * Arabic language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author El-Shamaa, Khaled <k.el-shamaa@cgiar.org> - */ - +// by "El-Shamaa, Khaled" <k.el-shamaa#cgiar.org> $ADODB_LANG_ARRAY = array ( 'LANG' => 'ar', DB_ERROR => 'خطأ غير Ù…ØØ¯Ø¯', diff --git a/lang/adodb-bg.inc.php b/lang/adodb-bg.inc.php index bbfd92f2..07069b42 100644 --- a/lang/adodb-bg.inc.php +++ b/lang/adodb-bg.inc.php @@ -1,24 +1,8 @@ <?php -/** - * Bulgarian language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Valentin Sheiretsky <valio@valio.eu.org> - */ +/* + Bulgarian language, v1.0, 25.03.2004, encoding by UTF-8 charset + contributed by Valentin Sheiretsky <valio#valio.eu.org> +*/ $ADODB_LANG_ARRAY = array ( 'LANG' => 'bg', diff --git a/lang/adodb-ca.inc.php b/lang/adodb-ca.inc.php index 4b046884..adbafac9 100644 --- a/lang/adodb-ca.inc.php +++ b/lang/adodb-ca.inc.php @@ -1,25 +1,6 @@ <?php -/** - * Catalan language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Josep Lladonosa <jlladono@pie.xtec.es> - */ - +// Catalan language +// contributed by "Josep Lladonosa" jlladono#pie.xtec.es $ADODB_LANG_ARRAY = array ( 'LANG' => 'ca', DB_ERROR => 'error desconegut', diff --git a/lang/adodb-cn.inc.php b/lang/adodb-cn.inc.php index 512ffb82..9c973413 100644 --- a/lang/adodb-cn.inc.php +++ b/lang/adodb-cn.inc.php @@ -1,25 +1,6 @@ <?php -/** - * Simplified Chinese language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Cuiyan (cysoft) <cysoft@php.net> - */ - +// Chinese language file contributed by "Cuiyan (cysoft)" cysoft#php.net. +// Simplified Chinese $ADODB_LANG_ARRAY = array ( 'LANG' => 'cn', DB_ERROR => '未知错误', diff --git a/lang/adodb-cz.inc.php b/lang/adodb-cz.inc.php index eb2fb2e3..d79d7142 100644 --- a/lang/adodb-cz.inc.php +++ b/lang/adodb-cz.inc.php @@ -1,24 +1,7 @@ <?php -/** - * Czech language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Kamil Jakubovic <jake@host.sk> - */ + +# Czech language +# v1.0, 19.06.2003 Kamil Jakubovic <jake@host.sk> $ADODB_LANG_ARRAY = array ( 'LANG' => 'cz', diff --git a/lang/adodb-da.inc.php b/lang/adodb-da.inc.php index e4c655be..14e720b8 100644 --- a/lang/adodb-da.inc.php +++ b/lang/adodb-da.inc.php @@ -1,25 +1,5 @@ <?php -/** - * Danish language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Arne Eckmann <bananstat@users.sourceforge.net> - */ - +// Arne Eckmann bananstat#users.sourceforge.net $ADODB_LANG_ARRAY = array ( 'LANG' => 'da', DB_ERROR => 'ukendt fejl', diff --git a/lang/adodb-de.inc.php b/lang/adodb-de.inc.php index a02dd729..99dde149 100644 --- a/lang/adodb-de.inc.php +++ b/lang/adodb-de.inc.php @@ -1,25 +1,5 @@ <?php -/** - * German language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Heinz Hombergs <opn@hhombergs.de> - */ - +// contributed by "Heinz Hombergs" <opn@hhombergs.de> $ADODB_LANG_ARRAY = array ( 'LANG' => 'de', DB_ERROR => 'unbekannter Fehler', diff --git a/lang/adodb-en.inc.php b/lang/adodb-en.inc.php index 74c4ea02..05828554 100644 --- a/lang/adodb-en.inc.php +++ b/lang/adodb-en.inc.php @@ -1,23 +1,4 @@ <?php -/** - * English language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ $ADODB_LANG_ARRAY = array ( 'LANG' => 'en', diff --git a/lang/adodb-eo.inc.php b/lang/adodb-eo.inc.php index 107a3b37..baa589c1 100644 --- a/lang/adodb-eo.inc.php +++ b/lang/adodb-eo.inc.php @@ -1,24 +1,6 @@ <?php -/** - * Esperanto language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Antono Vasiljev <anders@brainactive.org> - */ +// Vivu Esperanto ĉiam! +// Traduko fare de Antono Vasiljev (anders[#]brainactive.org) $ADODB_LANG_ARRAY = array ( 'LANG' => 'eo', diff --git a/lang/adodb-es.inc.php b/lang/adodb-es.inc.php index bcb0ccea..a80a6441 100644 --- a/lang/adodb-es.inc.php +++ b/lang/adodb-es.inc.php @@ -1,25 +1,5 @@ <?php -/** - * Spanish language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Horacio Degiorgi <horaciod@codigophp.com> - */ - +// contributed by "Horacio Degiorgi" <horaciod@codigophp.com> $ADODB_LANG_ARRAY = array ( 'LANG' => 'es', DB_ERROR => 'error desconocido', diff --git a/lang/adodb-fa.inc.php b/lang/adodb-fa.inc.php index 84f17bd8..7fa46183 100644 --- a/lang/adodb-fa.inc.php +++ b/lang/adodb-fa.inc.php @@ -1,24 +1,6 @@ <?php -/** - * Farsi language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Peyman Hooshmandi Raad" <phooshmand@gmail.com> - */ + +/* Farsi - by "Peyman Hooshmandi Raad" <phooshmand#gmail.com> */ $ADODB_LANG_ARRAY = array ( 'LANG' => 'fa', diff --git a/lang/adodb-fr.inc.php b/lang/adodb-fr.inc.php index b010d1e5..620196b4 100644 --- a/lang/adodb-fr.inc.php +++ b/lang/adodb-fr.inc.php @@ -1,23 +1,4 @@ <?php -/** - * French language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ $ADODB_LANG_ARRAY = array ( 'LANG' => 'fr', diff --git a/lang/adodb-hu.inc.php b/lang/adodb-hu.inc.php index 5a73827b..49357ce2 100644 --- a/lang/adodb-hu.inc.php +++ b/lang/adodb-hu.inc.php @@ -1,25 +1,6 @@ <?php -/** - * Hungarian language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Halászvári Gábor <g.halaszvari@portmax.hu> - */ - +# Hungarian language, encoding by ISO 8859-2 charset (Iso Latin-2) +# Halászvári Gábor <g.halaszvari#portmax.hu> $ADODB_LANG_ARRAY = array ( 'LANG' => 'hu', DB_ERROR => 'ismeretlen hiba', diff --git a/lang/adodb-id.inc.php b/lang/adodb-id.inc.php index abd38eee..f5344c63 100644 --- a/lang/adodb-id.inc.php +++ b/lang/adodb-id.inc.php @@ -1,25 +1,6 @@ <?php -/** - * Indonesian language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Bambang Riswanto <bamz3r@gmail.com> - */ - +# Indonesian language +# Bambang Riswanto <bamz3r@gmail.com> $ADODB_LANG_ARRAY = array ( 'LANG' => 'id', DB_ERROR => 'kesalahan tidak diketahui', diff --git a/lang/adodb-it.inc.php b/lang/adodb-it.inc.php index a6516308..80524e1d 100644 --- a/lang/adodb-it.inc.php +++ b/lang/adodb-it.inc.php @@ -1,25 +1,6 @@ <?php -/** - * Italian language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Tiraboschi Massimiliano <timax@maxdev.com> - */ - +// Italian language file contributed by Tiraboschi Massimiliano aka TiMax +// www.maxdev.com timax@maxdev.com $ADODB_LANG_ARRAY = array ( 'LANG' => 'it', DB_ERROR => 'errore sconosciuto', diff --git a/lang/adodb-nl.inc.php b/lang/adodb-nl.inc.php index 8a898193..43e3ee69 100644 --- a/lang/adodb-nl.inc.php +++ b/lang/adodb-nl.inc.php @@ -1,25 +1,5 @@ <?php -/** - * Dutch language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Pim Koeman <pim@wittenborg-university.com> - */ - +// Translated by Pim Koeman (pim#wittenborg-university.com) $ADODB_LANG_ARRAY = array ( 'LANG' => 'nl', DB_ERROR => 'onbekende fout', diff --git a/lang/adodb-oc.inc.php b/lang/adodb-oc.inc.php index 3481e79a..d62b67b3 100644 --- a/lang/adodb-oc.inc.php +++ b/lang/adodb-oc.inc.php @@ -1,24 +1,4 @@ <?php -/** - * Occitan language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ - $ADODB_LANG_ARRAY = array ( 'LANG' => 'oc', DB_ERROR => 'error desconeguda', diff --git a/lang/adodb-pl.inc.php b/lang/adodb-pl.inc.php index f855153e..ffa10e33 100644 --- a/lang/adodb-pl.inc.php +++ b/lang/adodb-pl.inc.php @@ -1,24 +1,6 @@ <?php -/** - * Polish language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Grzegorz Pacan <gp@dione.cc> - */ + +// Contributed by Grzegorz Pacan <gp#dione.cc> $ADODB_LANG_ARRAY = array ( 'LANG' => 'pl', diff --git a/lang/adodb-pt-br.inc.php b/lang/adodb-pt-br.inc.php index b6c0d1c9..ba67167e 100644 --- a/lang/adodb-pt-br.inc.php +++ b/lang/adodb-pt-br.inc.php @@ -1,25 +1,6 @@ <?php -/** - * Portuguese (Brazilian) language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Levi Fukumori <levi@fukumori.com.br> - */ - +// contributed by "Levi Fukumori" levi _AT_ fukumori _DOT_ com _DOT_ br +// portuguese (brazilian) $ADODB_LANG_ARRAY = array ( 'LANG' => 'pt-br', DB_ERROR => 'erro desconhecido', diff --git a/lang/adodb-ro.inc.php b/lang/adodb-ro.inc.php index 011c0163..b6ddd313 100644 --- a/lang/adodb-ro.inc.php +++ b/lang/adodb-ro.inc.php @@ -1,24 +1,6 @@ <?php -/** - * Romanian language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Bogdan Stefan <sbogdan@rsb.ro> - */ + +/* Romanian - by "bogdan stefan" <sbogdan#rsb.ro> */ $ADODB_LANG_ARRAY = array ( 'LANG' => 'ro', diff --git a/lang/adodb-ru.inc.php b/lang/adodb-ru.inc.php index a311784a..67d80f2c 100644 --- a/lang/adodb-ru.inc.php +++ b/lang/adodb-ru.inc.php @@ -1,24 +1,6 @@ <?php -/** - * Russian language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Cyrill Malevanov <cyrill@malevanov.spb.ru> - */ + +// Russian language file contributed by "Cyrill Malevanov" cyrill#malevanov.spb.ru. $ADODB_LANG_ARRAY = array ( 'LANG' => 'ru', diff --git a/lang/adodb-sv.inc.php b/lang/adodb-sv.inc.php index 72e24301..d3be6b0e 100644 --- a/lang/adodb-sv.inc.php +++ b/lang/adodb-sv.inc.php @@ -1,25 +1,5 @@ <?php -/** - * Swedish language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Christian Tiberg <christian@commsoft.nu> - */ - +// Christian Tiberg" christian@commsoft.nu $ADODB_LANG_ARRAY = array ( 'LANG' => 'en', DB_ERROR => 'Okänt fel', diff --git a/lang/adodb-th.inc.php b/lang/adodb-th.inc.php index 354acca1..a0685645 100644 --- a/lang/adodb-th.inc.php +++ b/lang/adodb-th.inc.php @@ -1,25 +1,5 @@ <?php -/** - * Thai language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Trirat Petchsingh <rosskouk@gmail.com> - */ - +// by Trirat Petchsingh <rosskouk#gmail.com> $ADODB_LANG_ARRAY = array ( 'LANG' => 'th', DB_ERROR => 'error ไม่รู้สาเหตุ', diff --git a/lang/adodb-uk.inc.php b/lang/adodb-uk.inc.php index e54a9670..2ace5bc4 100644 --- a/lang/adodb-uk.inc.php +++ b/lang/adodb-uk.inc.php @@ -1,24 +1,6 @@ <?php -/** - * Ukrainian language strings. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Alex Rootoff <rootoff@pisem.net> - */ + +// Ukrainian language file contributed by Alex Rootoff rootoff{AT}pisem.net. $ADODB_LANG_ARRAY = array ( 'LANG' => 'uk', diff --git a/pear/Auth/Container/ADOdb.php b/pear/Auth/Container/ADOdb.php index 807da9d7..75515b6d 100644 --- a/pear/Auth/Container/ADOdb.php +++ b/pear/Auth/Container/ADOdb.php @@ -1,36 +1,36 @@ <?php -/** - * Storage driver for fetching login data from a database using ADOdb-PHP. - * - * This storage driver can use all databases which are supported by the ADBdb - * abstraction layer to fetch login data. - * NOTE: The ADOdb directory MUST be in your PHP include_path! - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Martin Jansen <mj@php.net> - * @author Richard Tango-Lowy <richtl@arscognita.com> - */ +/* +@version v5.22.0-dev Unreleased +@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 https://adodb.org/ + + Original Authors: Martin Jansen <mj#php.net> + Richard Tango-Lowy <richtl#arscognita.com> +*/ require_once 'Auth/Container.php'; require_once 'adodb.inc.php'; require_once 'adodb-pear.inc.php'; require_once 'adodb-errorpear.inc.php'; - +/** + * Storage driver for fetching login data from a database using ADOdb-PHP. + * + * This storage driver can use all databases which are supported + * by the ADBdb DB abstraction layer to fetch login data. + * See https://adodb.org/ for information on ADOdb. + * NOTE: The ADOdb directory MUST be in your PHP include_path! + * + * @author Richard Tango-Lowy <richtl@arscognita.com> + * @package Auth + * @version $Revision: 1.3 $ + */ class Auth_Container_ADOdb extends Auth_Container { diff --git a/pear/auth_adodb_example.php b/pear/auth_adodb_example.php index 77af9395..3b7cf5e8 100644 --- a/pear/auth_adodb_example.php +++ b/pear/auth_adodb_example.php @@ -1,26 +1,5 @@ <?php -/** - * PEAR Auth example - * - * NOTE: The ADOdb and PEAR directories MUST be in your PHP include_path! - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ -// +// NOTE: The ADOdb and PEAR directories MUST be in your PHP include_path! require_once "Auth/Auth.php"; function loginFunction() { diff --git a/perf/perf-db2.inc.php b/perf/perf-db2.inc.php index fc05219d..7f4c8262 100644 --- a/perf/perf-db2.inc.php +++ b/perf/perf-db2.inc.php @@ -1,23 +1,18 @@ <?php -/** - * Library for basic performance monitoring and tuning - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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 https://adodb.org/ + + Library for basic performance monitoring and tuning + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/perf/perf-informix.inc.php b/perf/perf-informix.inc.php index 88802bcc..3248f933 100644 --- a/perf/perf-informix.inc.php +++ b/perf/perf-informix.inc.php @@ -1,23 +1,18 @@ <?php -/** - * Library for basic performance monitoring and tuning - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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 https://adodb.org/ + + Library for basic performance monitoring and tuning + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/perf/perf-mssql.inc.php b/perf/perf-mssql.inc.php index 5d832032..e968e09b 100644 --- a/perf/perf-mssql.inc.php +++ b/perf/perf-mssql.inc.php @@ -1,23 +1,19 @@ <?php -/** - * Library for basic performance monitoring and tuning - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + +/* +@version v5.22.0-dev Unreleased +@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 https://adodb.org/ + + Library for basic performance monitoring and tuning + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/perf/perf-mssqlnative.inc.php b/perf/perf-mssqlnative.inc.php index c2c90fc7..11716e4d 100644 --- a/perf/perf-mssqlnative.inc.php +++ b/perf/perf-mssqlnative.inc.php @@ -1,23 +1,19 @@ <?php -/** - * Library for basic performance monitoring and tuning - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + +/* +@version v5.22.0-dev Unreleased +@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 https://adodb.org/ + + Library for basic performance monitoring and tuning + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/perf/perf-mysql.inc.php b/perf/perf-mysql.inc.php index dae44229..d45b7935 100644 --- a/perf/perf-mysql.inc.php +++ b/perf/perf-mysql.inc.php @@ -1,23 +1,18 @@ <?php -/** - * Library for basic performance monitoring and tuning - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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 https://adodb.org/ + + Library for basic performance monitoring and tuning + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/perf/perf-oci8.inc.php b/perf/perf-oci8.inc.php index c11b261f..3ed6bd00 100644 --- a/perf/perf-oci8.inc.php +++ b/perf/perf-oci8.inc.php @@ -1,23 +1,18 @@ <?php -/** - * Library for basic performance monitoring and tuning - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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 https://adodb.org/ + + Library for basic performance monitoring and tuning + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/perf/perf-postgres.inc.php b/perf/perf-postgres.inc.php index 315c17f5..cb2e05db 100644 --- a/perf/perf-postgres.inc.php +++ b/perf/perf-postgres.inc.php @@ -1,23 +1,19 @@ <?php -/** - * Library for basic performance monitoring and tuning - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + +/* +@version v5.22.0-dev Unreleased +@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 https://adodb.org/ + + Library for basic performance monitoring and tuning + +*/ // security - hide paths if (!defined('ADODB_DIR')) die(); diff --git a/phpdoc b/phpdoc deleted file mode 100644 index d4cb73a9..00000000 --- a/phpdoc +++ /dev/null @@ -1,20 +0,0 @@ -<?php -/** - * FileDescription - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ diff --git a/pivottable.inc.php b/pivottable.inc.php index 14d8eebe..8cf2d4c7 100644 --- a/pivottable.inc.php +++ b/pivottable.inc.php @@ -1,23 +1,15 @@ <?php /** - * PivotTable. + * @version v5.22.0-dev Unreleased + * @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. * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. + * Set tabs to 4 for best viewing. * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +*/ /* * Concept from daniel.lucazeau@ajornet.com. @@ -37,7 +29,8 @@ * * @returns Sql generated */ -function PivotTableSQL(&$db,$tables,$rowfields,$colfield, $where=false, + + function PivotTableSQL(&$db,$tables,$rowfields,$colfield, $where=false, $aggfield = false,$sumlabel='Sum ',$aggfn ='SUM', $showcount = true) { if ($aggfield) $hidecnt = true; diff --git a/replicate/adodb-replicate.inc.php b/replicate/adodb-replicate.inc.php index f8d6c14e..f1cdffad 100644 --- a/replicate/adodb-replicate.inc.php +++ b/replicate/adodb-replicate.inc.php @@ -1,57 +1,60 @@ <?php -/** - * Replication engine - * - * - Copy table structures and data from different databases - * (e.g. mysql to oracle) - * - Generate CREATE TABLE, CREATE INDEX, INSERT for installation scripts - * - * Note: this code assumes that comments such as / * * / are allowed, - * which works with: mssql, postgresql, oracle, mssql - * - * Table Structure copying includes - * - fields and limited subset of types - * - optional default values - * - indexes - * - but not constraints - * - * Two modes of data copy: - * 1. ReplicateData - Copy from src to dest, with update of status of copy - * back to src, with configurable src SELECT where clause - * 2. MergeData - Copy from src to dest based on last mod date field and/or - * copied flag field - * - * Default settings are - * - do not execute, generate sql ($rep->execute = false) - * - do not delete records in dest table first ($rep->deleteFirst = false). - * if $rep->deleteFirst is true and primary keys are defined, - * then no deletion will occur unless *INSERTONLY* is defined in pkey array - * - only commit once at the end of every ReplicateData ($rep->commitReplicate = true) - * - do not autocommit every x records processed ($rep->commitRecs = -1) - * - even if error occurs on one record, continue copying remaining records ($rep->neverAbort = true) - * - debugging turned off ($rep->debug = false) - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ define('ADODB_REPLICATE',1.2); include_once(ADODB_DIR.'/adodb-datadict.inc.php'); +/* +1.2 9 June 2009 +Minor patches + +1.1 8 June 2009 +Added $lastUpdateFld to replicatedata +Added $rep->compat. If compat set to 1.0, then $lastUpdateFld not used during MergeData. + +1.0 Apr 2009 +Added support for MFFA + +0.9 ? 2008 +First release + + + Note: this code assumes that comments such as / * * / ar`e allowed which works with: + Note: this code assumes that comments such as / * * / are allowed which works with: + mssql, postgresql, oracle, mssql + + Replication engine to + - copy table structures and data from different databases (e.g. mysql to oracle) + for replication purposes + - generate CREATE TABLE, CREATE INDEX, INSERT ... for installation scripts + + Table Structure copying includes + - fields and limited subset of types + - optional default values + - indexes + - but not constraints + + + Two modes of data copy: + + ReplicateData + - Copy from src to dest, with update of status of copy back to src, + with configurable src SELECT where clause + + MergeData + - Copy from src to dest based on last mod date field and/or copied flag field + + Default settings are + - do not execute, generate sql ($rep->execute = false) + - do not delete records in dest table first ($rep->deleteFirst = false). + if $rep->deleteFirst is true and primary keys are defined, + then no deletion will occur unless *INSERTONLY* is defined in pkey array + - only commit once at the end of every ReplicateData ($rep->commitReplicate = true) + - do not autocommit every x records processed ($rep->commitRecs = -1) + - even if error occurs on one record, continue copying remaining records ($rep->neverAbort = true) + - debugging turned off ($rep->debug = false) +*/ + class ADODB_Replicate { var $connSrc; var $connDest; diff --git a/replicate/replicate-steps.php b/replicate/replicate-steps.php index fca719d2..5b696568 100644 --- a/replicate/replicate-steps.php +++ b/replicate/replicate-steps.php @@ -1,23 +1,4 @@ <?php -/** - * Replication engine - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ # CONFIG diff --git a/replicate/test-tnb.php b/replicate/test-tnb.php index 6be11072..f163ff4f 100644 --- a/replicate/test-tnb.php +++ b/replicate/test-tnb.php @@ -1,23 +1,4 @@ <?php -/** - * Replication engine - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ include_once('../adodb.inc.php'); include_once('adodb-replicate.inc.php'); diff --git a/rsfilter.inc.php b/rsfilter.inc.php index 34c5311c..e58d8e47 100644 --- a/rsfilter.inc.php +++ b/rsfilter.inc.php @@ -1,23 +1,18 @@ <?php /** - * RecordSet Filter. + * @version v5.22.0-dev Unreleased + * @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. * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. + * Set tabs to 4 for best viewing. * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker + * Latest version is available at https://adodb.org/ * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + * Requires PHP4.01pl2 or later because it uses include_once +*/ /* Filter all fields and all rows in a recordset and returns the diff --git a/scripts/buildrelease.py b/scripts/buildrelease.py index cba40e67..0cefb5f7 100755 --- a/scripts/buildrelease.py +++ b/scripts/buildrelease.py @@ -5,22 +5,6 @@ ADOdb release build script - Create release tag if it does not exist - Copy release files to target directory - Generate zip/tar balls - -This file is part of ADOdb, a Database Abstraction Layer library for PHP. - -@package ADOdb -@link https://adodb.org Project's web site and documentation -@link https://github.com/ADOdb/ADOdb Source code and issue tracker - -The ADOdb Library is dual-licensed, released under both the BSD 3-Clause -and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, -any later version. This means you can use it in proprietary products. -See the LICENSE.md file distributed with this source code for details. -@license BSD-3-Clause -@license LGPL-2.1-or-later - -@copyright 2013 Damien Regad, Mark Newnham and the ADOdb community -@author Damien Regad """ import errno diff --git a/scripts/fix-static-docs.php b/scripts/fix-static-docs.php index c4159dd5..3e382b17 100644 --- a/scripts/fix-static-docs.php +++ b/scripts/fix-static-docs.php @@ -1,25 +1,12 @@ <?php /** - * Post-processing of the DokuWiki documentation export. - * - * @link https://adodb.org/dokuwiki/doku.php?id=admin:offline_docs_build - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2015 Damien Regad, Mark Newnham and the ADOdb community - * @author Mark Newnham - */ +* A Program to post-process the dokuwiki document export to clean it up +* and fix the broken links +* +* @link https://adodb.org/dokuwiki/doku.php?id=v6:offline_docs_build +* @author Mark Newnham +* @since 02/13/2015 +*/ /** * Recurses a directory and deletes files inside @@ -230,3 +217,5 @@ rename('documentation/adodb_index.html','documentation/index.html'); * We could add in an auto zip and upload here, but this is a good place to * stop and check the output */ + +?> diff --git a/scripts/updateversion.py b/scripts/updateversion.py index 5590f37f..57ee9499 100755 --- a/scripts/updateversion.py +++ b/scripts/updateversion.py @@ -3,22 +3,6 @@ ADOdb version update script. Updates the version number, and release date in all php and html files - -This file is part of ADOdb, a Database Abstraction Layer library for PHP. - -@package ADOdb -@link https://adodb.org Project's web site and documentation -@link https://github.com/ADOdb/ADOdb Source code and issue tracker - -The ADOdb Library is dual-licensed, released under both the BSD 3-Clause -and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, -any later version. This means you can use it in proprietary products. -See the LICENSE.md file distributed with this source code for details. -@license BSD-3-Clause -@license LGPL-2.1-or-later - -@copyright 2014 Damien Regad, Mark Newnham and the ADOdb community -@author Damien Regad """ from datetime import date diff --git a/scripts/uploadrelease.py b/scripts/uploadrelease.py index 7d801eed..e93e0f51 100755 --- a/scripts/uploadrelease.py +++ b/scripts/uploadrelease.py @@ -3,22 +3,6 @@ ADOdb release upload script. Uploads release zip/tarball files generated by buildrelease.py to SourceForge. - -This file is part of ADOdb, a Database Abstraction Layer library for PHP. - -@package ADOdb -@link https://adodb.org Project's web site and documentation -@link https://github.com/ADOdb/ADOdb Source code and issue tracker - -The ADOdb Library is dual-licensed, released under both the BSD 3-Clause -and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, -any later version. This means you can use it in proprietary products. -See the LICENSE.md file distributed with this source code for details. -@license BSD-3-Clause -@license LGPL-2.1-or-later - -@copyright 2014 Damien Regad, Mark Newnham and the ADOdb community -@author Damien Regad """ from distutils.version import LooseVersion @@ -1,28 +1,12 @@ <?php + /** - * ADOdb Proxy Server. - * - * @deprecated 5.21.0 - * - * Security warning - use with extreme caution ! - * Depending on how it is setup, this feature can potentially expose the - * database to attacks, particularly if used with a privileged user account. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community + * @version v5.22.0-dev Unreleased + * @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. */ /* Documentation on usage is at https://adodb.org/dokuwiki/doku.php?id=v5:proxy:proxy_index diff --git a/session/adodb-compress-bzip2.php b/session/adodb-compress-bzip2.php index 17ad99fb..269fd16c 100644 --- a/session/adodb-compress-bzip2.php +++ b/session/adodb-compress-bzip2.php @@ -1,32 +1,24 @@ <?php -/** - * ADOdb Session Management - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Ross Smith <adodb@netebb.com> - */ + +/* +@version v5.22.0-dev Unreleased +@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved. +@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community + Contributed by Ross Smith (adodb@netebb.com). + 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. + Set tabs to 4 for best viewing. + +*/ if (!function_exists('bzcompress')) { trigger_error('bzip2 functions are not available', E_USER_ERROR); return 0; } -/** - */ +/* +*/ class ADODB_Compress_Bzip2 { /** */ diff --git a/session/adodb-compress-gzip.php b/session/adodb-compress-gzip.php index bbaf6c63..a5673031 100644 --- a/session/adodb-compress-gzip.php +++ b/session/adodb-compress-gzip.php @@ -1,23 +1,17 @@ <?php -/** - * ADOdb Session Management - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + + +/* +@version v5.22.0-dev Unreleased +@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved. +@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community + Contributed by Ross Smith (adodb@netebb.com). + 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. + Set tabs to 4 for best viewing. + +*/ if (!function_exists('gzcompress')) { trigger_error('gzip functions are not available', E_USER_ERROR); diff --git a/session/adodb-cryptsession.php b/session/adodb-cryptsession.php index 08805321..47919578 100644 --- a/session/adodb-cryptsession.php +++ b/session/adodb-cryptsession.php @@ -1,25 +1,22 @@ <?php -/** - * ADOdb Session Management - * - * @deprecated This file is provided for backwards compatibility purposes - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + + +/* +@version v5.22.0-dev Unreleased +@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved. +@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community + Contributed by Ross Smith (adodb@netebb.com). + 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. + Set tabs to 4 for best viewing. +*/ + +/* + +This file is provided for backwards compatibility purposes + +*/ if (!defined('ADODB_SESSION')) { require_once dirname(__FILE__) . '/adodb-session.php'; diff --git a/session/adodb-cryptsession2.php b/session/adodb-cryptsession2.php index f3e95a13..14fcda29 100644 --- a/session/adodb-cryptsession2.php +++ b/session/adodb-cryptsession2.php @@ -1,25 +1,22 @@ <?php -/** - * ADOdb Session Management - * - * @deprecated This file is provided for backwards compatibility purposes - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + + +/* +@version v5.22.0-dev Unreleased +@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved. +@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community + Contributed by Ross Smith (adodb@netebb.com). + 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. + Set tabs to 4 for best viewing. +*/ + +/* + +This file is provided for backwards compatibility purposes + +*/ if (!defined('ADODB_SESSION')) { require_once dirname(__FILE__) . '/adodb-session2.php'; diff --git a/session/adodb-encrypt-mcrypt.php b/session/adodb-encrypt-mcrypt.php index bec9ff2c..a7e3b7eb 100644 --- a/session/adodb-encrypt-mcrypt.php +++ b/session/adodb-encrypt-mcrypt.php @@ -1,23 +1,17 @@ <?php -/** - * ADOdb Session Management - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + + +/* +@version v5.22.0-dev Unreleased +@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved. +@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community + Contributed by Ross Smith (adodb@netebb.com). + 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. + Set tabs to 4 for best viewing. + +*/ if (!function_exists('mcrypt_encrypt')) { trigger_error('Mcrypt functions are not available', E_USER_ERROR); diff --git a/session/adodb-encrypt-md5.php b/session/adodb-encrypt-md5.php index 7ae9b56e..1f9885a9 100644 --- a/session/adodb-encrypt-md5.php +++ b/session/adodb-encrypt-md5.php @@ -1,23 +1,16 @@ <?php -/** - * ADOdb Session Management - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + +/* +@version v5.22.0-dev Unreleased +@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved. +@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community + Contributed by Ross Smith (adodb@netebb.com). + 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. + Set tabs to 4 for best viewing. + +*/ // security - hide paths if (!defined('ADODB_SESSION')) die(); diff --git a/session/adodb-encrypt-secret.php b/session/adodb-encrypt-secret.php index 2c29f7a0..e49ff434 100644 --- a/session/adodb-encrypt-secret.php +++ b/session/adodb-encrypt-secret.php @@ -1,23 +1,16 @@ <?php -/** - * ADOdb Session Management - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + +/* +@version v5.22.0-dev Unreleased +@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved. +@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community + Contributed by Ross Smith (adodb@netebb.com). + 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. + Set tabs to 4 for best viewing. + +*/ @define('HORDE_BASE', dirname(dirname(dirname(__FILE__))) . '/horde'); @@ -29,6 +22,14 @@ if (!is_dir(HORDE_BASE)) { include_once HORDE_BASE . '/lib/Horde.php'; include_once HORDE_BASE . '/lib/Secret.php'; +/** + +NOTE: On Windows 2000 SP4 with PHP 4.3.1, MCrypt 2.4.x, and Apache 1.3.28, +the session didn't work properly. + +This may be resolved with 4.3.3. + + */ class ADODB_Encrypt_Secret { /** */ diff --git a/session/adodb-encrypt-sha1.php b/session/adodb-encrypt-sha1.php index 0aa38c83..70655153 100644 --- a/session/adodb-encrypt-sha1.php +++ b/session/adodb-encrypt-sha1.php @@ -1,27 +1,13 @@ <?php -/** - * ADOdb Session Management - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ if (!defined('ADODB_SESSION')) die(); include_once ADODB_SESSION . '/crypt.inc.php'; + +/** + + */ + class ADODB_Encrypt_SHA1 { function write($data, $key) diff --git a/session/adodb-session-clob.php b/session/adodb-session-clob.php index 8c5e9fb3..67ce4449 100644 --- a/session/adodb-session-clob.php +++ b/session/adodb-session-clob.php @@ -1,25 +1,22 @@ <?php -/** - * ADOdb Session Management - * - * @deprecated This file is provided for backwards compatibility purposes - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + + +/* +@version v5.22.0-dev Unreleased +@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved. +@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community + Contributed by Ross Smith (adodb@netebb.com). + 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. + Set tabs to 4 for best viewing. +*/ + +/* + +This file is provided for backwards compatibility purposes + +*/ if (!defined('ADODB_SESSION')) { require_once dirname(__FILE__) . '/adodb-session.php'; diff --git a/session/adodb-session-clob2.php b/session/adodb-session-clob2.php index babfa420..1893f92b 100644 --- a/session/adodb-session-clob2.php +++ b/session/adodb-session-clob2.php @@ -1,26 +1,22 @@ <?php -/** - * ADOdb Session Management - * - * @deprecated This file is provided for backwards compatibility purposes - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Ross Smith <adodb@netebb.com> - */ + + +/* +@version v5.22.0-dev Unreleased +@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved. +@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community + Contributed by Ross Smith (adodb@netebb.com). + 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. + Set tabs to 4 for best viewing. +*/ + +/* + +This file is provided for backwards compatibility purposes + +*/ if (!defined('ADODB_SESSION')) { require_once dirname(__FILE__) . '/adodb-session2.php'; diff --git a/session/adodb-session.php b/session/adodb-session.php index 9e716232..10b006cc 100644 --- a/session/adodb-session.php +++ b/session/adodb-session.php @@ -1,24 +1,16 @@ <?php -/** - * ADOdb Session Management - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Ross Smith <adodb@netebb.com> - */ + + +/* +@version v5.22.0-dev Unreleased +@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved. +@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community + Contributed by Ross Smith (adodb@netebb.com). + 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. + Set tabs to 4 for best viewing. +*/ /* You may want to rename the 'data' field to 'session_data' as diff --git a/session/adodb-session2.php b/session/adodb-session2.php index bf64b416..1ddc474e 100644 --- a/session/adodb-session2.php +++ b/session/adodb-session2.php @@ -1,23 +1,61 @@ <?php -/** - * ADOdb Session Management - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + + +/* +@version v5.22.0-dev Unreleased +@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved. +@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community + Contributed by Ross Smith (adodb@netebb.com). + 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. + Set tabs to 4 for best viewing. + + +*/ + +/* + +CREATE Table SCripts + +Oracle +====== + +CREATE TABLE SESSIONS2 +( + SESSKEY VARCHAR2(48 BYTE) NOT NULL, + EXPIRY DATE NOT NULL, + EXPIREREF VARCHAR2(200 BYTE), + CREATED DATE NOT NULL, + MODIFIED DATE NOT NULL, + SESSDATA CLOB, + PRIMARY KEY(SESSKEY) +); + + +CREATE INDEX SESS2_EXPIRY ON SESSIONS2(EXPIRY); +CREATE UNIQUE INDEX SESS2_PK ON SESSIONS2(SESSKEY); +CREATE INDEX SESS2_EXP_REF ON SESSIONS2(EXPIREREF); + + + + MySQL + ===== + +CREATE TABLE sessions2( + sesskey VARCHAR( 64 ) NOT NULL DEFAULT '', + expiry TIMESTAMP NOT NULL , + expireref VARCHAR( 250 ) DEFAULT '', + created TIMESTAMP NOT NULL , + modified TIMESTAMP NOT NULL , + sessdata LONGTEXT DEFAULT '', + PRIMARY KEY ( sesskey ) , + INDEX sess2_expiry( expiry ), + INDEX sess2_expireref( expireref ) +) + + +*/ if (!defined('_ADODB_LAYER')) { require realpath(dirname(__FILE__) . '/../adodb.inc.php'); diff --git a/session/crypt.inc.php b/session/crypt.inc.php index 82121e39..94aa2831 100644 --- a/session/crypt.inc.php +++ b/session/crypt.inc.php @@ -1,25 +1,5 @@ <?php -/** - * ADOdb Session Management - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Ari Kuorikoski <ari.kuorikoski@finebyte.com> - */ - +// Session Encryption by Ari Kuorikoski <ari.kuorikoski@finebyte.com> class MD5Crypt{ function keyED($txt,$encrypt_key) { diff --git a/session/old/adodb-cryptsession.php b/session/old/adodb-cryptsession.php index 6616de3d..33305580 100644 --- a/session/old/adodb-cryptsession.php +++ b/session/old/adodb-cryptsession.php @@ -1,29 +1,22 @@ <?php -/** - * ADOdb Session Management - * - * This file provides PHP4 session management using the ADODB database - * wrapper library. - * - * @deprecated - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ /* +@version v5.22.0-dev Unreleased +@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. + Made table name configurable - by David Johnson djohnson@inpro.net + Encryption by Ari Kuorikoski <ari.kuorikoski@finebyte.com> + + Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + ====================================================================== + + This file provides PHP4 session management using the ADODB database +wrapper library. + Example ======= diff --git a/session/old/adodb-session-clob.php b/session/old/adodb-session-clob.php index 864fdfd7..ef90205e 100644 --- a/session/old/adodb-session-clob.php +++ b/session/old/adodb-session-clob.php @@ -1,29 +1,19 @@ <?php -/** - * ADOdb Session Management - * - * This file provides PHP4 session management using the ADODB database - * wrapper library. - * - * @deprecated - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ /* + @version v5.22.0-dev Unreleased + @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. + Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + ====================================================================== + + This file provides PHP4 session management using the ADODB database + wrapper library, using Oracle CLOB's to store data. Contributed by achim.gosse@ddd.de. + Example ======= diff --git a/session/old/adodb-session.php b/session/old/adodb-session.php index 5fd43abc..5c63f818 100644 --- a/session/old/adodb-session.php +++ b/session/old/adodb-session.php @@ -1,30 +1,19 @@ <?php -/** - * ADOdb Session Management - * - * This file provides PHP4 session management using the ADODB database - * wrapper library. - * - * @deprecated - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ - /* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ + ====================================================================== + + This file provides PHP4 session management using the ADODB database +wrapper library. + Example ======= diff --git a/session/old/crypt.inc.php b/session/old/crypt.inc.php index 089e24a0..1ce75feb 100644 --- a/session/old/crypt.inc.php +++ b/session/old/crypt.inc.php @@ -1,27 +1,5 @@ <?php -/** - * ADOdb Session Management - * - * @deprecated - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - * @author Ari Kuorikoski <ari.kuorikoski@finebyte.com> - */ - +// Session Encryption by Ari Kuorikoski <ari.kuorikoski@finebyte.com> class MD5Crypt{ function keyED($txt,$encrypt_key) { diff --git a/tests/LibTest.php b/tests/LibTest.php deleted file mode 100644 index 2f02e00e..00000000 --- a/tests/LibTest.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php -/** - * Tests cases for adodb-lib.inc.php - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ - -use PHPUnit\Framework\TestCase; - -require_once dirname(__FILE__) . '/../adodb.inc.php'; -require_once dirname(__FILE__) . '/../adodb-lib.inc.php'; - -/** - * Class LibTest. - * - * Test cases for adodb-lib.inc.php - */ -class LibTest extends TestCase -{ - /** @var ADOConnection Database connection for tests */ - private $db; - - public function setUp(): void - { - $this->db = ADONewConnection('mysqli'); - } - - /** - * Test for {@see _adodb_quote_fieldname()} - * - * @dataProvider quoteProvider - */ - public function testQuoteFieldNames($method, $field, $expected) - { - global $ADODB_QUOTE_FIELDNAMES; - $ADODB_QUOTE_FIELDNAMES = $method; - $this->assertSame($expected, _adodb_quote_fieldname($this->db, $field)); - } - - /** - * Data provider for {@see testQuoteFieldNames()} - * @return array - */ - public function quoteProvider() - { - return [ - 'No quoting, single-word field name' => [false, 'Field', 'FIELD'], - 'No quoting, field name with space' => [false, 'Field Name', '`FIELD NAME`'], - 'Quoting `true`' => [true, 'Field', '`FIELD`'], - 'Quoting `UPPER`' => ['UPPER', 'Field', '`FIELD`'], - 'Quoting `LOWER`' => ['LOWER', 'Field', '`field`'], - 'Quoting `NATIVE`' => ['NATIVE', 'Field', '`Field`'], - 'Quoting `BRACKETS`' => ['BRACKETS', 'Field', '[FIELD]'], - 'Unknown value defaults to UPPER' => ['XXX', 'Field', '`FIELD`'], - ]; - } - -} diff --git a/tests/benchmark.php b/tests/benchmark.php index 5799031d..37251ce6 100644 --- a/tests/benchmark.php +++ b/tests/benchmark.php @@ -1,33 +1,24 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> + <html> <head> - <title>ADODB Benchmarks</title> + <title>ADODB Benchmarks</title> </head> <body> <?php -/** - * Benchmarking - * - * Benchmark code to test the speed to the ADODB library with different databases. - * This is a simplistic benchmark to be used as the basis for further testing. - * It should not be used as proof of the superiority of one database over the other. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. + + Benchmark code to test the speed to the ADODB library with different databases. + This is a simplistic benchmark to be used as the basis for further testing. + It should not be used as proof of the superiority of one database over the other. +*/ $testmssql = true; //$testvfp = true; diff --git a/tests/client.php b/tests/client.php index 8452da40..4215d587 100644 --- a/tests/client.php +++ b/tests/client.php @@ -2,27 +2,18 @@ <body bgcolor=white> <?php /** - * ADOdb tests - Proxy client + * @version v5.22.0-dev Unreleased + * @copyright (c) 2001-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. * - * @link https://adodb.org/dokuwiki/doku.php?id=v5:proxy:proxy_index - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community + * set tabs to 8 */ + // documentation on usage is at https://adodb.org/dokuwiki/doku.php?id=v5:proxy:proxy_index + echo PHP_VERSION,'<br>'; var_dump(parse_url('odbc_mssql://userserver/')); die(); diff --git a/tests/pdo.php b/tests/pdo.php index b1b54528..31ca5969 100644 --- a/tests/pdo.php +++ b/tests/pdo.php @@ -1,23 +1,4 @@ <?php -/** - * ADOdb tests -PDO. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ error_reporting(E_ALL); include('../adodb.inc.php'); diff --git a/tests/test-active-record.php b/tests/test-active-record.php index 081527e0..8fb02caa 100644 --- a/tests/test-active-record.php +++ b/tests/test-active-record.php @@ -1,23 +1,4 @@ <?php -/** - * ADOdb tests. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ include_once('../adodb.inc.php'); include_once('../adodb-active-record.inc.php'); diff --git a/tests/test-active-recs2.php b/tests/test-active-recs2.php index a9fcbc03..f5898fcd 100644 --- a/tests/test-active-recs2.php +++ b/tests/test-active-recs2.php @@ -1,24 +1,4 @@ <?php -/** - * ADOdb tests. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ - error_reporting(E_ALL); include('../adodb.inc.php'); diff --git a/tests/test-active-relations.php b/tests/test-active-relations.php index bb013759..7a98d479 100644 --- a/tests/test-active-relations.php +++ b/tests/test-active-relations.php @@ -1,23 +1,4 @@ <?php -/** - * ADOdb tests. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ include_once('../adodb.inc.php'); include_once('../adodb-active-record.inc.php'); diff --git a/tests/test-active-relationsx.php b/tests/test-active-relationsx.php index 4d3a80db..0f28f728 100644 --- a/tests/test-active-relationsx.php +++ b/tests/test-active-relationsx.php @@ -1,24 +1,4 @@ <?php -/** - * ADOdb tests. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ - global $err_count; $err_count = 0; diff --git a/tests/test-datadict.php b/tests/test-datadict.php index 5caea253..751ed997 100644 --- a/tests/test-datadict.php +++ b/tests/test-datadict.php @@ -1,23 +1,16 @@ <?php -/** - * ADOdb tests. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* + + @version v5.22.0-dev Unreleased + @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. + + Set tabs to 4 for best viewing. + +*/ error_reporting(E_ALL); include_once('../adodb.inc.php'); diff --git a/tests/test-perf.php b/tests/test-perf.php index 4c83c17e..62465bef 100644 --- a/tests/test-perf.php +++ b/tests/test-perf.php @@ -1,23 +1,4 @@ <?php -/** - * ADOdb tests. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ include_once('../adodb-perf.inc.php'); diff --git a/tests/test-pgblob.php b/tests/test-pgblob.php index 4c8bd167..3add99e6 100644 --- a/tests/test-pgblob.php +++ b/tests/test-pgblob.php @@ -1,23 +1,4 @@ <?php -/** - * ADOdb tests. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ function getmicrotime() { diff --git a/tests/test-php5.php b/tests/test-php5.php index 6d8758b1..77bc926b 100644 --- a/tests/test-php5.php +++ b/tests/test-php5.php @@ -1,24 +1,15 @@ <?php -/** - * ADOdb tests. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community +/* + @version v5.22.0-dev Unreleased + @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. + Set tabs to 8. */ + error_reporting(E_ALL); $path = dirname(__FILE__); diff --git a/tests/test-xmlschema.php b/tests/test-xmlschema.php index e2d6dba8..c56cfec8 100644 --- a/tests/test-xmlschema.php +++ b/tests/test-xmlschema.php @@ -1,23 +1,6 @@ -<?php -/** - * ADOdb tests. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +<?PHP + +// V4.50 6 July 2004 error_reporting(E_ALL); include_once( "../adodb.inc.php" ); diff --git a/tests/test.php b/tests/test.php index fb23980b..d164afa3 100644 --- a/tests/test.php +++ b/tests/test.php @@ -1,23 +1,16 @@ <?php -/** - * ADOdb tests. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ +*/ + //if (!defined('E_STRICT')) define('E_STRICT',0); error_reporting(E_ALL|E_STRICT); diff --git a/tests/test2.php b/tests/test2.php index fd288dca..eb3b0258 100644 --- a/tests/test2.php +++ b/tests/test2.php @@ -1,23 +1,6 @@ <?php -/** - * * ADOdb tests - BASIC ADO test. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + +// BASIC ADO test include_once('../adodb.inc.php'); diff --git a/tests/test3.php b/tests/test3.php index 38c52853..b5ac1e97 100644 --- a/tests/test3.php +++ b/tests/test3.php @@ -1,24 +1,15 @@ <?php -/** - * * ADOdb tests. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community +/* + @version v5.22.0-dev Unreleased + @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. + Set tabs to 8. */ + error_reporting(E_ALL); $path = dirname(__FILE__); diff --git a/tests/test4.php b/tests/test4.php index cdaf5277..c9eb2d62 100644 --- a/tests/test4.php +++ b/tests/test4.php @@ -1,22 +1,18 @@ <?php + /** - * Test GetUpdateSQL and GetInsertSQL. + * @version v5.22.0-dev Unreleased + * @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. * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. + * Set tabs to 4 for best viewing. * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker + * Latest version is available at https://adodb.org/ * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community + * Test GetUpdateSQL and GetInsertSQL. */ error_reporting(E_ALL); diff --git a/tests/test5.php b/tests/test5.php index 15327d1d..56c4594d 100644 --- a/tests/test5.php +++ b/tests/test5.php @@ -1,23 +1,18 @@ <?php -/** - * * ADOdb tests - Select an empty record from the database. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ +*/ + + +// Select an empty record from the database include('../adodb.inc.php'); include('../tohtml.inc.php'); diff --git a/tests/test_mssqlnative.php b/tests/test_mssqlnative.php index 9a4221fd..756e2447 100644 --- a/tests/test_mssqlnative.php +++ b/tests/test_mssqlnative.php @@ -1,23 +1,4 @@ <?php -/** - * ADOdb tests. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ error_reporting(E_ALL|E_STRICT); diff --git a/tests/test_rs_array.php b/tests/test_rs_array.php index 75848c04..547b20ad 100644 --- a/tests/test_rs_array.php +++ b/tests/test_rs_array.php @@ -1,23 +1,4 @@ <?php -/** - * ADOdb tests. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ include_once('../adodb.inc.php'); $rs = new ADORecordSet_array(); diff --git a/tests/testcache.php b/tests/testcache.php index bf8676b9..32edc07b 100644 --- a/tests/testcache.php +++ b/tests/testcache.php @@ -1,25 +1,17 @@ <html> <body> <?php -/** - * ADOdb tests. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ +*/ $ADODB_CACHE_DIR = dirname(tempnam('/tmp','')); include("../adodb.inc.php"); diff --git a/tests/testdatabases.inc.php b/tests/testdatabases.inc.php index 8c6358a4..e49fcd80 100644 --- a/tests/testdatabases.inc.php +++ b/tests/testdatabases.inc.php @@ -1,26 +1,16 @@ <?php -/** - * ADOdb tests. - * - * This file is used by the ADODB test program: test.php - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ -?> + +/* +@version v5.22.0-dev Unreleased +@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. +*/ + + /* this file is used by the ADODB test program: test.php */ + ?> <table><tr valign=top><td> <form method=get> diff --git a/tests/testgenid.php b/tests/testgenid.php index 3a8a9738..3310734a 100644 --- a/tests/testgenid.php +++ b/tests/testgenid.php @@ -1,27 +1,10 @@ <?php -/** - * ADOdb tests - ID generation. - * - * Run multiple copies of this php script at the same time - * to test unique generation of id's in multiuser mode - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* + V4.50 6 July 2004 + Run multiple copies of this php script at the same time + to test unique generation of id's in multiuser mode +*/ include_once('../adodb.inc.php'); $testaccess = true; include_once('testdatabases.inc.php'); diff --git a/tests/testmssql.php b/tests/testmssql.php index fa8570b1..d33ae3cd 100644 --- a/tests/testmssql.php +++ b/tests/testmssql.php @@ -1,22 +1,18 @@ <?php + /** - * Test GetUpdateSQL and GetInsertSQL. + * @version v5.22.0-dev Unreleased + * @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. * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. + * Set tabs to 4 for best viewing. * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker + * Latest version is available at https://adodb.org/ * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community + * Test GetUpdateSQL and GetInsertSQL. */ error_reporting(E_ALL); diff --git a/tests/testoci8.php b/tests/testoci8.php index 81cf1857..a0ca80bd 100644 --- a/tests/testoci8.php +++ b/tests/testoci8.php @@ -1,26 +1,17 @@ <html> <body> <?php -/** - * ADOdb tests - oci8 - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 4 for best viewing. + Latest version is available at https://adodb.org/ +*/ error_reporting(E_ALL | E_STRICT); include("../adodb.inc.php"); include("../tohtml.inc.php"); diff --git a/tests/testoci8cursor.php b/tests/testoci8cursor.php index 9dcf8ca9..de6f3a32 100644 --- a/tests/testoci8cursor.php +++ b/tests/testoci8cursor.php @@ -1,25 +1,19 @@ <?php -/** - * Test for Oracle Variable Cursors, which are treated as ADOdb recordsets. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ +*/ /* + Test for Oracle Variable Cursors, which are treated as ADOdb recordsets. + We have 2 examples. The first shows us using the Parameter statement. The second shows us using the new ExecuteCursor($sql, $cursorName) function. diff --git a/tests/testpaging.php b/tests/testpaging.php index 956d748e..8b2c846b 100644 --- a/tests/testpaging.php +++ b/tests/testpaging.php @@ -1,23 +1,15 @@ <?php -/** - * ADOdb tests - paging. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ +*/ error_reporting(E_ALL); diff --git a/tests/testpear.php b/tests/testpear.php index 5949abe3..278d161b 100644 --- a/tests/testpear.php +++ b/tests/testpear.php @@ -1,23 +1,15 @@ <?php -/** - * ADOdb tests - PEAR DB. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ +*/ error_reporting(E_ALL); diff --git a/tests/testsessions.php b/tests/testsessions.php index 2eca41bb..e8f7514e 100644 --- a/tests/testsessions.php +++ b/tests/testsessions.php @@ -1,23 +1,16 @@ <?php -/** - * ADOdb tests - Sessions. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ + +/* +@version v5.22.0-dev Unreleased +@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. + Set tabs to 4 for best viewing. + + Latest version is available at https://adodb.org/ +*/ function NotifyExpire($ref,$key) { diff --git a/tests/time.php b/tests/time.php index 8760ccd4..8261e1e9 100644 --- a/tests/time.php +++ b/tests/time.php @@ -1,23 +1,4 @@ <?php -/** - * ADOdb tests - Time. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ include_once('../adodb-time.inc.php'); adodb_date_test(); diff --git a/tests/tmssql.php b/tests/tmssql.php index 6b855519..0f81311a 100644 --- a/tests/tmssql.php +++ b/tests/tmssql.php @@ -1,23 +1,4 @@ <?php -/** - * ADOdb tests. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ error_reporting(E_ALL); ini_set('mssql.datetimeconvert',0); diff --git a/toexport.inc.php b/toexport.inc.php index 66bbf542..db4e857c 100644 --- a/toexport.inc.php +++ b/toexport.inc.php @@ -1,6 +1,14 @@ <?php + /** - * Export recordsets in several formats. + * @version v5.22.0-dev Unreleased + * @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. + * + * Code to export recordsets in several formats: * * AS VARIABLE * $s = rs2csv($rs); # comma-separated values @@ -13,22 +21,6 @@ * * TO STDOUT * rs2csvout($rs); - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community */ // returns a recordset as a csv string diff --git a/tohtml.inc.php b/tohtml.inc.php index e92c8b44..45d0bb40 100644 --- a/tohtml.inc.php +++ b/tohtml.inc.php @@ -1,29 +1,14 @@ <?php -/** - * RecordSet to HTML Table - * - * Convert a recordset to a html table. Multiple tables are generated - * if the number of rows is > $gSQLBlockRows. This is because - * web browsers normally require the whole table to be downloaded - * before it can be rendered, so we break the output into several - * smaller, faster rendering tables. - * - * This file is part of ADOdb, a Database Abstraction Layer library for PHP. - * - * @package ADOdb - * @link https://adodb.org Project's web site and documentation - * @link https://github.com/ADOdb/ADOdb Source code and issue tracker - * - * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause - * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, - * any later version. This means you can use it in proprietary products. - * See the LICENSE.md file distributed with this source code for details. - * @license BSD-3-Clause - * @license LGPL-2.1-or-later - * - * @copyright 2000-2013 John Lim - * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community - */ +/* + @version v5.22.0-dev Unreleased + @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. + + Some pretty-printing by Chris Oxenreider <oxenreid@state.net> +*/ // specific code for tohtml GLOBAL $gSQLMaxRows,$gSQLBlockRows,$ADODB_ROUND; @@ -32,6 +17,14 @@ $ADODB_ROUND=4; // rounding $gSQLMaxRows = 1000; // max no of rows to download $gSQLBlockRows=20; // max no of rows per table block +// RecordSet to HTML Table +//------------------------------------------------------------ +// Convert a recordset to a html table. Multiple tables are generated +// if the number of rows is > $gSQLBlockRows. This is because +// web browsers normally require the whole table to be downloaded +// before it can be rendered, so we break the output into several +// smaller faster rendering tables. +// // $rs: the recordset // $ztabhtml: the table tag attributes (optional) // $zheaderarray: contains the replacement strings for the headers (optional) |
