mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-67371 lib: Upgrade ADODB to version 5.20.15
This commit is contained in:
parent
800563e415
commit
5bd8f1dc4a
103
lib/adodb/README.md
Normal file
103
lib/adodb/README.md
Normal file
@ -0,0 +1,103 @@
|
||||
ADOdb Library for PHP5
|
||||
======================
|
||||
|
||||
[](https://gitter.im/adodb/adodb?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://sourceforge.net/projects/adodb/files/latest/download)
|
||||
|
||||
(c) 2000-2013 John Lim (jlim@natsoft.com)
|
||||
(c) 2014 Damien Regad, Mark Newnham and the
|
||||
[ADOdb community](https://github.com/ADOdb/ADOdb/graphs/contributors)
|
||||
|
||||
The ADOdb Library is dual-licensed, released under both the
|
||||
[BSD 3-Clause](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md#bsd-3-clause-license)
|
||||
and the
|
||||
[GNU Lesser General Public Licence (LGPL) v2.1](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md#gnu-lesser-general-public-license)
|
||||
or, at your option, any later version.
|
||||
This means you can use it in proprietary products;
|
||||
see [License](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md) for details.
|
||||
|
||||
Home page: http://adodb.org/
|
||||
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
PHP's database access functions are not standardized. This creates a
|
||||
need for a database class library to hide the differences between the
|
||||
different databases (encapsulate the differences) so we can easily
|
||||
switch databases.
|
||||
|
||||
The library currently supports MySQL, Interbase, Sybase, PostgreSQL, Oracle,
|
||||
Microsoft SQL server, Foxpro ODBC, Access ODBC, Informix, DB2,
|
||||
Sybase SQL Anywhere, generic ODBC and Microsoft's ADO.
|
||||
|
||||
We hope more people will contribute drivers to support other databases.
|
||||
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
Unpack all the files into a directory accessible by your web server.
|
||||
|
||||
To test, try modifying some of the tutorial examples.
|
||||
Make sure you customize the connection settings correctly.
|
||||
|
||||
You can debug using:
|
||||
|
||||
``` php
|
||||
<?php
|
||||
include('adodb/adodb.inc.php');
|
||||
|
||||
$db = ADONewConnection($driver); # eg. 'mysql' or 'oci8'
|
||||
$db->debug = true;
|
||||
$db->Connect($server, $user, $password, $database);
|
||||
$rs = $db->Execute('select * from some_small_table');
|
||||
print "<pre>";
|
||||
print_r($rs->GetRows());
|
||||
print "</pre>";
|
||||
```
|
||||
|
||||
|
||||
Documentation and Examples
|
||||
==========================
|
||||
|
||||
Refer to the [ADOdb website](http://adodb.org/) for library documentation and examples. The documentation can also be [downloaded for offline viewing](https://sourceforge.net/projects/adodb/files/Documentation/).
|
||||
|
||||
- [Main documentation](http://adodb.org/dokuwiki/doku.php?id=v5:userguide:userguide_index): Query, update and insert records using a portable API.
|
||||
- [Data dictionary](http://adodb.org/dokuwiki/doku.php?id=v5:dictionary:dictionary_index) describes how to create database tables and indexes in a portable manner.
|
||||
- [Database performance monitoring](http://adodb.org/dokuwiki/doku.php?id=v5:performance:performance_index) allows you to perform health checks, tune and monitor your database.
|
||||
- [Database-backed sessions](http://adodb.org/dokuwiki/doku.php?id=v5:session:session_index).
|
||||
|
||||
There is also a [tutorial](http://adodb.org/dokuwiki/doku.php?id=v5:userguide:mysql_tutorial) that contrasts ADOdb code with PHP native MySQL code.
|
||||
|
||||
|
||||
Files
|
||||
=====
|
||||
|
||||
- `adodb.inc.php` is the library's main file. You only need to include this file.
|
||||
- `adodb-*.inc.php` are the database specific driver code.
|
||||
- `adodb-session.php` is the PHP4 session handling code.
|
||||
- `test.php` contains a list of test commands to exercise the class library.
|
||||
- `testdatabases.inc.php` contains the list of databases to apply the tests on.
|
||||
- `Benchmark.php` is a simple benchmark to test the throughput of a SELECT
|
||||
statement for databases described in testdatabases.inc.php. The benchmark
|
||||
tables are created in test.php.
|
||||
|
||||
|
||||
Support
|
||||
=======
|
||||
|
||||
To discuss with the ADOdb development team and users, connect to our
|
||||
[Gitter chatroom](https://gitter.im/adodb/adodb) using your Github credentials.
|
||||
|
||||
Please report bugs, issues and feature requests on Github:
|
||||
|
||||
https://github.com/ADOdb/ADOdb/issues
|
||||
|
||||
You may also find legacy issues in
|
||||
|
||||
- the old [ADOdb forums](http://phplens.com/lens/lensforum/topics.php?id=4) on phplens.com
|
||||
- the [SourceForge tickets section](http://sourceforge.net/p/adodb/_list/tickets)
|
||||
|
||||
However, please note that they are not actively monitored and should
|
||||
only be used as reference.
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Latest version is available at http://adodb.org/
|
||||
@ -120,7 +120,7 @@ class ADODB_Active_Record {
|
||||
// php5 constructor
|
||||
function __construct($table = false, $pkeyarr=false, $db=false)
|
||||
{
|
||||
global $ADODB_ASSOC_CASE,$_ADODB_ACTIVE_DBS;
|
||||
global $_ADODB_ACTIVE_DBS;
|
||||
|
||||
if ($db == false && is_object($pkeyarr)) {
|
||||
$db = $pkeyarr;
|
||||
@ -374,7 +374,7 @@ class ADODB_Active_Record {
|
||||
// update metadata
|
||||
function UpdateActiveTable($pkeys=false,$forceUpdate=false)
|
||||
{
|
||||
global $ADODB_ASSOC_CASE,$_ADODB_ACTIVE_DBS , $ADODB_CACHE_DIR, $ADODB_ACTIVE_CACHESECS;
|
||||
global $_ADODB_ACTIVE_DBS , $ADODB_CACHE_DIR, $ADODB_ACTIVE_CACHESECS;
|
||||
global $ADODB_ACTIVE_DEFVALS,$ADODB_FETCH_MODE;
|
||||
|
||||
$activedb = $_ADODB_ACTIVE_DBS[$this->_dbat];
|
||||
@ -463,8 +463,8 @@ class ADODB_Active_Record {
|
||||
$attr = array();
|
||||
$keys = array();
|
||||
|
||||
switch($ADODB_ASSOC_CASE) {
|
||||
case 0:
|
||||
switch (ADODB_ASSOC_CASE) {
|
||||
case ADODB_ASSOC_CASE_LOWER:
|
||||
foreach($cols as $name => $fldobj) {
|
||||
$name = strtolower($name);
|
||||
if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value)) {
|
||||
@ -480,7 +480,7 @@ class ADODB_Active_Record {
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case ADODB_ASSOC_CASE_UPPER:
|
||||
foreach($cols as $name => $fldobj) {
|
||||
$name = strtoupper($name);
|
||||
|
||||
@ -927,8 +927,6 @@ class ADODB_Active_Record {
|
||||
// returns 0 on error, 1 on update, 2 on insert
|
||||
function Replace()
|
||||
{
|
||||
global $ADODB_ASSOC_CASE;
|
||||
|
||||
$db = $this->DB();
|
||||
if (!$db) {
|
||||
return false;
|
||||
@ -968,14 +966,17 @@ class ADODB_Active_Record {
|
||||
$pkey = array($pkey);
|
||||
}
|
||||
|
||||
if ($ADODB_ASSOC_CASE == 0) {
|
||||
foreach($pkey as $k => $v)
|
||||
$pkey[$k] = strtolower($v);
|
||||
}
|
||||
elseif ($ADODB_ASSOC_CASE == 1) {
|
||||
foreach($pkey as $k => $v) {
|
||||
$pkey[$k] = strtoupper($v);
|
||||
}
|
||||
switch (ADODB_ASSOC_CASE) {
|
||||
case ADODB_ASSOC_CASE_LOWER:
|
||||
foreach ($pkey as $k => $v) {
|
||||
$pkey[$k] = strtolower($v);
|
||||
}
|
||||
break;
|
||||
case ADODB_ASSOC_CASE_UPPER:
|
||||
foreach ($pkey as $k => $v) {
|
||||
$pkey[$k] = strtoupper($v);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
$ok = $db->Replace($this->_table,$arr,$pkey);
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Latest version is available at http://adodb.org/
|
||||
@ -137,7 +137,7 @@ class ADODB_Active_Record {
|
||||
// if $options['new'] is true, we forget all relations
|
||||
function __construct($table = false, $pkeyarr=false, $db=false, $options=array())
|
||||
{
|
||||
global $ADODB_ASSOC_CASE,$_ADODB_ACTIVE_DBS;
|
||||
global $_ADODB_ACTIVE_DBS;
|
||||
|
||||
if ($db == false && is_object($pkeyarr)) {
|
||||
$db = $pkeyarr;
|
||||
@ -410,7 +410,7 @@ class ADODB_Active_Record {
|
||||
// update metadata
|
||||
function UpdateActiveTable($pkeys=false,$forceUpdate=false)
|
||||
{
|
||||
global $ADODB_ASSOC_CASE,$_ADODB_ACTIVE_DBS , $ADODB_CACHE_DIR, $ADODB_ACTIVE_CACHESECS;
|
||||
global $_ADODB_ACTIVE_DBS , $ADODB_CACHE_DIR, $ADODB_ACTIVE_CACHESECS;
|
||||
global $ADODB_ACTIVE_DEFVALS, $ADODB_FETCH_MODE;
|
||||
|
||||
$activedb = $_ADODB_ACTIVE_DBS[$this->_dbat];
|
||||
@ -491,8 +491,8 @@ class ADODB_Active_Record {
|
||||
$attr = array();
|
||||
$keys = array();
|
||||
|
||||
switch($ADODB_ASSOC_CASE) {
|
||||
case 0:
|
||||
switch (ADODB_ASSOC_CASE) {
|
||||
case ADODB_ASSOC_CASE_LOWER:
|
||||
foreach($cols as $name => $fldobj) {
|
||||
$name = strtolower($name);
|
||||
if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value)) {
|
||||
@ -508,7 +508,7 @@ class ADODB_Active_Record {
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case ADODB_ASSOC_CASE_UPPER:
|
||||
foreach($cols as $name => $fldobj) {
|
||||
$name = strtoupper($name);
|
||||
|
||||
@ -1060,8 +1060,6 @@ class ADODB_Active_Record {
|
||||
// returns 0 on error, 1 on update, 2 on insert
|
||||
function Replace()
|
||||
{
|
||||
global $ADODB_ASSOC_CASE;
|
||||
|
||||
$db = $this->DB();
|
||||
if (!$db) {
|
||||
return false;
|
||||
@ -1097,7 +1095,7 @@ class ADODB_Active_Record {
|
||||
}
|
||||
|
||||
|
||||
switch ($ADODB_ASSOC_CASE == 0) {
|
||||
switch (ADODB_ASSOC_CASE) {
|
||||
case ADODB_ASSOC_CASE_LOWER:
|
||||
foreach($pkey as $k => $v) {
|
||||
$pkey[$k] = strtolower($v);
|
||||
|
@ -8,7 +8,7 @@ $ADODB_INCLUDED_CSV = 1;
|
||||
|
||||
/*
|
||||
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.14 06-Jan-2019
|
||||
* @version v5.20.15 24-Nov-2019
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.14 06-Jan-2019
|
||||
* @version v5.20.15 24-Nov-2019
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.14 06-Jan-2019
|
||||
* @version v5.20.15 24-Nov-2019
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @version v5.20.14 06-Jan-2019
|
||||
* @version v5.20.15 24-Nov-2019
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -6,7 +6,7 @@ global $ADODB_INCLUDED_LIB;
|
||||
$ADODB_INCLUDED_LIB = 1;
|
||||
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -212,172 +212,103 @@ function _adodb_replace(&$zthis, $table, $fieldArray, $keyCol, $autoQuote, $has_
|
||||
return ($rs) ? 2 : 0;
|
||||
}
|
||||
|
||||
// Requires $ADODB_FETCH_MODE = ADODB_FETCH_NUM
|
||||
function _adodb_getmenu(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=false,
|
||||
$size=0, $selectAttr='',$compareFields0=true)
|
||||
{
|
||||
$hasvalue = false;
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
if (is_array($name))
|
||||
{
|
||||
/*
|
||||
* Reserved for future use
|
||||
*/
|
||||
$s = _adodb_getmenu_select($name, $defstr, $blank1stItem, $multiple, $size, $selectAttr);
|
||||
|
||||
$hasvalue = $zthis->FieldCount() > 1;
|
||||
if (!$hasvalue) {
|
||||
$compareFields0 = true;
|
||||
}
|
||||
|
||||
if ($multiple or is_array($defstr)) {
|
||||
if ($size==0) $size=5;
|
||||
$attr = ' multiple size="'.$size.'"';
|
||||
if (!strpos($name,'[]')) $name .= '[]';
|
||||
} else if ($size) $attr = ' size="'.$size.'"';
|
||||
else $attr ='';
|
||||
|
||||
$s = '<select name="'.$name.'"'.$attr.' '.$selectAttr.'>';
|
||||
if ($blank1stItem)
|
||||
{
|
||||
if (is_string($blank1stItem)) {
|
||||
$barr = explode(':',$blank1stItem);
|
||||
if (sizeof($barr) == 1) $barr[] = '';
|
||||
$s .= "\n<option value=\"".$barr[0]."\">".$barr[1]."</option>";
|
||||
}
|
||||
else
|
||||
$s .= "\n<option></option>";
|
||||
}
|
||||
if ($zthis->FieldCount() > 1) $hasvalue=true;
|
||||
else $compareFields0 = true;
|
||||
|
||||
$value = '';
|
||||
$optgroup = null;
|
||||
$firstgroup = true;
|
||||
$fieldsize = $zthis->FieldCount();
|
||||
while(!$zthis->EOF) {
|
||||
$zval = rtrim(reset($zthis->fields));
|
||||
|
||||
if ($blank1stItem && $zval=="") {
|
||||
if ($blank1stItem && $zval == "") {
|
||||
$zthis->MoveNext();
|
||||
continue;
|
||||
}
|
||||
|
||||
$myFields = array_map('trim',array_values($zthis->fields));
|
||||
|
||||
if ($fieldsize > 1) {
|
||||
if (isset($myFields[1]))
|
||||
$zval2 = $myFields[1];
|
||||
else
|
||||
$zval2 = next($myFields);
|
||||
if ($hasvalue) {
|
||||
if ($ADODB_FETCH_MODE == ADODB_FETCH_ASSOC) {
|
||||
// Get 2nd field's value regardless of its name
|
||||
$zval2 = current(array_slice($zthis->fields, 1, 1));
|
||||
} else {
|
||||
// With NUM or BOTH fetch modes, we have a numeric index
|
||||
$zval2 = $zthis->fields[1];
|
||||
}
|
||||
$zval2 = trim($zval2);
|
||||
$value = 'value="' . htmlspecialchars($zval2) . '"';
|
||||
}
|
||||
$selected = ($compareFields0) ? $zval : $zval2;
|
||||
|
||||
if ($hasvalue)
|
||||
$value = " value='".htmlspecialchars($zval2)."'";
|
||||
$s .= _adodb_getmenu_option($defstr, $compareFields0 ? $zval : $zval2, $value, $zval);
|
||||
|
||||
if (is_array($defstr))
|
||||
{
|
||||
|
||||
if (in_array($selected,$defstr))
|
||||
$s .= "\n<option selected='selected'$value>".htmlspecialchars($zval).'</option>';
|
||||
else
|
||||
$s .= "\n<option".$value.'>'.htmlspecialchars($zval).'</option>';
|
||||
}
|
||||
else {
|
||||
if (strcasecmp($selected,$defstr)==0)
|
||||
$s .= "\n<option selected='selected'$value>".htmlspecialchars($zval).'</option>';
|
||||
else
|
||||
$s .= "\n<option".$value.'>'.htmlspecialchars($zval).'</option>';
|
||||
}
|
||||
$zthis->MoveNext();
|
||||
} // while
|
||||
|
||||
return $s ."\n</select>\n";
|
||||
}
|
||||
|
||||
// Requires $ADODB_FETCH_MODE = ADODB_FETCH_NUM
|
||||
function _adodb_getmenu_gp(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=false,
|
||||
$size=0, $selectAttr='',$compareFields0=true)
|
||||
{
|
||||
$hasvalue = false;
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
if (is_array($name))
|
||||
{
|
||||
/*
|
||||
* Reserved for future use
|
||||
*/
|
||||
$s = _adodb_getmenu_select($name, $defstr, $blank1stItem, $multiple, $size, $selectAttr);
|
||||
|
||||
$hasvalue = $zthis->FieldCount() > 1;
|
||||
$hasgroup = $zthis->FieldCount() > 2;
|
||||
if (!$hasvalue) {
|
||||
$compareFields0 = true;
|
||||
}
|
||||
|
||||
if ($multiple or is_array($defstr)) {
|
||||
if ($size==0) $size=5;
|
||||
$attr = ' multiple size="'.$size.'"';
|
||||
if (!strpos($name,'[]')) $name .= '[]';
|
||||
} else if ($size) $attr = ' size="'.$size.'"';
|
||||
else $attr ='';
|
||||
|
||||
$s = '<select name="'.$name.'"'.$attr.' '.$selectAttr.'>';
|
||||
if ($blank1stItem)
|
||||
if (is_string($blank1stItem)) {
|
||||
$barr = explode(':',$blank1stItem);
|
||||
if (sizeof($barr) == 1) $barr[] = '';
|
||||
$s .= "\n<option value=\"".$barr[0]."\">".$barr[1]."</option>";
|
||||
} else $s .= "\n<option></option>";
|
||||
|
||||
if ($zthis->FieldCount() > 1) $hasvalue=true;
|
||||
else $compareFields0 = true;
|
||||
|
||||
$value = '';
|
||||
$optgroup = null;
|
||||
$firstgroup = true;
|
||||
$fieldsize = sizeof($zthis->fields);
|
||||
while(!$zthis->EOF) {
|
||||
$zval = rtrim(reset($zthis->fields));
|
||||
$group = '';
|
||||
|
||||
if ($blank1stItem && $zval=="") {
|
||||
$zthis->MoveNext();
|
||||
continue;
|
||||
}
|
||||
|
||||
$myFields = array_map('trim',array_values($zthis->fields));
|
||||
|
||||
if ($fieldsize > 1) {
|
||||
if (isset($myFields[1]))
|
||||
$zval2 = $myFields[1];
|
||||
else
|
||||
$zval2 = next($myFields);
|
||||
}
|
||||
|
||||
$selected = ($compareFields0) ? $zval : $zval2;
|
||||
|
||||
$group = '';
|
||||
|
||||
if (isset($myFields[2])) {
|
||||
$group = $myFields[2];
|
||||
if ($hasvalue) {
|
||||
if ($ADODB_FETCH_MODE == ADODB_FETCH_ASSOC) {
|
||||
// Get 2nd field's value regardless of its name
|
||||
$fields = array_slice($zthis->fields, 1);
|
||||
$zval2 = current($fields);
|
||||
if ($hasgroup) {
|
||||
$group = trim(next($fields));
|
||||
}
|
||||
} else {
|
||||
// With NUM or BOTH fetch modes, we have a numeric index
|
||||
$zval2 = $zthis->fields[1];
|
||||
if ($hasgroup) {
|
||||
$group = trim($zthis->fields[2]);
|
||||
}
|
||||
}
|
||||
$zval2 = trim($zval2);
|
||||
$value = "value='".htmlspecialchars($zval2)."'";
|
||||
}
|
||||
|
||||
if ($optgroup != $group) {
|
||||
$optgroup = $group;
|
||||
if ($firstgroup) {
|
||||
$firstgroup = false;
|
||||
$s .="\n<optgroup label='". htmlspecialchars($group) ."'>";
|
||||
} else {
|
||||
$s .="\n</optgroup>";
|
||||
$s .="\n<optgroup label='". htmlspecialchars($group) ."'>";
|
||||
}
|
||||
$s .="\n<optgroup label='". htmlspecialchars($group) ."'>";
|
||||
}
|
||||
|
||||
if ($hasvalue)
|
||||
$value = " value='".htmlspecialchars($zval2)."'";
|
||||
$s .= _adodb_getmenu_option($defstr, $compareFields0 ? $zval : $zval2, $value, $zval);
|
||||
|
||||
if (is_array($defstr)) {
|
||||
|
||||
if (in_array($selected,$defstr))
|
||||
$s .= "\n<option selected='selected'$value>".htmlspecialchars($zval).'</option>';
|
||||
else
|
||||
$s .= "\n<option".$value.'>'.htmlspecialchars($zval).'</option>';
|
||||
}
|
||||
else {
|
||||
if (strcasecmp($selected,$defstr)==0)
|
||||
$s .= "\n<option selected='selected'$value>".htmlspecialchars($zval).'</option>';
|
||||
else
|
||||
$s .= "\n<option".$value.'>'.htmlspecialchars($zval).'</option>';
|
||||
}
|
||||
$zthis->MoveNext();
|
||||
} // while
|
||||
|
||||
@ -388,6 +319,78 @@ function _adodb_getmenu_gp(&$zthis, $name,$defstr='',$blank1stItem=true,$multipl
|
||||
return $s ."\n</select>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the opening SELECT tag for getmenu functions.
|
||||
*
|
||||
* ADOdb internal function, used by _adodb_getmenu() and _adodb_getmenu_gp().
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $defstr
|
||||
* @param bool $blank1stItem
|
||||
* @param bool $multiple
|
||||
* @param int $size
|
||||
* @param string $selectAttr
|
||||
*
|
||||
* @return string HTML
|
||||
*/
|
||||
function _adodb_getmenu_select($name, $defstr = '', $blank1stItem = true,
|
||||
$multiple = false, $size = 0, $selectAttr = '')
|
||||
{
|
||||
if ($multiple || is_array($defstr)) {
|
||||
if ($size == 0 ) {
|
||||
$size = 5;
|
||||
}
|
||||
$attr = ' multiple size="' . $size . '"';
|
||||
if (!strpos($name,'[]')) {
|
||||
$name .= '[]';
|
||||
}
|
||||
} elseif ($size) {
|
||||
$attr = ' size="' . $size . '"';
|
||||
} else {
|
||||
$attr = '';
|
||||
}
|
||||
|
||||
$html = '<select name="' . $name . '"' . $attr . ' ' . $selectAttr . '>';
|
||||
if ($blank1stItem) {
|
||||
if (is_string($blank1stItem)) {
|
||||
$barr = explode(':',$blank1stItem);
|
||||
if (sizeof($barr) == 1) {
|
||||
$barr[] = '';
|
||||
}
|
||||
$html .= "\n<option value=\"" . $barr[0] . "\">" . $barr[1] . "</option>";
|
||||
} else {
|
||||
$html .= "\n<option></option>";
|
||||
}
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print the OPTION tags for getmenu functions.
|
||||
*
|
||||
* ADOdb internal function, used by _adodb_getmenu() and _adodb_getmenu_gp().
|
||||
*
|
||||
* @param string $defstr Default values
|
||||
* @param string $compare Value to compare against defaults
|
||||
* @param string $value Ready-to-print `value="xxx"` (or empty) string
|
||||
* @param string $display Display value
|
||||
*
|
||||
* @return string HTML
|
||||
*/
|
||||
function _adodb_getmenu_option($defstr, $compare, $value, $display)
|
||||
{
|
||||
if ( is_array($defstr) && in_array($compare, $defstr)
|
||||
|| !is_array($defstr) && strcasecmp($compare, $defstr) == 0
|
||||
) {
|
||||
$selected = ' selected="selected"';
|
||||
} else {
|
||||
$selected = '';
|
||||
}
|
||||
|
||||
return "\n<option $value$selected>" . htmlspecialchars($display) . '</option>';
|
||||
}
|
||||
|
||||
/*
|
||||
Count the number of records this sql statement will return by using
|
||||
query rewriting heuristics...
|
||||
|
@ -11,7 +11,7 @@ if (empty($ADODB_INCLUDED_CSV)) include_once(ADODB_DIR.'/adodb-csvlib.inc.php');
|
||||
|
||||
/*
|
||||
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.14 06-Jan-2019
|
||||
* @version v5.20.15 24-Nov-2019
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -4,7 +4,7 @@ ADOdb Date Library, part of the ADOdb abstraction library
|
||||
|
||||
Latest version is available at http://adodb.org/
|
||||
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
/**
|
||||
\mainpage
|
||||
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
|
||||
@ -221,15 +221,10 @@ if (!defined('_ADODB_LAYER')) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Initialize random number generator for randomizing cache flushes
|
||||
// -- note Since PHP 4.2.0, the seed becomes optional and defaults to a random value if omitted.
|
||||
srand(((double)microtime())*1000000);
|
||||
|
||||
/**
|
||||
* ADODB version as a string.
|
||||
*/
|
||||
$ADODB_vers = 'v5.20.14 06-Jan-2019';
|
||||
$ADODB_vers = 'v5.20.15 24-Nov-2019';
|
||||
|
||||
/**
|
||||
* Determines whether recordset->RecordCount() is used.
|
||||
@ -3355,7 +3350,7 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1
|
||||
}
|
||||
|
||||
function __destruct() {
|
||||
@$this->Close();
|
||||
$this->Close();
|
||||
}
|
||||
|
||||
function getIterator() {
|
||||
@ -3391,64 +3386,120 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1
|
||||
|
||||
|
||||
/**
|
||||
* Generate a SELECT tag string from a recordset, and return the string.
|
||||
* If the recordset has 2 cols, we treat the 1st col as the containing
|
||||
* the text to display to the user, and 2nd col as the return value. Default
|
||||
* strings are compared with the FIRST column.
|
||||
* Generate a SELECT tag from a recordset, and return the HTML markup.
|
||||
*
|
||||
* @param name name of SELECT tag
|
||||
* @param [defstr] the value to hilite. Use an array for multiple hilites for listbox.
|
||||
* @param [blank1stItem] true to leave the 1st item in list empty
|
||||
* @param [multiple] true for listbox, false for popup
|
||||
* @param [size] #rows to show for listbox. not used by popup
|
||||
* @param [selectAttr] additional attributes to defined for SELECT tag.
|
||||
* useful for holding javascript onChange='...' handlers.
|
||||
& @param [compareFields0] when we have 2 cols in recordset, we compare the defstr with
|
||||
* column 0 (1st col) if this is true. This is not documented.
|
||||
* If the recordset has 2 columns, we treat the first one as the text to
|
||||
* display to the user, and the second as the return value. Extra columns
|
||||
* are discarded.
|
||||
*
|
||||
* @return HTML
|
||||
* @param string $name Name of SELECT tag
|
||||
* @param string|array $defstr The value to highlight. Use an array for multiple highlight values.
|
||||
* @param bool|string $blank1stItem True to create an empty item (default), False not to add one;
|
||||
* 'string' to set its label and 'value:string' to assign a value to it.
|
||||
* @param bool $multiple True for multi-select list
|
||||
* @param int $size Number of rows to show (applies to multi-select box only)
|
||||
* @param string $selectAttr Additional attributes to defined for SELECT tag,
|
||||
* useful for holding javascript onChange='...' handlers, CSS class, etc.
|
||||
* @param bool $compareFirstCol When true (default), $defstr is compared against the value (column 2),
|
||||
* while false will compare against the description (column 1).
|
||||
*
|
||||
* changes by glen.davies@cce.ac.nz to support multiple hilited items
|
||||
* @return string HTML
|
||||
*/
|
||||
function GetMenu($name,$defstr='',$blank1stItem=true,$multiple=false,
|
||||
$size=0, $selectAttr='',$compareFields0=true)
|
||||
function getMenu($name, $defstr = '', $blank1stItem = true, $multiple = false,
|
||||
$size = 0, $selectAttr = '', $compareFirstCol = true)
|
||||
{
|
||||
global $ADODB_INCLUDED_LIB;
|
||||
if (empty($ADODB_INCLUDED_LIB)) {
|
||||
include(ADODB_DIR.'/adodb-lib.inc.php');
|
||||
}
|
||||
return _adodb_getmenu($this, $name,$defstr,$blank1stItem,$multiple,
|
||||
$size, $selectAttr,$compareFields0);
|
||||
return _adodb_getmenu($this, $name, $defstr, $blank1stItem, $multiple,
|
||||
$size, $selectAttr, $compareFirstCol);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Generate a SELECT tag string from a recordset, and return the string.
|
||||
* If the recordset has 2 cols, we treat the 1st col as the containing
|
||||
* the text to display to the user, and 2nd col as the return value. Default
|
||||
* strings are compared with the SECOND column.
|
||||
* Generate a SELECT tag with groups from a recordset, and return the HTML markup.
|
||||
*
|
||||
* The recordset must have 3 columns and be ordered by the 3rd column. The
|
||||
* first column contains the text to display to the user, the second is the
|
||||
* return value and the third is the option group. Extra columns are discarded.
|
||||
* Default strings are compared with the SECOND column.
|
||||
*
|
||||
* @param string $name Name of SELECT tag
|
||||
* @param string|array $defstr The value to highlight. Use an array for multiple highlight values.
|
||||
* @param bool|string $blank1stItem True to create an empty item (default), False not to add one;
|
||||
* 'string' to set its label and 'value:string' to assign a value to it.
|
||||
* @param bool $multiple True for multi-select list
|
||||
* @param int $size Number of rows to show (applies to multi-select box only)
|
||||
* @param string $selectAttr Additional attributes to defined for SELECT tag,
|
||||
* useful for holding javascript onChange='...' handlers, CSS class, etc.
|
||||
* @param bool $compareFirstCol When true (default), $defstr is compared against the value (column 2),
|
||||
* while false will compare against the description (column 1).
|
||||
*
|
||||
* @return string HTML
|
||||
*/
|
||||
function GetMenu2($name,$defstr='',$blank1stItem=true,$multiple=false,$size=0, $selectAttr='') {
|
||||
return $this->GetMenu($name,$defstr,$blank1stItem,$multiple,
|
||||
$size, $selectAttr,false);
|
||||
}
|
||||
|
||||
/*
|
||||
Grouped Menu
|
||||
*/
|
||||
function GetMenu3($name,$defstr='',$blank1stItem=true,$multiple=false,
|
||||
$size=0, $selectAttr='')
|
||||
function getMenuGrouped($name, $defstr = '', $blank1stItem = true, $multiple = false,
|
||||
$size = 0, $selectAttr = '', $compareFirstCol = true)
|
||||
{
|
||||
global $ADODB_INCLUDED_LIB;
|
||||
if (empty($ADODB_INCLUDED_LIB)) {
|
||||
include(ADODB_DIR.'/adodb-lib.inc.php');
|
||||
}
|
||||
return _adodb_getmenu_gp($this, $name,$defstr,$blank1stItem,$multiple,
|
||||
return _adodb_getmenu_gp($this, $name, $defstr, $blank1stItem, $multiple,
|
||||
$size, $selectAttr, $compareFirstCol);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a SELECT tag from a recordset, and return the HTML markup.
|
||||
*
|
||||
* Same as GetMenu(), except that default strings are compared with the
|
||||
* FIRST column (the description).
|
||||
*
|
||||
* @param string $name Name of SELECT tag
|
||||
* @param string|array $defstr The value to highlight. Use an array for multiple highlight values.
|
||||
* @param bool|string $blank1stItem True to create an empty item (default), False not to add one;
|
||||
* 'string' to set its label and 'value:string' to assign a value to it.
|
||||
* @param bool $multiple True for multi-select list
|
||||
* @param int $size Number of rows to show (applies to multi-select box only)
|
||||
* @param string $selectAttr Additional attributes to defined for SELECT tag,
|
||||
* useful for holding javascript onChange='...' handlers, CSS class, etc.
|
||||
*
|
||||
* @return string HTML
|
||||
*
|
||||
* @deprecated 5.21.0 Use getMenu() with $compareFirstCol = false instead.
|
||||
*/
|
||||
function getMenu2($name, $defstr = '', $blank1stItem = true, $multiple = false,
|
||||
$size = 0, $selectAttr = '')
|
||||
{
|
||||
return $this->getMenu($name, $defstr, $blank1stItem, $multiple,
|
||||
$size, $selectAttr,false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a SELECT tag with groups from a recordset, and return the HTML markup.
|
||||
*
|
||||
* Same as GetMenuGrouped(), except that default strings are compared with the
|
||||
* FIRST column (the description).
|
||||
*
|
||||
* @param string $name Name of SELECT tag
|
||||
* @param string|array $defstr The value to highlight. Use an array for multiple highlight values.
|
||||
* @param bool|string $blank1stItem True to create an empty item (default), False not to add one;
|
||||
* 'string' to set its label and 'value:string' to assign a value to it.
|
||||
* @param bool $multiple True for multi-select list
|
||||
* @param int $size Number of rows to show (applies to multi-select box only)
|
||||
* @param string $selectAttr Additional attributes to defined for SELECT tag,
|
||||
* useful for holding javascript onChange='...' handlers, CSS class, etc.
|
||||
*
|
||||
* @return string HTML
|
||||
*
|
||||
* @deprecated 5.21.0 Use getMenuGrouped() with $compareFirstCol = false instead.
|
||||
*/
|
||||
function getMenu3($name, $defstr = '', $blank1stItem = true, $multiple = false,
|
||||
$size = 0, $selectAttr = '')
|
||||
{
|
||||
return $this->getMenuGrouped($name, $defstr, $blank1stItem, $multiple,
|
||||
$size, $selectAttr, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* return recordset as a 2-dimensional array.
|
||||
*
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.14 06-Jan-2019
|
||||
* @version v5.20.15 24-Nov-2019
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim. All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.14 06-Jan-2019
|
||||
* @version v5.20.15 24-Nov-2019
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim. All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.14 06-Jan-2019
|
||||
* @version v5.20.15 24-Nov-2019
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim. All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim. All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -23,7 +23,7 @@ class ADODB_pdo_mysql extends ADODB_pdo {
|
||||
var $hasGenID = true;
|
||||
var $_genIDSQL = "update %s set id=LAST_INSERT_ID(id+1);";
|
||||
var $_dropSeqSQL = "drop table %s";
|
||||
var $fmtTimeStamp = "'Y-m-d, H:i:s'";
|
||||
var $fmtTimeStamp = "'Y-m-d H:i:s'";
|
||||
var $nameQuote = '`';
|
||||
|
||||
function _init($parentDriver)
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
@ -20,6 +20,12 @@ class ADODB_postgres8 extends ADODB_postgres7
|
||||
{
|
||||
var $databaseType = 'postgres8';
|
||||
|
||||
// From PostgreSQL 8.0 onwards, the adsrc column used in earlier versions to
|
||||
// retrieve the default value is obsolete and should not be used (see #562).
|
||||
var $metaDefaultsSQL = "SELECT d.adnum as num, pg_get_expr(d.adbin, d.adrelid) as def
|
||||
FROM pg_attrdef d, pg_class c
|
||||
WHERE d.adrelid=c.oid AND c.relname='%s'
|
||||
ORDER BY d.adnum";
|
||||
|
||||
/**
|
||||
* Retrieve last inserted ID
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
reserved.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim. All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,388 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Set tabs to 4.
|
||||
*/
|
||||
|
||||
/*
|
||||
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();
|
||||
|
||||
if (! defined("_ADODB_TEXT_LAYER")) {
|
||||
define("_ADODB_TEXT_LAYER", 1 );
|
||||
|
||||
// for sorting in _query()
|
||||
function adodb_cmp($a, $b) {
|
||||
if ($a[0] == $b[0]) return 0;
|
||||
return ($a[0] < $b[0]) ? -1 : 1;
|
||||
}
|
||||
// for sorting in _query()
|
||||
function adodb_cmpr($a, $b) {
|
||||
if ($a[0] == $b[0]) return 0;
|
||||
return ($a[0] > $b[0]) ? -1 : 1;
|
||||
}
|
||||
class ADODB_text extends ADOConnection {
|
||||
var $databaseType = 'text';
|
||||
|
||||
var $_origarray; // original data
|
||||
var $_types;
|
||||
var $_proberows = 8;
|
||||
var $_colnames;
|
||||
var $_skiprow1=false;
|
||||
var $readOnly = true;
|
||||
var $hasTransactions = false;
|
||||
|
||||
var $_rezarray;
|
||||
var $_reznames;
|
||||
var $_reztypes;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
function RSRecordCount()
|
||||
{
|
||||
if (!empty($this->_rezarray)) return sizeof($this->_rezarray);
|
||||
|
||||
return sizeof($this->_origarray);
|
||||
}
|
||||
|
||||
function _insertid()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
function _affectedrows()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// returns true or false
|
||||
function PConnect(&$array, $types = false, $colnames = false)
|
||||
{
|
||||
return $this->Connect($array, $types, $colnames);
|
||||
}
|
||||
// returns true or false
|
||||
function Connect(&$array, $types = false, $colnames = false)
|
||||
{
|
||||
if (is_string($array) and $array === 'iluvphplens') return 'me2';
|
||||
|
||||
if (!$array) {
|
||||
$this->_origarray = false;
|
||||
return true;
|
||||
}
|
||||
$row = $array[0];
|
||||
$cols = sizeof($row);
|
||||
|
||||
|
||||
if ($colnames) $this->_colnames = $colnames;
|
||||
else {
|
||||
$this->_colnames = $array[0];
|
||||
$this->_skiprow1 = true;
|
||||
}
|
||||
if (!$types) {
|
||||
// probe and guess the type
|
||||
$types = array();
|
||||
$firstrow = true;
|
||||
if ($this->_proberows > sizeof($array)) $max = sizeof($array);
|
||||
else $max = $this->_proberows;
|
||||
for ($j=($this->_skiprow1)?1:0;$j < $max; $j++) {
|
||||
$row = $array[$j];
|
||||
if (!$row) break;
|
||||
$i = -1;
|
||||
foreach($row as $v) {
|
||||
$i += 1;
|
||||
//print " ($i ".$types[$i]. "$v) ";
|
||||
$v = trim($v);
|
||||
if (!preg_match('/^[+-]{0,1}[0-9\.]+$/',$v)) {
|
||||
$types[$i] = 'C'; // once C, always C
|
||||
continue;
|
||||
}
|
||||
if (isset($types[$i]) && $types[$i]=='C') continue;
|
||||
if ($firstrow) {
|
||||
// If empty string, we presume is character
|
||||
// test for integer for 1st row only
|
||||
// after that it is up to testing other rows to prove
|
||||
// that it is not an integer
|
||||
if (strlen($v) == 0) $types[0] = 'C';
|
||||
if (strpos($v,'.') !== false) $types[0] = 'N';
|
||||
else $types[$i] = 'I';
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strpos($v,'.') !== false) $types[$i] = 'N';
|
||||
|
||||
}
|
||||
$firstrow = false;
|
||||
}
|
||||
}
|
||||
//print_r($types);
|
||||
$this->_origarray = $array;
|
||||
$this->_types = $types;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// returns queryID or false
|
||||
// We presume that the select statement is on the same table (what else?),
|
||||
// with the only difference being the order by.
|
||||
//You can filter by using $eval and each clause is stored in $arr .eg. $arr[1] == 'name'
|
||||
// also supports SELECT [DISTINCT] COL FROM ... -- only 1 col supported
|
||||
function _query($sql,$input_arr,$eval=false)
|
||||
{
|
||||
if ($this->_origarray === false) return false;
|
||||
|
||||
$eval = $this->evalAll;
|
||||
$usql = strtoupper(trim($sql));
|
||||
$usql = preg_replace("/[\t\n\r]/",' ',$usql);
|
||||
$usql = preg_replace('/ *BY/i',' BY',strtoupper($usql));
|
||||
|
||||
$eregword ='([A-Z_0-9]*)';
|
||||
//print "<BR> $sql $eval ";
|
||||
if ($eval) {
|
||||
$i = 0;
|
||||
foreach($this->_colnames as $n) {
|
||||
$n = strtoupper(trim($n));
|
||||
$eval = str_replace("\$$n","\$arr[$i]",$eval);
|
||||
|
||||
$i += 1;
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$eval = "\$rez=($eval);";
|
||||
//print "<p>Eval string = $eval </p>";
|
||||
$where_arr = array();
|
||||
|
||||
reset($this->_origarray);
|
||||
foreach ($this->_origarray as $arr) {
|
||||
|
||||
if ($i == 0 && $this->_skiprow1)
|
||||
$where_arr[] = $arr;
|
||||
else {
|
||||
eval($eval);
|
||||
//print " $i: result=$rez arr[0]={$arr[0]} arr[1]={$arr[1]} <BR>\n ";
|
||||
if ($rez) $where_arr[] = $arr;
|
||||
}
|
||||
$i += 1;
|
||||
}
|
||||
$this->_rezarray = $where_arr;
|
||||
}else
|
||||
$where_arr = $this->_origarray;
|
||||
|
||||
// THIS PROJECTION CODE ONLY WORKS FOR 1 COLUMN,
|
||||
// OTHERWISE IT RETURNS ALL COLUMNS
|
||||
if (substr($usql,0,7) == 'SELECT ') {
|
||||
$at = strpos($usql,' FROM ');
|
||||
$sel = trim(substr($usql,7,$at-7));
|
||||
|
||||
$distinct = false;
|
||||
if (substr($sel,0,8) == 'DISTINCT') {
|
||||
$distinct = true;
|
||||
$sel = trim(substr($sel,8,$at));
|
||||
}
|
||||
|
||||
// $sel holds the selection clause, comma delimited
|
||||
// currently we only project if one column is involved
|
||||
// this is to support popups in PHPLens
|
||||
if (strpos(',',$sel)===false) {
|
||||
$colarr = array();
|
||||
|
||||
preg_match("/$eregword/",$sel,$colarr);
|
||||
$col = $colarr[1];
|
||||
$i = 0;
|
||||
$n = '';
|
||||
reset($this->_colnames);
|
||||
foreach ($this->_colnames as $n) {
|
||||
|
||||
if ($col == strtoupper(trim($n))) break;
|
||||
$i += 1;
|
||||
}
|
||||
|
||||
if ($n && $col) {
|
||||
$distarr = array();
|
||||
$projarray = array();
|
||||
$projtypes = array($this->_types[$i]);
|
||||
$projnames = array($n);
|
||||
|
||||
foreach ($where_arr as $a) {
|
||||
if ($i == 0 && $this->_skiprow1) {
|
||||
$projarray[] = array($n);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($distinct) {
|
||||
$v = strtoupper($a[$i]);
|
||||
if (! $distarr[$v]) {
|
||||
$projarray[] = array($a[$i]);
|
||||
$distarr[$v] = 1;
|
||||
}
|
||||
} else
|
||||
$projarray[] = array($a[$i]);
|
||||
|
||||
} //foreach
|
||||
//print_r($projarray);
|
||||
}
|
||||
} // check 1 column in projection
|
||||
} // is SELECT
|
||||
|
||||
if (empty($projarray)) {
|
||||
$projtypes = $this->_types;
|
||||
$projarray = $where_arr;
|
||||
$projnames = $this->_colnames;
|
||||
}
|
||||
$this->_rezarray = $projarray;
|
||||
$this->_reztypes = $projtypes;
|
||||
$this->_reznames = $projnames;
|
||||
|
||||
|
||||
$pos = strpos($usql,' ORDER BY ');
|
||||
if ($pos === false) return $this;
|
||||
$orderby = trim(substr($usql,$pos+10));
|
||||
|
||||
preg_match("/$eregword/",$orderby,$arr);
|
||||
if (sizeof($arr) < 2) return $this; // actually invalid sql
|
||||
$col = $arr[1];
|
||||
$at = (integer) $col;
|
||||
if ($at == 0) {
|
||||
$i = 0;
|
||||
reset($projnames);
|
||||
foreach ($projnames as $n) {
|
||||
if (strtoupper(trim($n)) == $col) {
|
||||
$at = $i+1;
|
||||
break;
|
||||
}
|
||||
$i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($at <= 0 || $at > sizeof($projarray[0])) return $this; // cannot find sort column
|
||||
$at -= 1;
|
||||
|
||||
// generate sort array consisting of (sortval1, row index1) (sortval2, row index2)...
|
||||
$sorta = array();
|
||||
$t = $projtypes[$at];
|
||||
$num = ($t == 'I' || $t == 'N');
|
||||
for ($i=($this->_skiprow1)?1:0, $max = sizeof($projarray); $i < $max; $i++) {
|
||||
$row = $projarray[$i];
|
||||
$val = ($num)?(float)$row[$at]:$row[$at];
|
||||
$sorta[]=array($val,$i);
|
||||
}
|
||||
|
||||
// check for desc sort
|
||||
$orderby = substr($orderby,strlen($col)+1);
|
||||
$arr == array();
|
||||
preg_match('/([A-Z_0-9]*)/i',$orderby,$arr);
|
||||
|
||||
if (trim($arr[1]) == 'DESC') $sortf = 'adodb_cmpr';
|
||||
else $sortf = 'adodb_cmp';
|
||||
|
||||
// hasta la sorta babe
|
||||
usort($sorta, $sortf);
|
||||
|
||||
// rearrange original array
|
||||
$arr2 = array();
|
||||
if ($this->_skiprow1) $arr2[] = $projarray[0];
|
||||
foreach($sorta as $v) {
|
||||
$arr2[] = $projarray[$v[1]];
|
||||
}
|
||||
|
||||
$this->_rezarray = $arr2;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/* Returns: the last error message from previous database operation */
|
||||
function ErrorMsg()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/* Returns: the last error number from previous database operation */
|
||||
function ErrorNo()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// returns true or false
|
||||
function _close()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------------------
|
||||
Class Name: Recordset
|
||||
--------------------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
class ADORecordSet_text extends ADORecordSet_array
|
||||
{
|
||||
|
||||
var $databaseType = "text";
|
||||
|
||||
function __construct(&$conn,$mode=false)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->InitArray($conn->_rezarray,$conn->_reztypes,$conn->_reznames);
|
||||
$conn->_rezarray = false;
|
||||
}
|
||||
|
||||
} // class ADORecordSet_text
|
||||
|
||||
|
||||
} // defined
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.14 06-Jan-2019
|
||||
@version v5.20.15 24-Nov-2019
|
||||
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.14 06-Jan-2019
|
||||
* @version v5.20.15 24-Nov-2019
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
|
@ -1,68 +0,0 @@
|
||||
>> ADODB Library for PHP5
|
||||
|
||||
(c) 2000-2012 John Lim (jlim@natsoft.com)
|
||||
|
||||
Released under both BSD and GNU Lesser GPL library license.
|
||||
This means you can use it in proprietary products.
|
||||
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
PHP's database access functions are not standardised. This creates a
|
||||
need for a database class library to hide the differences between the
|
||||
different databases (encapsulate the differences) so we can easily
|
||||
switch databases.
|
||||
|
||||
We currently support MySQL, Interbase, Sybase, PostgreSQL, Oracle,
|
||||
Microsoft SQL server, Foxpro ODBC, Access ODBC, Informix, DB2,
|
||||
Sybase SQL Anywhere, generic ODBC and Microsoft's ADO.
|
||||
|
||||
We hope more people will contribute drivers to support other databases.
|
||||
|
||||
|
||||
Documentation and Examples
|
||||
==========================
|
||||
|
||||
Refer to the adodb/docs directory for full documentation and examples.
|
||||
There is also a tutorial tute.htm that contrasts ADODB code with
|
||||
mysql code.
|
||||
|
||||
|
||||
|
||||
Files
|
||||
=====
|
||||
|
||||
adodb.inc.php is the main file. You need to include only this file.
|
||||
|
||||
adodb-*.inc.php are the database specific driver code.
|
||||
|
||||
test.php contains a list of test commands to exercise the class library.
|
||||
|
||||
adodb-session.php is the PHP4 session handling code.
|
||||
|
||||
testdatabases.inc.php contains the list of databases to apply the tests on.
|
||||
|
||||
Benchmark.php is a simple benchmark to test the throughput of a simple SELECT
|
||||
statement for databases described in testdatabases.inc.php. The benchmark
|
||||
tables are created in test.php.
|
||||
|
||||
readme.htm is the main documentation.
|
||||
|
||||
tute.htm is the tutorial.
|
||||
|
||||
|
||||
More Info
|
||||
=========
|
||||
|
||||
For more information, including installation see readme.htm
|
||||
or visit
|
||||
http://adodb.sourceforge.net/
|
||||
|
||||
|
||||
>> Feature Requests and Bug Reports
|
||||
|
||||
Email to jlim@natsoft.com
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
Description of ADODB V5.20.14 library import into Moodle
|
||||
Description of ADODB V5.20.15 library import into Moodle
|
||||
|
||||
This library will be probably removed in Moodle 2.1,
|
||||
it is now used only in enrol and auth db plugins.
|
||||
@ -15,21 +15,14 @@ Removed:
|
||||
* session/
|
||||
* tests/
|
||||
* composer.json
|
||||
* README.md
|
||||
* server.php
|
||||
* lang/* except en (because they were not in utf8)
|
||||
|
||||
Renamed:
|
||||
* LICENSE.md -> license.txt
|
||||
|
||||
Added:
|
||||
* index.html - prevent directory browsing on misconfigured servers
|
||||
* readme_moodle.txt - this file ;-)
|
||||
|
||||
Our changes:
|
||||
* Removed random seed initialization from lib/adodb/adodb.inc.php:216 (see 038f546 and MDL-41198).
|
||||
* MDL-52286 Added muting erros in ADORecordSet::__destruct().
|
||||
Check if fixed upstream during the next upgrade and remove this note. (8638b3f1441d4b928)
|
||||
* MDL-67034 Fixes to make the library php74 compliant.
|
||||
|
||||
skodak, iarenaza, moodler, stronk7, abgreeve, lameze, ankitagarwal, marinaglancy
|
||||
skodak, iarenaza, moodler, stronk7, abgreeve, lameze, ankitagarwal, marinaglancy, rezaie9
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.14 06-Jan-2019
|
||||
* @version v5.20.15 24-Nov-2019
|
||||
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
* Released under both BSD license and Lesser GPL library license.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user