Commit 82d08c95 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic
Browse files

Bug 1672867: Upgrade ADODB to version 5.20.9

behatnotneeded

Change-Id: I01902e8dc67c873da5a6d0c3012118764c0c47ad
parent af028885
This diff is collapsed.
......@@ -2,7 +2,7 @@ adodb
-----
Website: http://adodb.sourceforge.net/
Version: 5.20.5
Version: 5.20.9
Modifications:
......
ADOdb Library for PHP5
======================
[![Join chat on Gitter](https://img.shields.io/gitter/room/form-data/form-data.svg)](https://gitter.im/adodb/adodb?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Download ADOdb](https://img.shields.io/sourceforge/dm/adodb.svg)](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
Released under both [BSD 3-Clause](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md#bsd-3-clause-license)
and [GNU Lesser GPL library 2.1](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md#gnu-lesser-general-public-license)
licenses.
This means you can use it in proprietary products;
see [License](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md) for details.
Home page: http://adodb.org/
> **WARNING: known issue with Associative Fetch Mode in ADOdb v5.19
-- PLEASE UPGRADE TO v5.20 !**
> When fetching data in Associative mode (i.e. when `$ADODB_FETCH_MODE` is
> set to *ADODB_FETCH_ASSOC*), recordsets do not return any data (empty strings)
> when using some database drivers. The problem has been reported on MSSQL,
> Interbase and Foxpro, but possibly affects other drivers as well; all drivers
> derived from the above are also impacted.
> For further details, please refer to [Issue #20](https://github.com/ADOdb/ADOdb/issues/20).
Introduction
============
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.
<?php
/*
@version v5.20.5 10-Aug-2016
@version v5.20.9 21-Dec-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
Latest version is available at http://adodb.sourceforge.net
......
<?php
/*
@version v5.20.5 10-Aug-2016
@version v5.20.9 21-Dec-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
Latest version is available at http://adodb.sourceforge.net
......
......@@ -8,7 +8,7 @@ $ADODB_INCLUDED_CSV = 1;
/*
@version v5.20.5 10-Aug-2016
@version v5.20.9 21-Dec-2016
@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.
......
<?php
/**
@version v5.20.5 10-Aug-2016
@version v5.20.9 21-Dec-2016
@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.
......
<?php
/**
* @version v5.20.5 10-Aug-2016
* @version v5.20.9 21-Dec-2016
* @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.
......
<?php
/**
* @version v5.20.5 10-Aug-2016
* @version v5.20.9 21-Dec-2016
* @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.
......
<?php
/**
* @version v5.20.5 10-Aug-2016
* @version v5.20.9 21-Dec-2016
* @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.
......
<?php
/**
* @version v5.20.5 10-Aug-2016
* @version v5.20.9 21-Dec-2016
* @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.
......@@ -33,16 +33,16 @@ var $database = '';
case 'EXECUTE':
$this->sql = is_array($p1) ? $p1[0] : $p1;
$this->params = $p2;
$s = "$dbms error: [$errno: $errmsg] in $fn(\"$this->sql\")\n";
$s = "$dbms error: [$errno: $errmsg] in $fn(\"$this->sql\")";
break;
case 'PCONNECT':
case 'CONNECT':
$user = $thisConnection->user;
$s = "$dbms error: [$errno: $errmsg] in $fn($p1, '$user', '****', $p2)\n";
$s = "$dbms error: [$errno: $errmsg] in $fn($p1, '$user', '****', $p2)";
break;
default:
$s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)\n";
$s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)";
break;
}
......
<?php
/*
@version v5.20.5 10-Aug-2016
@version v5.20.9 21-Dec-2016
@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.5 10-Aug-2016
@version v5.20.9 21-Dec-2016
@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.
......
......@@ -11,7 +11,7 @@ if (empty($ADODB_INCLUDED_CSV)) include_once(ADODB_DIR.'/adodb-csvlib.inc.php');
/*
@version v5.20.5 10-Aug-2016
@version v5.20.9 21-Dec-2016
@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.
......
<?php
/*
@version v5.20.5 10-Aug-2016
@version v5.20.9 21-Dec-2016
@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.
......@@ -59,7 +59,7 @@ class ADODB_Pager {
//
function __construct(&$db,$sql,$id = 'adodb', $showPageLinks = false)
{
global $PHP_SELF, $SESSION;
global $PHP_SELF;
$curr_page = $id.'_curr_page';
if (!empty($PHP_SELF)) $PHP_SELF = htmlspecialchars($_SERVER['PHP_SELF']); // htmlspecialchars() to prevent XSS attacks
......@@ -72,11 +72,11 @@ class ADODB_Pager {
$next_page = $id.'_next_page';
if (isset($_GET[$next_page])) {
$SESSION->set($curr_page, (integer) $_GET[$next_page]);
$_SESSION[$curr_page] = (integer) $_GET[$next_page];
}
if (empty($SESSION->get($curr_page))) $SESSION->set($curr_page, 1); ## at first page
if (empty($_SESSION[$curr_page])) $_SESSION[$curr_page] = 1; ## at first page
$this->curr_page = $SESSION->get($curr_page);
$this->curr_page = $_SESSION[$curr_page];
}
......
<?php
/**
* @version v5.20.5 10-Aug-2016
* @version v5.20.9 21-Dec-2016
* @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.
......
This diff is collapsed.
<?php
/*
@version v5.20.5 10-Aug-2016
@version v5.20.9 21-Dec-2016
@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.
......
......@@ -3,7 +3,7 @@
ADOdb Date Library, part of the ADOdb abstraction library
Download: http://adodb.sourceforge.net/#download
@version v5.20.5 10-Aug-2016
@version v5.20.9 21-Dec-2016
@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.5 10-Aug-2016
@version v5.20.9 21-Dec-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
......@@ -37,6 +37,21 @@
if (!defined('_ADODB_LAYER')) {
define('_ADODB_LAYER',1);
// The ADOdb extension is no longer maintained and effectively unsupported
// since v5.04. The library will not function properly if it is present.
if(defined('ADODB_EXTENSION')) {
$msg = "Unsupported ADOdb Extension (v" . ADODB_EXTENSION . ") detected! "
. "Disable it to use ADOdb";
$errorfn = defined('ADODB_ERROR_HANDLER') ? ADODB_ERROR_HANDLER : false;
if ($errorfn) {
$conn = false;
$errorfn('ADOdb', basename(__FILE__), -9999, $msg, null, null, $conn);
} else {
die($msg . PHP_EOL);
}
}
//==============================================================================================
// CONSTANT DEFINITIONS
//==============================================================================================
......@@ -87,24 +102,6 @@ if (!defined('_ADODB_LAYER')) {
define('ADODB_FORCE_VALUE',3);
// ********************************************************
/**
* Associative array case constants
*
* By defining the ADODB_ASSOC_CASE constant to one of these values, it is
* possible to control the case of field names (associative array's keys)
* when operating in ADODB_FETCH_ASSOC fetch mode.
* - LOWER: $rs->fields['orderid']
* - UPPER: $rs->fields['ORDERID']
* - NATIVE: $rs->fields['OrderID'] (or whatever the RDBMS will return)
*
* The default is to use native case-names.
*
* NOTE: This functionality is not implemented everywhere, it currently
* works only with: mssql, odbc, oci8 and ibase derived drivers
*/
define('ADODB_ASSOC_CASE_LOWER', 0);
define('ADODB_ASSOC_CASE_UPPER', 1);
define('ADODB_ASSOC_CASE_NATIVE', 2);
if (!$ADODB_EXTENSION || ADODB_EXTENSION < 4.0) {
......@@ -136,6 +133,25 @@ if (!defined('_ADODB_LAYER')) {
define('ADODB_FETCH_ASSOC', 2);
define('ADODB_FETCH_BOTH', 3);
/**
* Associative array case constants
*
* By defining the ADODB_ASSOC_CASE constant to one of these values, it is
* possible to control the case of field names (associative array's keys)
* when operating in ADODB_FETCH_ASSOC fetch mode.
* - LOWER: $rs->fields['orderid']
* - UPPER: $rs->fields['ORDERID']
* - NATIVE: $rs->fields['OrderID'] (or whatever the RDBMS will return)
*
* The default is to use native case-names.
*
* NOTE: This functionality is not implemented everywhere, it currently
* works only with: mssql, odbc, oci8 and ibase derived drivers
*/
define('ADODB_ASSOC_CASE_LOWER', 0);
define('ADODB_ASSOC_CASE_UPPER', 1);
define('ADODB_ASSOC_CASE_NATIVE', 2);
if (!defined('TIMESTAMP_FIRST_YEAR')) {
define('TIMESTAMP_FIRST_YEAR',100);
......@@ -216,7 +232,7 @@ if (!defined('_ADODB_LAYER')) {
/**
* ADODB version as a string.
*/
$ADODB_vers = 'v5.20.5 10-Aug-2016';
$ADODB_vers = 'v5.20.9 21-Dec-2016';
/**
* Determines whether recordset->RecordCount() is used.
......@@ -414,11 +430,11 @@ if (!defined('_ADODB_LAYER')) {
var $dataProvider = 'native';
var $databaseType = ''; /// RDBMS currently in use, eg. odbc, mysql, mssql
var $database = ''; /// Name of database to be used.
var $host = ''; /// The hostname of the database server
var $user = ''; /// The username which is used to connect to the database server.
private $password = ''; /// Password for the username. This is required for __wakeup
var $debug = false; /// if set to true will output sql statements
var $maxblobsize = 262144; /// maximum size of blobs or large text fields (262144 = 256K)-- some db's die otherwise like foxpro
var $host = ''; /// The hostname of the database server
var $user = ''; /// The username which is used to connect to the database server.
var $password = ''; /// Password for the username. For security, we no longer store it.
var $debug = false; /// if set to true will output sql statements
var $maxblobsize = 262144; /// maximum size of blobs or large text fields (262144 = 256K)-- some db's die otherwise like foxpro
var $concat_operator = '+'; /// default concat operator -- change to || for Oracle/Interbase
var $substr = 'substr'; /// substring operator
var $length = 'length'; /// string length ofperator
......@@ -638,7 +654,7 @@ if (!defined('_ADODB_LAYER')) {
$this->user = $argUsername;
}
if ($argPassword != "") {
$this->password = $argPassword;
$this->password = 'not stored'; // not stored for security reasons
}
if ($argDatabaseName != "") {
$this->database = $argDatabaseName;
......@@ -1141,7 +1157,7 @@ if (!defined('_ADODB_LAYER')) {
);
return false;
}
// clean memory
unset($element0);
......@@ -3023,9 +3039,6 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1
return $rs;
}
function __wakeup() {
$this->Connect($this->host, $this->user, $this->password, $this->database, true);
}
} // end class ADOConnection
......@@ -3465,7 +3478,7 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1
}
// Determine whether the array is associative or 0-based numeric
$numIndex = is_array($this->fields) && array_key_exists(0, $this->fields);
$numIndex = array_keys($this->fields) == range(0, count($this->fields) - 1);
$results = array();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment