@@ -17,7 +17,7 @@ |
||
| 17 | 17 | // along with BOINC. If not, see <http://www.gnu.org/licenses/>. |
| 18 | 18 | |
| 19 | 19 | // show statistics by client "brand" |
| 20 | - DEPRECATED |
|
| 20 | + DEPRECATED |
|
| 21 | 21 | |
| 22 | 22 | require_once("../inc/util.inc"); |
| 23 | 23 | |
@@ -32,12 +32,12 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | function sched_log_name($x) { |
| 34 | 34 | if ($x == 0) return "NO_SUCH_LOG"; |
| 35 | - return gmdate('Y-m-d_H/Y-m-d_H:i', $x) . ".txt"; |
|
| 35 | + return gmdate('Y-m-d_H/Y-m-d_H:i', $x).".txt"; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | function sched_log_link($x) { |
| 39 | 39 | if (file_exists("sched_logs")) { |
| 40 | - return "<a href=\"../sched_logs/" . sched_log_name($x) . "\">" . time_str($x) . "</a>"; |
|
| 40 | + return "<a href=\"../sched_logs/".sched_log_name($x)."\">".time_str($x)."</a>"; |
|
| 41 | 41 | } else { |
| 42 | 42 | return time_str($x); |
| 43 | 43 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | function location_form($host) { |
| 47 | 47 | $none = "selected"; |
| 48 | - $h=$w=$s=$m=""; |
|
| 48 | + $h = $w = $s = $m = ""; |
|
| 49 | 49 | if ($host->venue == "home") $h = "selected"; |
| 50 | 50 | if ($host->venue == "work") $w = "selected"; |
| 51 | 51 | if ($host->venue == "school") $s = "selected"; |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | row2(tra("Product name"), $host->product_name); |
| 100 | 100 | } |
| 101 | 101 | $x = $host->timezone/3600; |
| 102 | - if ($x >= 0) $x="+$x"; |
|
| 102 | + if ($x >= 0) $x = "+$x"; |
|
| 103 | 103 | row2(tra("Local Standard Time"), tra("UTC %1 hours", $x)); |
| 104 | 104 | } else { |
| 105 | 105 | $owner = BoincUser::lookup_id($host->userid); |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | } |
| 186 | 186 | if (defined('BATCH_ACCEL') && BATCH_ACCEL) { |
| 187 | 187 | row2('Low turnaround time?', |
| 188 | - $host->error_rate?'yes':'no' |
|
| 188 | + $host->error_rate ? 'yes' : 'no' |
|
| 189 | 189 | ); |
| 190 | 190 | } |
| 191 | 191 | } |
@@ -261,8 +261,8 @@ discard block |
||
| 261 | 261 | return sprintf( |
| 262 | 262 | 'Virtualbox %s<br>HW acceleration: %s<br>Enabled: %s', |
| 263 | 263 | $v->version, |
| 264 | - $v->hw_accel?'yes':'no', |
|
| 265 | - $v->hw_accel_enabled?'yes':'no' |
|
| 264 | + $v->hw_accel ? 'yes' : 'no', |
|
| 265 | + $v->hw_accel_enabled ? 'yes' : 'no' |
|
| 266 | 266 | ); |
| 267 | 267 | } |
| 268 | 268 | |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | if (empty($misc->docker)) return '---'; |
| 271 | 271 | $d = $misc->docker; |
| 272 | 272 | $x = sprintf('%s version %s', |
| 273 | - $d->type==1?"Docker":"Podman", |
|
| 273 | + $d->type == 1 ? "Docker" : "Podman", |
|
| 274 | 274 | $d->version |
| 275 | 275 | ); |
| 276 | 276 | if (!empty($d->wsl_distro)) { |
@@ -471,14 +471,14 @@ discard block |
||
| 471 | 471 | if ($pos1 === false) return $x; |
| 472 | 472 | $pos2 = strpos($model, ']'); |
| 473 | 473 | if ($pos2 === false) return $x; |
| 474 | - $a = substr($model, $pos1+1, $pos2-$pos1-1); |
|
| 474 | + $a = substr($model, $pos1 + 1, $pos2 - $pos1 - 1); |
|
| 475 | 475 | $y = explode(" ", $a); |
| 476 | 476 | if (count($y) == 0) return $x; |
| 477 | 477 | if ($y[0] == "Family") { |
| 478 | 478 | $x->info = $a; |
| 479 | 479 | } else { |
| 480 | 480 | $x->arch = $y[0]; |
| 481 | - $x->info = substr($a, strlen($y[0])+1); |
|
| 481 | + $x->info = substr($a, strlen($y[0]) + 1); |
|
| 482 | 482 | } |
| 483 | 483 | return $x; |
| 484 | 484 | } |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | $avg_time = 0; |
| 568 | 568 | |
| 569 | 569 | $results = BoincResult::enum("hostid=$hostid order by received_time"); |
| 570 | - foreach($results as $result) { |
|
| 570 | + foreach ($results as $result) { |
|
| 571 | 571 | if ($result->granted_credit <= 0) continue; |
| 572 | 572 | $total += $result->granted_credit; |
| 573 | 573 | |
@@ -660,7 +660,7 @@ discard block |
||
| 660 | 660 | |
| 661 | 661 | function link_url($sort, $rev, $show_all) { |
| 662 | 662 | global $userid; |
| 663 | - $x = $userid ? "&userid=$userid":""; |
|
| 663 | + $x = $userid ? "&userid=$userid" : ""; |
|
| 664 | 664 | return "hosts_user.php?sort=$sort&rev=$rev&show_all=$show_all$x"; |
| 665 | 665 | } |
| 666 | 666 | |
@@ -734,7 +734,7 @@ discard block |
||
| 734 | 734 | } |
| 735 | 735 | |
| 736 | 736 | function show_user_hosts($userid, $private, $show_all, $sort, $rev) { |
| 737 | - $desc = false; // whether the sort order's default is decreasing |
|
| 737 | + $desc = false; // whether the sort order's default is decreasing |
|
| 738 | 738 | switch ($sort) { |
| 739 | 739 | case "total_credit": $sort_clause = "total_credit"; $desc = true; break; |
| 740 | 740 | case "expavg_credit": $sort_clause = "expavg_credit"; $desc = true; break; |
@@ -756,7 +756,7 @@ discard block |
||
| 756 | 756 | more_or_less($sort, $rev, $show_all); |
| 757 | 757 | |
| 758 | 758 | $now = time(); |
| 759 | - $old_hosts=0; |
|
| 759 | + $old_hosts = 0; |
|
| 760 | 760 | $i = 1; |
| 761 | 761 | $hosts = BoincHost::enum("userid=$userid order by $sort_clause limit 100"); |
| 762 | 762 | $any_product_name = false; |
@@ -768,9 +768,9 @@ discard block |
||
| 768 | 768 | } |
| 769 | 769 | user_host_table_start($private, $sort, $rev, $show_all, $any_product_name); |
| 770 | 770 | foreach ($hosts as $host) { |
| 771 | - $is_old=false; |
|
| 771 | + $is_old = false; |
|
| 772 | 772 | if (($now - $host->rpc_time) > 30*86400) { |
| 773 | - $is_old=true; |
|
| 773 | + $is_old = true; |
|
| 774 | 774 | $old_hosts++; |
| 775 | 775 | } |
| 776 | 776 | if (!$show_all && $is_old) continue; |
@@ -779,7 +779,7 @@ discard block |
||
| 779 | 779 | } |
| 780 | 780 | end_table(); |
| 781 | 781 | |
| 782 | - if ($old_hosts>0) { |
|
| 782 | + if ($old_hosts > 0) { |
|
| 783 | 783 | more_or_less($sort, $rev, $show_all); |
| 784 | 784 | } |
| 785 | 785 | |
@@ -45,8 +45,8 @@ |
||
| 45 | 45 | $v = new StdClass; |
| 46 | 46 | $v->version = $x[1]; |
| 47 | 47 | if (count($x) >= 4) { |
| 48 | - $v->hw_accel = $x[2]?true:false; |
|
| 49 | - $v->hw_accel_enabled = $x[3]?true:false; |
|
| 48 | + $v->hw_accel = $x[2] ?true:false; |
|
| 49 | + $v->hw_accel_enabled = $x[3] ?true:false; |
|
| 50 | 50 | } |
| 51 | 51 | return $v; |
| 52 | 52 | } |