summaryrefslogtreecommitdiffstats
path: root/modules-available/dnbd3/inc/dnbd3util.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/dnbd3/inc/dnbd3util.inc.php')
-rw-r--r--modules-available/dnbd3/inc/dnbd3util.inc.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules-available/dnbd3/inc/dnbd3util.inc.php b/modules-available/dnbd3/inc/dnbd3util.inc.php
index 8e355370..d9bfaeee 100644
--- a/modules-available/dnbd3/inc/dnbd3util.inc.php
+++ b/modules-available/dnbd3/inc/dnbd3util.inc.php
@@ -12,7 +12,7 @@ class Dnbd3Util {
$res = Database::simpleQuery('SELECT s.serverid, s.machineuuid, s.fixedip, s.lastup, s.lastdown, m.clientip
FROM dnbd3_server s
LEFT JOIN machine m USING (machineuuid)');
- while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
+ foreach ($res as $row) {
if (!empty($row['machineuuid'])) {
$allUuids[$row['machineuuid']] = true;
}
@@ -121,7 +121,7 @@ class Dnbd3Util {
WHERE machineuuid = :uuid',
array('uuid' => $machineUuid));
$assignedLocs = array();
- while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
+ foreach ($res as $row) {
$assignedLocs[] = $row['locationid'];
}
$modeData = (array)json_decode($modeData, true) + self::defaultRunmodeConfig();
@@ -142,7 +142,7 @@ class Dnbd3Util {
$floatIp = (float)sprintf('%u', $floatIp); // Float for 32bit php :/
}
$ranges = [['startaddr' => $floatIp, 'endaddr' => $floatIp]];
- while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
+ foreach ($res as $row) {
settype($row['startaddr'], PHP_INT_SIZE === 4 ? 'float' : 'int');
settype($row['endaddr'], PHP_INT_SIZE === 4 ? 'float' : 'int');
self::mergeRanges($ranges, $row);
@@ -164,7 +164,7 @@ class Dnbd3Util {
$public = array();
$private = array();
$public[$self] = $self;
- while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
+ foreach ($res as $row) {
$ip = $row['fixedip'] ? $row['fixedip'] : $row['clientip'];
if ($ip === '<self>') {
continue;