Completed
Push — master ( 29ef4a...0c6f8c )
by David
56s queued 21s
created
html/user/submit.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             if ($limit) {
90 90
                 show_all_link($batches, BATCH_STATE_IN_PROGRESS, $limit, $user, $app);
91 91
             }
92
-            form_start('');     // for alignment
92
+            form_start(''); // for alignment
93 93
             start_table('table-striped');
94 94
             table_header(
95 95
                 "Name",
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
     if ($owner) {
483 483
         row2('submitter', $owner->name);
484 484
     }
485
-    row2("application", $app?$app->name:'---');
485
+    row2("application", $app ? $app->name : '---');
486 486
     row2("state", batch_state_string($batch->state));
487 487
     //row2("# jobs", $batch->njobs);
488 488
     //row2("# error jobs", $batch->nerror_jobs);
@@ -541,9 +541,9 @@  discard block
 block discarded – undo
541 541
         "status"
542 542
     ];
543 543
     row_heading_array($x);
544
-    foreach($wus as $wu) {
544
+    foreach ($wus as $wu) {
545 545
         $y = '';
546
-        switch($wu->status) {
546
+        switch ($wu->status) {
547 547
         case WU_SUCCESS:
548 548
             $resultid = $wu->canonical_resultid;
549 549
             $y = '<font color="green">completed</font>';
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
     $results = BoincResult::enum("workunitid=$wuid");
617 617
     $upload_dir = parse_config(get_config(), "<upload_dir>");
618 618
     $fanout = parse_config(get_config(), "<uldl_dir_fanout>");
619
-    foreach($results as $result) {
619
+    foreach ($results as $result) {
620 620
         $x = [
621 621
             "<a href=result.php?resultid=$result->id>$result->id</a>",
622 622
             state_string($result)
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
         if ($result->server_state == RESULT_SERVER_STATE_OVER) {
626 626
             $phys_names = get_outfile_phys_names($result);
627 627
             $log_names = get_outfile_log_names($result);
628
-            for ($i=0; $i<count($phys_names); $i++) {
628
+            for ($i = 0; $i < count($phys_names); $i++) {
629 629
                 if ($is_assim_move) {
630 630
                     // file is in
631 631
                     // project/results/<batchid>/<wu_name>__file_<log_name>
Please login to merge, or discard this patch.
html/project.sample/project.inc 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,14 +45,14 @@  discard block
 block discarded – undo
45 45
 //define("STYLESHEET", "aaa.css");
46 46
 //define("STYLESHEET2", "bbb.css");
47 47
 //define("SHORTCUT_ICON", "f.gif");     // browser tab icon
48
-define('DARK_MODE', true);      // enable dark mode if selected by user
48
+define('DARK_MODE', true); // enable dark mode if selected by user
49 49
 
50 50
 //-------------- enable/disable web features
51 51
 
52 52
 define('UNIQUE_USER_NAME', true);
53 53
 define("FORUM_QA_MERGED_MODE", true);
54 54
     // Set to true to merge Message boards and Q&A section
55
-define ("DISABLE_PROFILES", true);
55
+define("DISABLE_PROFILES", true);
56 56
     // enable profiles only after enabling reCAPTCHA
57 57
     // https://github.com/BOINC/boinc/wiki/ProtectionFromSpam
58 58
 define("USE_STOPFORUMSPAM", true);
@@ -193,15 +193,15 @@  discard block
 block discarded – undo
193 193
     </ol>", PROJECT);
194 194
 }
195 195
 
196
-function project_workunit($wu){
196
+function project_workunit($wu) {
197 197
     // shown in the workunit page
198 198
 }
199 199
 
200
-function project_user_summary($user){
200
+function project_user_summary($user) {
201 201
     // shown in the user summary page
202 202
 }
203 203
 
204
-function project_user_page_private($user){
204
+function project_user_page_private($user) {
205 205
     // shown in the private account page
206 206
 }
207 207
 
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
     array("name" => "Uppercase", "short_name" => "UC", "appids" => array(1, 25)),
285 285
 );
286 286
 
287
-function project_user_credit($user){
287
+function project_user_credit($user) {
288 288
     global $sub_projects;
289 289
     foreach ($sub_projects as $sp) {
290 290
         show_app_credit_user($user, $sp["name"], $sp["appids"]);
Please login to merge, or discard this patch.
html/inc/result.inc 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
     return $platforms[$id];
54 54
 }
55 55
 
56
-function anon_platform_string($result, $rsc_name=null) {
56
+function anon_platform_string($result, $rsc_name = null) {
57 57
     $app = get_app($result->appid);
58
-    $n = $app->user_friendly_name."<br>".  tra("Anonymous platform");
58
+    $n = $app->user_friendly_name."<br>".tra("Anonymous platform");
59 59
     if ($rsc_name) {
60 60
         $n .= " ($rsc_name)";
61 61
     }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         return $string_to_show;
103 103
     }
104 104
     if ($result->server_state <> RESULT_SERVER_STATE_OVER) return "---";
105
-    switch($result->outcome) {
105
+    switch ($result->outcome) {
106 106
     case RESULT_OUTCOME_SUCCESS:
107 107
         switch ($result->validate_state) {
108 108
         case VALIDATE_STATE_INIT:
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
             ) {
241 241
                 return tra("Not started by deadline - canceled");
242 242
             }
243
-            switch($result->client_state) {
243
+            switch ($result->client_state) {
244 244
             case RESULT_FILES_DOWNLOADING: return tra("Error while downloading");
245 245
             case RESULT_FILES_DOWNLOADED:
246 246
             case RESULT_COMPUTE_ERROR: return tra("Error while computing");
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 }
260 260
 
261 261
 function result_server_state_string($result) {
262
-    switch($result->server_state) {
262
+    switch ($result->server_state) {
263 263
     case RESULT_SERVER_STATE_INACTIVE: return tra("Inactive");
264 264
     case RESULT_SERVER_STATE_UNSENT: return tra("Unsent");
265 265
     case RESULT_SERVER_STATE_IN_PROGRESS: return tra("In progress");
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 }
270 270
 
271 271
 function result_outcome_string($result) {
272
-    switch($result->outcome) {
272
+    switch ($result->outcome) {
273 273
     case RESULT_OUTCOME_INIT: return "---";
274 274
     case RESULT_OUTCOME_SUCCESS: return tra("Success");
275 275
     case RESULT_OUTCOME_COULDNT_SEND: return tra("Couldn't send");
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 }
288 288
 
289 289
 function result_client_state_string($result) {
290
-    switch($result->client_state) {
290
+    switch ($result->client_state) {
291 291
     case RESULT_NEW: return tra("New");
292 292
     case RESULT_FILES_DOWNLOADING: return tra("Downloading");
293 293
     case RESULT_FILES_DOWNLOADED: return tra("Processing");
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 }
306 306
 
307 307
 function validate_state_str($result) {
308
-    switch($result->validate_state) {
308
+    switch ($result->validate_state) {
309 309
     case VALIDATE_STATE_INIT: return tra("Initial");
310 310
     case VALIDATE_STATE_VALID: return tra("Valid");
311 311
     case VALIDATE_STATE_INVALID:
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 }
322 322
 
323 323
 function assimilate_state_str($s) {
324
-    switch($s) {
324
+    switch ($s) {
325 325
     case ASSIMILATE_INIT: return "Initial";
326 326
     case ASSIMILATE_READY: return "Ready to assimilate";
327 327
     case ASSIMILATE_DONE: return "Assimilated";
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 }
331 331
 
332 332
 function file_delete_state_str($s) {
333
-    switch($s) {
333
+    switch ($s) {
334 334
     case FILE_DELETE_INIT: return "Initial";
335 335
     case FILE_DELETE_READY: return "Ready to delete";
336 336
     case FILE_DELETE_DONE: return "Deleted";
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 // convert WU error bitmask to str.
343 343
 // If $color, add HTML red color
344 344
 //
345
-function wu_error_mask_str($s, $color=false) {
345
+function wu_error_mask_str($s, $color = false) {
346 346
     $x = "";
347 347
     if ($s & WU_ERROR_COULDNT_SEND_RESULT) {
348 348
         $x = $x." ".tra("Couldn't send result");
@@ -456,10 +456,10 @@  discard block
 block discarded – undo
456 456
     if ($result->received_time) {
457 457
         $r = time_str($result->received_time);
458 458
     } else if ($result->report_deadline) {
459
-        if ($result->report_deadline>time()) {
460
-            $r = "<font color='#33cc33'>" . time_str($result->report_deadline) . "</font>";
459
+        if ($result->report_deadline > time()) {
460
+            $r = "<font color='#33cc33'>".time_str($result->report_deadline)."</font>";
461 461
         } else {
462
-            $r = "<font color='#ff3333'>" . time_str($result->report_deadline) . "</font>";
462
+            $r = "<font color='#ff3333'>".time_str($result->report_deadline)."</font>";
463 463
         }
464 464
     } else {
465 465
         $r = "---";
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
 // @param Integer $dec A signed integer
521 521
 //
522 522
 function int2hex($dec) {
523
-    return "0x".strtoupper(substr(sprintf("%08x",$dec), -8));
523
+    return "0x".strtoupper(substr(sprintf("%08x", $dec), -8));
524 524
 }
525 525
 
526 526
 // Decode a windows error number into semi-human-readable,
@@ -530,9 +530,9 @@  discard block
 block discarded – undo
530 530
 // @return String A human readable error message
531 531
 // @param Integer $x An error number
532 532
 //
533
-function windows_error_code_str($x){
534
-    $h=int2hex($x);
535
-    switch($h){
533
+function windows_error_code_str($x) {
534
+    $h = int2hex($x);
535
+    switch ($h) {
536 536
     case "0xC0000005": return "STATUS_ACCESS_VIOLATION";
537 537
     case "0xC000001D": return "STATUS_ILLEGAL_INSTRUCTION";
538 538
     case "0xC0000094": return "STATUS_INTEGER_DIVIDE_BY_ZERO";
@@ -553,10 +553,10 @@  discard block
 block discarded – undo
553 553
 // @return String A human readable error message
554 554
 // @param Integer $x An error number
555 555
 //
556
-function error_code_str($x){
556
+function error_code_str($x) {
557 557
     // severe Windows error numbers are always large negative integers
558
-    if ($x<-400) return windows_error_code_str($x);
559
-    switch($x){
558
+    if ($x < -400) return windows_error_code_str($x);
559
+    switch ($x) {
560 560
     case 0: return "";
561 561
     case 192: return "EXIT_STATEFILE_WRITE";
562 562
     case 193: return "EXIT_SIGNAL";
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
     return $x." (".int2hex($x).") ".error_code_str($x);
718 718
 }
719 719
 
720
-function show_result($result, $show_outfile_links=false) {
720
+function show_result($result, $show_outfile_links = false) {
721 721
     start_table();
722 722
     row2(tra("Name"), $result->name);
723 723
     row2(tra("Workunit"), "<a href=\"workunit.php?wuid=$result->workunitid\">$result->workunitid</a>");
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
         echo "<h3>".tra("Stderr output")."</h3> <pre>"
770 770
             .htmlspecialchars(
771 771
                 $result->stderr_out,
772
-                ENT_QUOTES | (defined('ENT_SUBSTITUTE')?ENT_SUBSTITUTE:0),
772
+                ENT_QUOTES|(defined('ENT_SUBSTITUTE') ?ENT_SUBSTITUTE:0),
773 773
                 'utf-8'
774 774
             )
775 775
             ."</pre>"
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
 
786 786
     $apps = BoincApp::enum('deprecated=0 ORDER BY user_friendly_name');
787 787
 
788
-    for ($i=0; $i<NSTATES; $i++) {
788
+    for ($i = 0; $i < NSTATES; $i++) {
789 789
         $state_count[$i] = 0;
790 790
     }
791 791
     foreach ($apps as $app) {
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
         $x .= "<a href=$url>".tra("Next")." ".$info->results_per_page."</a>";
829 829
     }
830 830
     $x .= "<br>".tra("State").": ";
831
-    for ($i=0; $i<NSTATES; $i++) {
831
+    for ($i = 0; $i < NSTATES; $i++) {
832 832
         if ($i) $x .= " &middot; ";
833 833
         if ($info->state == $i) {
834 834
             $x .= $state_name[$i];
Please login to merge, or discard this patch.