Skip to content

Commit

Permalink
MDI-1425 Fix warning: Function each() is deprecated since PHP 7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniorova committed Nov 26, 2021
1 parent d627e6b commit 02add45
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/adodb5/adodb-datadict.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,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) = split("[\t ]+",$first,2);
}
return array(sprintf($this->renameColumn,$tabname,$this->NameQuote($oldcolumn),$this->NameQuote($newcolumn),$column_def));
Expand Down Expand Up @@ -1005,4 +1005,4 @@ function ChangeTableSQL($tablename, $flds, $tableoptions = false, $dropOldFlds=f
return $sql;
}
} // class
?>
?>
4 changes: 2 additions & 2 deletions src/adodb5/adodb-error.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function adodb_error_pg($errormsg)
=> DB_ERROR_ALREADY_EXISTS
);
reset($error_regexps);
while (list($regexp,$code) = each($error_regexps)) {
foreach ($error_regexps as $regexp => $code) {
if (preg_match($regexp, $errormsg)) {
return $code;
}
Expand Down Expand Up @@ -255,4 +255,4 @@ function adodb_error_mysql()

return $MAP;
}
?>
?>
4 changes: 2 additions & 2 deletions src/adodb5/drivers/adodb-ado.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ function _query($sql,$inputarr=false)

// 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')
Expand Down Expand Up @@ -657,4 +657,4 @@ function _close() {

}

?>
?>
4 changes: 2 additions & 2 deletions src/adodb5/drivers/adodb-ado5.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ function _query($sql,$inputarr=false)
$oCmd->CommandText = $sql;
$oCmd->CommandType = 1;

while(list(, $val) = each($inputarr)) {
foreach ($inputarr as $val) {
$type = gettype($val);
$len=strlen($val);
if ($type == 'boolean')
Expand Down Expand Up @@ -701,4 +701,4 @@ function _close() {

}

?>
?>
5 changes: 2 additions & 3 deletions src/adodb5/toexport.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ function _adodb_export(&$rs,$sep,$sepreplace,$fp=false,$addtitles=true,$quote =
$fieldTypes = $rs->FieldTypesArray();
reset($fieldTypes);
$i = 0;
while(list(,$o) = each($fieldTypes)) {

foreach ($fieldTypes as $o) {
$v = ($o) ? $o->name : 'Field'.($i++);
if ($escquote) $v = str_replace($quote,$escquotequote,$v);
$v = strip_tags(str_replace("\n", $replaceNewLine, str_replace("\r\n",$replaceNewLine,str_replace($sep,$sepreplace,$v))));
Expand Down Expand Up @@ -131,4 +130,4 @@ function _adodb_export(&$rs,$sep,$sepreplace,$fp=false,$addtitles=true,$quote =

return $s;
}
?>
?>

0 comments on commit 02add45

Please sign in to comment.