Skip to content

Commit

Permalink
PHP 7.1 Updates (#992)
Browse files Browse the repository at this point in the history
* AdoDB library update

* Change AdoDB directory, update references in code

* Delete AdoDB from the library folder

* Conflict resolved, deleted files that had no usage and modified a reference to them
  • Loading branch information
Perseus authored and aethelwulffe committed Mar 16, 2018
1 parent ee8d015 commit 24ab467
Show file tree
Hide file tree
Showing 234 changed files with 15,437 additions and 1,873 deletions.
10 changes: 10 additions & 0 deletions assets/adodb/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# IDE/Editor temporary files
*~
*.swp
*.bak
*.tmp
.project
.settings/
/nbproject/
.idea/

4 changes: 4 additions & 0 deletions assets/adodb/.mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Andreas Fernandez <[email protected]> <[email protected]>
Mike Benoit <[email protected]> MikeB <[email protected]>
Mike Benoit <[email protected]> mike.benoit

11 changes: 7 additions & 4 deletions library/adodb/LICENSE.md → assets/adodb/LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
ADOdb License
=============

ADOdb is dual licensed under BSD and LGPL.
The ADOdb Library is dual-licensed, released under both the
[BSD 3-clause](#bsd-3-clause-license) and the
[GNU Lesser General Public License (LGPL) v2.1](#gnu-lesser-general-public-license)
or, at your option, any later version.

In plain English, you do not need to distribute your application in source code form,
nor do you need to distribute ADOdb source code, provided you follow the rest of
terms of the BSD license.

For more info about ADOdb, visit http://adodb.sourceforge.net/
For more information about ADOdb, visit http://adodb.org/

BSD 3-Clause License
--------------------

(c) 2000-2013 John Lim ([email protected])
(c) 2014 Damien Regad, Mark Newnham and the ADOdb community
(c) 2000-2013 John Lim ([email protected])
(c) 2014 Damien Regad, Mark Newnham and the ADOdb community
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
43 changes: 17 additions & 26 deletions library/adodb/README.md → assets/adodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,21 @@ 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 ([email protected])
(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;
(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.sourceforge.net/

> **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).
Home page: http://adodb.org/


Introduction
Expand Down Expand Up @@ -66,18 +61,14 @@ print "</pre>";
Documentation and Examples
==========================

Refer to the `docs` directory for library 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: `docs-adodb.htm`.
Query, update and insert records using a portable API.
- Data dictionary docs: `docs-datadict.htm`.
Describes how to create database tables and indexes in a portable manner.
- Database performance monitoring docs: `docs-perf.htm`.
Allows you to perform health checks, tune and monitor your database.
- Database-backed session docs: `docs-session.htm`.
- [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 `tute.htm` that contrasts ADOdb code with
mysql code.
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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/*
@version v5.20.2 27-Dec-2015
@version v5.21.0-dev ??-???-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
Expand Down Expand Up @@ -522,7 +522,7 @@ function UpdateActiveTable($pkeys=false,$forceUpdate=false)
$activetab->_created = time();
$s = serialize($activetab);
if (!function_exists('adodb_write_file')) {
include(ADODB_DIR.'/adodb-csvlib.inc.php');
include_once(ADODB_DIR.'/adodb-csvlib.inc.php');
}
adodb_write_file($fname,$s);
}
Expand Down Expand Up @@ -1124,7 +1124,7 @@ function adodb_GetActiveRecordsClass(&$db, $class, $table,$whereOrderBy,$bindarr
// arrRef will be the structure that knows about our objects.
// It is an associative array.
// We will, however, return arr, preserving regular 0.. order so that
// obj[0] can be used by bootstrap developpers.
// obj[0] can be used by app developpers.
$arrRef = array();
$bTos = array(); // Will store belongTo's indices if any
foreach($rows as $row) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/*
@version v5.20.2 27-Dec-2015
@version v5.21.0-dev ??-???-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
Expand Down Expand Up @@ -551,7 +551,7 @@ function UpdateActiveTable($pkeys=false,$forceUpdate=false)
$activetab->_created = time();
$s = serialize($activetab);
if (!function_exists('adodb_write_file')) {
include(ADODB_DIR.'/adodb-csvlib.inc.php');
include_once(ADODB_DIR.'/adodb-csvlib.inc.php');
}
adodb_write_file($fname,$s);
}
Expand Down Expand Up @@ -1300,7 +1300,7 @@ function adodb_GetActiveRecordsClass(&$db, $class, $tableObj,$whereOrderBy,$bind


if (!isset($_ADODB_ACTIVE_DBS)) {
include(ADODB_DIR.'/adodb-active-record.inc.php');
include_once(ADODB_DIR.'/adodb-active-record.inc.php');
}
if (!class_exists($class)) {
$db->outp_throw("Unknown class $class in GetActiveRecordsClass()",'GetActiveRecordsClass');
Expand All @@ -1311,7 +1311,7 @@ function adodb_GetActiveRecordsClass(&$db, $class, $tableObj,$whereOrderBy,$bind
// arrRef will be the structure that knows about our objects.
// It is an associative array.
// We will, however, return arr, preserving regular 0.. order so that
// obj[0] can be used by bootstrap developpers.
// obj[0] can be used by app developpers.
$arrRef = array();
$bTos = array(); // Will store belongTo's indices if any
foreach($rows as $row) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/*
@version v5.20.2 27-Dec-2015
@version v5.21.0-dev ??-???-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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
@version v5.20.2 27-Dec-2015
@version v5.21.0-dev ??-???-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.
Expand Down Expand Up @@ -326,7 +326,7 @@ function MetaType($t,$len=-1,$fieldobj=false)
if (!$this->connection->IsConnected()) {
$t = strtoupper($t);
if (isset($typeMap[$t])) return $typeMap[$t];
return 'N';
return ADODB_DEFAULT_METATYPE;
}
return $this->connection->MetaType($t,$len,$fieldobj);
}
Expand Down Expand Up @@ -520,7 +520,7 @@ function RenameColumnSQL($tabname,$oldcolumn,$newcolumn,$flds='')
list($lines,$pkey,$idxs) = $this->_GenFields($flds);
// genfields can return FALSE at times
if ($lines == null) $lines = array();
list(,$first) = each($lines);
$first = current($lines);
list(,$column_def) = preg_split("/[\t ]+/",$first,2);
}
return array(sprintf($this->renameColumn,$tabname,$this->NameQuote($oldcolumn),$this->NameQuote($newcolumn),$column_def));
Expand Down Expand Up @@ -660,12 +660,17 @@ function _GenFields($flds,$widespacing=false)
$funsigned = false;
$findex = '';
$funiqueindex = false;
$fOptions = array();

//-----------------
// Parse attributes
foreach($fld as $attr => $v) {
if ($attr == 2 && is_numeric($v)) $attr = 'SIZE';
else if (is_numeric($attr) && $attr > 1 && !is_numeric($v)) $attr = strtoupper($v);
if ($attr == 2 && is_numeric($v))
$attr = 'SIZE';
elseif ($attr == 2 && strtoupper($ftype) == 'ENUM')
$attr = 'ENUM';
else if (is_numeric($attr) && $attr > 1 && !is_numeric($v))
$attr = strtoupper($v);

switch($attr) {
case '0':
Expand Down Expand Up @@ -697,6 +702,8 @@ function _GenFields($flds,$widespacing=false)
// let INDEX keyword create a 'very standard' index on column
case 'INDEX': $findex = $v; break;
case 'UNIQUE': $funiqueindex = true; break;
case 'ENUM':
$fOptions['ENUM'] = $v; break;
} //switch
} // foreach $fld

Expand All @@ -717,7 +724,7 @@ function _GenFields($flds,$widespacing=false)
$ftype = strtoupper($ftype);
}

$ftype = $this->_GetSize($ftype, $ty, $fsize, $fprec);
$ftype = $this->_GetSize($ftype, $ty, $fsize, $fprec, $fOptions);

if ($ty == 'X' || $ty == 'X2' || $ty == 'B') $fnotnull = false; // some blob types do not accept nulls

Expand Down Expand Up @@ -806,13 +813,32 @@ function _GenFields($flds,$widespacing=false)
$ftype is the actual type
$ty is the type defined originally in the DDL
*/
function _GetSize($ftype, $ty, $fsize, $fprec)
function _GetSize($ftype, $ty, $fsize, $fprec, $options=false)
{
if (strlen($fsize) && $ty != 'X' && $ty != 'B' && strpos($ftype,'(') === false) {
$ftype .= "(".$fsize;
if (strlen($fprec)) $ftype .= ",".$fprec;
$ftype .= ')';
}

/*
* Handle additional options
*/
if (is_array($options))
{
foreach($options as $type=>$value)
{
switch ($type)
{
case 'ENUM':
$ftype .= '(' . $value . ')';
break;

default:
}
}
}

return $ftype;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @version v5.20.2 27-Dec-2015
* @version v5.21.0-dev ??-???-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.
Expand Down Expand Up @@ -70,6 +70,10 @@ function adodb_error($provider,$dbType,$errno)
case 'oracle':
case 'oci8': $map = adodb_error_oci8(); break;

// As discussed in https://github.com/ADOdb/ADOdb/issues/201#issuecomment-188154980
// firebird uses the ibase error handler for now. This may change if and
// when the PHP driver is updated to use the new SQLSTATE error codes
case 'firebird':
case 'ibase': $map = adodb_error_ibase(); break;

case 'odbc': $map = adodb_error_odbc(); break;
Expand Down Expand Up @@ -111,7 +115,7 @@ function adodb_error_pg($errormsg)
'could not serialize access due to' => DB_ERROR_SERIALIZATION_FAILURE
);
reset($error_regexps);
while (list($regexp,$code) = each($error_regexps)) {
foreach ($error_regexps as $regexp => $code) {
if (preg_match("/$regexp/mi", $errormsg)) {
return $code;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @version v5.20.2 27-Dec-2015
* @version v5.21.0-dev ??-???-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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @version v5.20.2 27-Dec-2015
* @version v5.21.0-dev ??-???-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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @version v5.20.2 27-Dec-2015
* @version v5.21.0-dev ??-???-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.
Expand Down Expand Up @@ -33,16 +33,16 @@ function __construct($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection)
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;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
@version v5.20.2 27-Dec-2015
@version v5.21.0-dev ??-???-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.
Expand Down
Loading

0 comments on commit 24ab467

Please sign in to comment.