Merge branch 'wip-MDL-58546-master' of git://github.com/marinaglancy/moodle
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
@version v5.20.7 20-Sep-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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
@version v5.20.7 20-Sep-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.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.7 20-Sep-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.
|
||||
@@ -520,7 +520,7 @@ class ADODB_DataDict {
|
||||
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));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.7 20-Sep-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.
|
||||
@@ -111,7 +111,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;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.7 20-Sep-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.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.7 20-Sep-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.7 20-Sep-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
|
||||
|
||||
@@ -233,7 +233,7 @@ if (!defined('_ADODB_LAYER')) {
|
||||
/**
|
||||
* ADODB version as a string.
|
||||
*/
|
||||
$ADODB_vers = 'v5.20.7 20-Sep-2016';
|
||||
$ADODB_vers = 'v5.20.9 21-Dec-2016';
|
||||
|
||||
/**
|
||||
* Determines whether recordset->RecordCount() is used.
|
||||
@@ -1164,8 +1164,7 @@ if (!defined('_ADODB_LAYER')) {
|
||||
|
||||
foreach($inputarr as $arr) {
|
||||
$sql = ''; $i = 0;
|
||||
//Use each() instead of foreach to reduce memory usage -mikefedyk
|
||||
while(list(, $v) = each($arr)) {
|
||||
foreach ($arr as $v) {
|
||||
$sql .= $sqlarr[$i];
|
||||
// from Ron Baldwin <ron.baldwin#sourceprose.com>
|
||||
// Only quote string types
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.7 20-Sep-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.
|
||||
@@ -146,19 +146,69 @@ class ADODB2_mssqlnative extends ADODB_DataDict {
|
||||
return $sql;
|
||||
}
|
||||
|
||||
/*
|
||||
function AlterColumnSQL($tabname, $flds, $tableflds='', $tableoptions='')
|
||||
function DefaultConstraintname($tabname, $colname)
|
||||
{
|
||||
$constraintname = false;
|
||||
$rs = $this->connection->Execute(
|
||||
"SELECT name FROM sys.default_constraints
|
||||
WHERE object_name(parent_object_id) = '$tabname'
|
||||
AND col_name(parent_object_id, parent_column_id) = '$colname'"
|
||||
);
|
||||
if ( is_object($rs) ) {
|
||||
$row = $rs->FetchRow();
|
||||
$constraintname = $row['name'];
|
||||
}
|
||||
return $constraintname;
|
||||
}
|
||||
|
||||
function AlterColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
|
||||
{
|
||||
$tabname = $this->TableName ($tabname);
|
||||
$sql = array();
|
||||
list($lines,$pkey) = $this->_GenFields($flds);
|
||||
foreach($lines as $v) {
|
||||
$sql[] = "ALTER TABLE $tabname $this->alterCol $v";
|
||||
}
|
||||
|
||||
list($lines,$pkey,$idxs) = $this->_GenFields($flds);
|
||||
$alter = 'ALTER TABLE ' . $tabname . $this->alterCol . ' ';
|
||||
foreach($lines as $v) {
|
||||
$not_null = false;
|
||||
if ($not_null = preg_match('/NOT NULL/i',$v)) {
|
||||
$v = preg_replace('/NOT NULL/i','',$v);
|
||||
}
|
||||
if (preg_match('/^([^ ]+) .*DEFAULT (\'[^\']+\'|\"[^\"]+\"|[^ ]+)/',$v,$matches)) {
|
||||
list(,$colname,$default) = $matches;
|
||||
$v = preg_replace('/^' . preg_quote($colname) . '\s/', '', $v);
|
||||
$t = trim(str_replace('DEFAULT '.$default,'',$v));
|
||||
if ( $constraintname = $this->DefaultConstraintname($tabname,$colname) ) {
|
||||
$sql[] = 'ALTER TABLE '.$tabname.' DROP CONSTRAINT '. $constraintname;
|
||||
}
|
||||
if ($not_null) {
|
||||
$sql[] = $alter . $colname . ' ' . $t . ' NOT NULL';
|
||||
} else {
|
||||
$sql[] = $alter . $colname . ' ' . $t ;
|
||||
}
|
||||
$sql[] = 'ALTER TABLE ' . $tabname
|
||||
. ' ADD CONSTRAINT DF__' . $tabname . '__' . $colname . '__' . dechex(rand())
|
||||
. ' DEFAULT ' . $default . ' FOR ' . $colname;
|
||||
} else {
|
||||
$colname = strtok($v," ");
|
||||
if ( $constraintname = $this->DefaultConstraintname($tabname,$colname) ) {
|
||||
$sql[] = 'ALTER TABLE '.$tabname.' DROP CONSTRAINT '. $constraintname;
|
||||
}
|
||||
if ($not_null) {
|
||||
$sql[] = $alter . $v . ' NOT NULL';
|
||||
} else {
|
||||
$sql[] = $alter . $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (is_array($idxs)) {
|
||||
foreach($idxs as $idx => $idxdef) {
|
||||
$sql_idxs = $this->CreateIndexSql($idx, $tabname, $idxdef['cols'], $idxdef['opts']);
|
||||
$sql = array_merge($sql, $sql_idxs);
|
||||
}
|
||||
}
|
||||
return $sql;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Drop a column, syntax is ALTER TABLE table DROP COLUMN column,column
|
||||
@@ -176,10 +226,12 @@ class ADODB2_mssqlnative extends ADODB_DataDict {
|
||||
if (!is_array($flds))
|
||||
$flds = explode(',',$flds);
|
||||
$f = array();
|
||||
$s = 'ALTER TABLE ' . $tabname . ' DROP COLUMN ';
|
||||
$s = 'ALTER TABLE ' . $tabname;
|
||||
foreach($flds as $v) {
|
||||
//$f[] = "\n$this->dropCol ".$this->NameQuote($v);
|
||||
$f[] = $this->NameQuote($v);
|
||||
if ( $constraintname = $this->DefaultConstraintname($tabname,$v) ) {
|
||||
$sql[] = 'ALTER TABLE ' . $tabname . ' DROP CONSTRAINT ' . $constraintname;
|
||||
}
|
||||
$f[] = ' DROP COLUMN ' . $this->NameQuote($v);
|
||||
}
|
||||
$s .= implode(', ',$f);
|
||||
$sql[] = $s;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
@@ -225,7 +225,7 @@ class ADODB_ado extends ADOConnection {
|
||||
|
||||
// Map by http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmthcreateparam.asp
|
||||
// Check issue http://bugs.php.net/bug.php?id=40664 !!!
|
||||
while(list(, $val) = each($inputarr)) {
|
||||
foreach ($inputarr as $val) {
|
||||
$type = gettype($val);
|
||||
$len=strlen($val);
|
||||
if ($type == 'boolean')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
@@ -248,7 +248,7 @@ class ADODB_ado extends ADOConnection {
|
||||
$oCmd->CommandText = $sql;
|
||||
$oCmd->CommandType = 1;
|
||||
|
||||
while(list(, $val) = each($inputarr)) {
|
||||
foreach ($inputarr as $val) {
|
||||
$type = gettype($val);
|
||||
$len=strlen($val);
|
||||
if ($type == 'boolean')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
@version v5.20.7 20-Sep-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
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-2016
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@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.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
@@ -125,6 +125,7 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
var $_bindInputArray = true;
|
||||
var $_dropSeqSQL = "drop table %s";
|
||||
var $connectionInfo = array();
|
||||
var $cachedSchemaFlush = false;
|
||||
var $sequences = false;
|
||||
var $mssql_version = '';
|
||||
|
||||
@@ -143,25 +144,22 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
sqlsrv_configure('WarningsReturnAsErrors', 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the SQL Server version.
|
||||
* Dies if connected to a non-supported version (2000 and older)
|
||||
*/
|
||||
function ServerVersion() {
|
||||
$data = $this->ServerInfo();
|
||||
if (preg_match('/^09/',$data['version'])){
|
||||
/*
|
||||
* SQL Server 2005
|
||||
*/
|
||||
$this->mssql_version = 9;
|
||||
} elseif (preg_match('/^10/',$data['version'])){
|
||||
/*
|
||||
* SQL Server 2008
|
||||
*/
|
||||
$this->mssql_version = 10;
|
||||
} elseif (preg_match('/^11/',$data['version'])){
|
||||
/*
|
||||
* SQL Server 2012
|
||||
*/
|
||||
$this->mssql_version = 11;
|
||||
} else
|
||||
preg_match('/^\d{2}/', $data['version'], $matches);
|
||||
$version = (int)reset($matches);
|
||||
|
||||
// We only support SQL Server 2005 and up
|
||||
if($version < 9) {
|
||||
die("SQL SERVER VERSION {$data['version']} NOT SUPPORTED IN mssqlnative DRIVER");
|
||||
}
|
||||
|
||||
$this->mssql_version = $version;
|
||||
}
|
||||
|
||||
function ServerInfo() {
|
||||
@@ -211,26 +209,26 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
switch($this->mssql_version){
|
||||
case 9:
|
||||
case 10:
|
||||
return $this->GenID2008();
|
||||
return $this->GenID2008($seq, $start);
|
||||
break;
|
||||
case 11:
|
||||
return $this->GenID2012();
|
||||
default:
|
||||
return $this->GenID2012($seq, $start);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function CreateSequence($seq='adodbseq',$start=1)
|
||||
{
|
||||
if (!$this->mssql_vesion)
|
||||
if (!$this->mssql_version)
|
||||
$this->ServerVersion();
|
||||
|
||||
switch($this->mssql_version){
|
||||
case 9:
|
||||
case 10:
|
||||
return $this->CreateSequence2008();
|
||||
return $this->CreateSequence2008($seq, $start);
|
||||
break;
|
||||
case 11:
|
||||
return $this->CreateSequence2012();
|
||||
default:
|
||||
return $this->CreateSequence2012($seq, $start);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -258,7 +256,7 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
/**
|
||||
* Proper Sequences Only available to Server 2012 and up
|
||||
*/
|
||||
function CreateSequence2012($seq='adodb',$start=1){
|
||||
function CreateSequence2012($seq='adodbseq',$start=1){
|
||||
if (!$this->sequences){
|
||||
$sql = "SELECT name FROM sys.sequences";
|
||||
$this->sequences = $this->GetCol($sql);
|
||||
@@ -289,7 +287,7 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
}
|
||||
$num = $this->GetOne("select id from $seq");
|
||||
sqlsrv_commit($this->_connectionID);
|
||||
return true;
|
||||
return $num;
|
||||
}
|
||||
/**
|
||||
* Only available to Server 2012 and up
|
||||
@@ -313,7 +311,7 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
}
|
||||
if (!is_array($this->sequences)
|
||||
|| is_array($this->sequences) && !in_array($seq,$this->sequences)){
|
||||
$this->CreateSequence2012($seq='adodbseq',$start=1);
|
||||
$this->CreateSequence2012($seq, $start);
|
||||
|
||||
}
|
||||
$num = $this->GetOne("SELECT NEXT VALUE FOR $seq");
|
||||
@@ -468,10 +466,9 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
|
||||
function ErrorNo()
|
||||
{
|
||||
if ($this->_logsql && $this->_errorCode !== false) return $this->_errorCode;
|
||||
$err = sqlsrv_errors(SQLSRV_ERR_ALL);
|
||||
if($err[0]) return $err[0]['code'];
|
||||
else return -1;
|
||||
else return 0;
|
||||
}
|
||||
|
||||
// returns true or false
|
||||
@@ -569,7 +566,7 @@ class ADODB_mssqlnative extends ADOConnection {
|
||||
|
||||
$insert = false;
|
||||
// handle native driver flaw for retrieving the last insert ID
|
||||
if(preg_match('/^\W*insert\s(?:(?:(?:\'\')*\'[^\']+\'(?:\'\')*)|[^;\'])*;?$/i', $sql)) {
|
||||
if(preg_match('/^\W*insert[\s\w()",.]+values\s*\((?:[^;\']|\'\'|(?:(?:\'\')*\'[^\']+\'(?:\'\')*))*;?$/i', $sql)) {
|
||||
$insert = true;
|
||||
$sql .= '; '.$this->identitySQL; // select scope_identity()
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
@version v5.20.7 20-Sep-2016
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@copyright (c) 2000-2013 John Lim. All rights reserved.
|
||||
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
|
||||
|
||||
@@ -703,9 +703,19 @@ END;
|
||||
* This implementation does not appear to work with oracle 8.0.5 or earlier.
|
||||
* Comment out this function then, and the slower SelectLimit() in the base
|
||||
* class will be used.
|
||||
*
|
||||
* Note: FIRST_ROWS hinting is only used if $sql is a string; when
|
||||
* processing a prepared statement's handle, no hinting is performed.
|
||||
*/
|
||||
function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
|
||||
{
|
||||
// Since the methods used to limit the number of returned rows rely
|
||||
// on modifying the provided SQL query, we can't work with prepared
|
||||
// statements so we just extract the SQL string.
|
||||
if(is_array($sql)) {
|
||||
$sql = $sql[0];
|
||||
}
|
||||
|
||||
// seems that oracle only supports 1 hint comment in 8i
|
||||
if ($this->firstrows) {
|
||||
if ($nrows > 500 && $nrows < 1000) {
|
||||
@@ -731,20 +741,13 @@ END;
|
||||
if ($offset > 0) {
|
||||
$nrows += $offset;
|
||||
}
|
||||
//$inputarr['adodb_rownum'] = $nrows;
|
||||
if ($this->databaseType == 'oci8po') {
|
||||
$sql = "select * from (".$sql.") where rownum <= ?";
|
||||
} else {
|
||||
$sql = "select * from (".$sql.") where rownum <= :adodb_offset";
|
||||
}
|
||||
$sql = "select * from (".$sql.") where rownum <= :adodb_offset";
|
||||
$inputarr['adodb_offset'] = $nrows;
|
||||
$nrows = -1;
|
||||
}
|
||||
// note that $nrows = 0 still has to work ==> no rows returned
|
||||
|
||||
$rs = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
|
||||
return $rs;
|
||||
|
||||
return ADOConnection::SelectLimit($sql, $nrows, $offset, $inputarr, $secs2cache);
|
||||
} else {
|
||||
// Algorithm by Tomas V V Cox, from PEAR DB oci8.php
|
||||
|
||||
@@ -758,13 +761,19 @@ END;
|
||||
|
||||
if (is_array($inputarr)) {
|
||||
foreach($inputarr as $k => $v) {
|
||||
$i=0;
|
||||
if ($this->databaseType == 'oci8po') {
|
||||
$bv_name = ":".$i++;
|
||||
} else {
|
||||
$bv_name = ":".$k;
|
||||
}
|
||||
if (is_array($v)) {
|
||||
// suggested by g.giunta@libero.
|
||||
if (sizeof($v) == 2) {
|
||||
oci_bind_by_name($stmt,":$k",$inputarr[$k][0],$v[1]);
|
||||
oci_bind_by_name($stmt,$bv_name,$inputarr[$k][0],$v[1]);
|
||||
}
|
||||
else {
|
||||
oci_bind_by_name($stmt,":$k",$inputarr[$k][0],$v[1],$v[2]);
|
||||
oci_bind_by_name($stmt,$bv_name,$inputarr[$k][0],$v[1],$v[2]);
|
||||
}
|
||||
} else {
|
||||
$len = -1;
|
||||
@@ -774,7 +783,7 @@ END;
|
||||
if (isset($bindarr)) { // is prepared sql, so no need to oci_bind_by_name again
|
||||
$bindarr[$k] = $v;
|
||||
} else { // dynamic sql, so rebind every time
|
||||
oci_bind_by_name($stmt,":$k",$inputarr[$k],$len);
|
||||
oci_bind_by_name($stmt,$bv_name,$inputarr[$k],$len);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -801,24 +810,19 @@ END;
|
||||
}
|
||||
$offset += 1; // in Oracle rownum starts at 1
|
||||
|
||||
if ($this->databaseType == 'oci8po') {
|
||||
$sql = "SELECT $hint $fields FROM".
|
||||
"(SELECT rownum as adodb_rownum, $fields FROM".
|
||||
" ($sql) WHERE rownum <= ?".
|
||||
") WHERE adodb_rownum >= ?";
|
||||
} else {
|
||||
$sql = "SELECT $hint $fields FROM".
|
||||
"(SELECT rownum as adodb_rownum, $fields FROM".
|
||||
" ($sql) WHERE rownum <= :adodb_nrows".
|
||||
") WHERE adodb_rownum >= :adodb_offset";
|
||||
}
|
||||
$inputarr['adodb_nrows'] = $nrows;
|
||||
$inputarr['adodb_offset'] = $offset;
|
||||
$sql = "SELECT $hint $fields FROM".
|
||||
"(SELECT rownum as adodb_rownum, $fields FROM".
|
||||
" ($sql) WHERE rownum <= :adodb_nrows".
|
||||
") WHERE adodb_rownum >= :adodb_offset";
|
||||
$inputarr['adodb_nrows'] = $nrows;
|
||||
$inputarr['adodb_offset'] = $offset;
|
||||
|
||||
if ($secs2cache > 0) {
|
||||
$rs = $this->CacheExecute($secs2cache, $sql,$inputarr);
|
||||
}
|
||||
else $rs = $this->Execute($sql,$inputarr);
|
||||
else {
|
||||
$rs = $this->Execute($sql, $inputarr);
|
||||
}
|
||||
return $rs;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-2016
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@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.
|
||||
@@ -56,6 +56,21 @@ class ADODB_oci8po extends ADODB_oci8 {
|
||||
return ADOConnection::Execute($sql,$inputarr);
|
||||
}
|
||||
|
||||
/**
|
||||
* The optimizations performed by ADODB_oci8::SelectLimit() are not
|
||||
* compatible with the oci8po driver, so we rely on the slower method
|
||||
* from the base class.
|
||||
* We can't properly handle prepared statements either due to preprocessing
|
||||
* of query parameters, so we treat them as regular SQL statements.
|
||||
*/
|
||||
function SelectLimit($sql, $nrows=-1, $offset=-1, $inputarr=false, $secs2cache=0)
|
||||
{
|
||||
if(is_array($sql)) {
|
||||
// $sql = $sql[0];
|
||||
}
|
||||
return ADOConnection::SelectLimit($sql, $nrows, $offset, $inputarr, $secs2cache);
|
||||
}
|
||||
|
||||
// emulate handling of parameters ? ?, replacing with :bind0 :bind1
|
||||
function _query($sql,$inputarr=false)
|
||||
{
|
||||
@@ -74,11 +89,14 @@ class ADODB_oci8po extends ADODB_oci8 {
|
||||
$sql = str_replace($qmMatch, $qmReplace, $sql);
|
||||
}
|
||||
|
||||
// Replace parameters if any were found
|
||||
$sqlarr = explode('?',$sql);
|
||||
$sql = $sqlarr[0];
|
||||
if(count($sqlarr) > 1) {
|
||||
$sql = $sqlarr[0];
|
||||
|
||||
foreach($inputarr as $k => $v) {
|
||||
$sql .= ":$k" . $sqlarr[++$i];
|
||||
foreach ($inputarr as $k => $v) {
|
||||
$sql .= ":$k" . $sqlarr[++$i];
|
||||
}
|
||||
}
|
||||
|
||||
$sql = str_replace('-QUESTIONMARK-', '?', $sql);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-2016
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@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.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.21.0-dev ??-???-2016
|
||||
@copyright (c) 2015 Damien Regad, Mark Newnham and the ADOdb community
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
Set tabs to 4.
|
||||
|
||||
Microsoft SQL Server 2012 via ODBC
|
||||
*/
|
||||
|
||||
if (!defined('ADODB_DIR'))
|
||||
die();
|
||||
|
||||
include_once(ADODB_DIR."/drivers/adodb-odbc_mssql.inc.php");
|
||||
|
||||
class ADODB_odbc_mssql2012 extends ADODB_odbc_mssql
|
||||
{
|
||||
/*
|
||||
* Makes behavior similar to prior versions of SQL Server
|
||||
*/
|
||||
var $connectStmt = 'SET CONCAT_NULL_YIELDS_NULL ON';
|
||||
}
|
||||
|
||||
class ADORecordSet_odbc_mssql2012 extends ADORecordSet_odbc_mssql
|
||||
{
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
@version v5.20.7 20-Sep-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
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-2016
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@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.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-2016
|
||||
@version v5.20.9 21-Dec-2016
|
||||
@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.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.1 06-Dec-2015
|
||||
@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
|
||||
Set tabs to 4.
|
||||
@@ -209,7 +209,7 @@ class ADODB_text extends ADOConnection {
|
||||
$where_arr = array();
|
||||
|
||||
reset($this->_origarray);
|
||||
while (list($k_arr,$arr) = each($this->_origarray)) {
|
||||
foreach ($this->_origarray as $arr) {
|
||||
|
||||
if ($i == 0 && $this->_skiprow1)
|
||||
$where_arr[] = $arr;
|
||||
@@ -247,7 +247,7 @@ class ADODB_text extends ADOConnection {
|
||||
$i = 0;
|
||||
$n = '';
|
||||
reset($this->_colnames);
|
||||
while (list($k_n,$n) = each($this->_colnames)) {
|
||||
foreach ($this->_colnames as $n) {
|
||||
|
||||
if ($col == strtoupper(trim($n))) break;
|
||||
$i += 1;
|
||||
@@ -302,7 +302,7 @@ class ADODB_text extends ADOConnection {
|
||||
if ($at == 0) {
|
||||
$i = 0;
|
||||
reset($projnames);
|
||||
while (list($k_n,$n) = each($projnames)) {
|
||||
foreach ($projnames as $n) {
|
||||
if (strtoupper(trim($n)) == $col) {
|
||||
$at = $i+1;
|
||||
break;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Description of ADODB V5.20.7 library import into Moodle
|
||||
Description of ADODB V5.20.9 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.
|
||||
@@ -19,6 +19,9 @@ Removed:
|
||||
* 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 ;-)
|
||||
@@ -26,6 +29,8 @@ Added:
|
||||
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.
|
||||
Check if fixed upstream during the next upgrade and remove this note. (8638b3f1441d4b928)
|
||||
* MDL-58546 replaced each() with foreach for PHP 7.2 compatibility.
|
||||
pull request upstream: https://github.com/ADOdb/ADOdb/pull/373
|
||||
|
||||
skodak, iarenaza, moodler, stronk7, abgreeve, lameze
|
||||
skodak, iarenaza, moodler, stronk7, abgreeve, lameze, ankitagarwal, marinaglancy
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version v5.20.7 20-Sep-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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @version v5.20.7 20-Sep-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.
|
||||
@@ -77,7 +77,7 @@ function _adodb_export(&$rs,$sep,$sepreplace,$fp=false,$addtitles=true,$quote =
|
||||
reset($fieldTypes);
|
||||
$i = 0;
|
||||
$elements = array();
|
||||
while(list(,$o) = each($fieldTypes)) {
|
||||
foreach ($fieldTypes as $o) {
|
||||
|
||||
$v = ($o) ? $o->name : 'Field'.($i++);
|
||||
if ($escquote) $v = str_replace($quote,$escquotequote,$v);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
@version v5.20.7 20-Sep-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.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user