Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDI-1425 Fix warning: Function each() is deprecated since PHP 7.2 #114

Merged
merged 1 commit into from
Nov 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) = explode(' ',$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;
}
?>
?>