| @@ -674,7 +674,7 @@ discard block | ||
| 674 | 674 | ); | 
| 675 | 675 | } | 
| 676 | 676 |      row2("Submitted", time_str($batch->create_time)); | 
| 677 | -    row2("Application", $app?$app->name:'---'); | |
| 677 | +    row2("Application", $app ? $app->name : '---'); | |
| 678 | 678 |      row2("State", batch_state_string($batch->state)); | 
| 679 | 679 |      //row2("# jobs", $batch->njobs); | 
| 680 | 680 |      //row2("# error jobs", $batch->nerror_jobs); | 
| @@ -764,11 +764,11 @@ discard block | ||
| 764 | 764 | "GFLOPS-hours" | 
| 765 | 765 | ]; | 
| 766 | 766 | row_heading_array($x); | 
| 767 | -    foreach($wus as $wu) { | |
| 767 | +    foreach ($wus as $wu) { | |
| 768 | 768 | if ($status && $wu->status != $status) continue; | 
| 769 | 769 | $y = ''; | 
| 770 | 770 | $c = '---'; | 
| 771 | -        switch($wu->status) { | |
| 771 | +        switch ($wu->status) { | |
| 772 | 772 | case WU_SUCCESS: | 
| 773 | 773 | $resultid = $wu->canonical_resultid; | 
| 774 | 774 |              $y = sprintf('<font color="%s">completed</font>', COLOR_SUCCESS); | 
| @@ -859,7 +859,7 @@ discard block | ||
| 859 | 859 |              if ($result->id == $wu->canonical_resultid) { | 
| 860 | 860 | $log_names = get_outfile_log_names($result); | 
| 861 | 861 | $nfiles = count($log_names); | 
| 862 | -                for ($i=0; $i<$nfiles; $i++) { | |
| 862 | +                for ($i = 0; $i < $nfiles; $i++) { | |
| 863 | 863 | $name = $log_names[$i]; | 
| 864 | 864 | // don't show 'view' link if it's a .zip | 
| 865 | 865 | $y = "$name: "; | 
| @@ -883,7 +883,7 @@ discard block | ||
| 883 | 883 | $phys_names = get_outfile_phys_names($result); | 
| 884 | 884 | $log_names = get_outfile_log_names($result); | 
| 885 | 885 | $nfiles = count($log_names); | 
| 886 | -                for ($i=0; $i<$nfiles; $i++) { | |
| 886 | +                for ($i = 0; $i < $nfiles; $i++) { | |
| 887 | 887 | $path = dir_hier_path( | 
| 888 | 888 | $phys_names[$i], $upload_dir, $fanout | 
| 889 | 889 | ); | 
| @@ -661,7 +661,7 @@ discard block | ||
| 661 | 661 | |
| 662 | 662 | $is_assim_move = is_assim_move($app); | 
| 663 | 663 | |
| 664 | -    page_head("Batch $batch_id"); | |
| 664 | +    page_head("batch $batch_id"); | |
| 665 | 665 | text_start(800); | 
| 666 | 666 | start_table(); | 
| 667 | 667 |      row2("Batch name", $batch->name); | 
| @@ -963,7 +963,7 @@ discard block | ||
| 963 | 963 | |
| 964 | 964 |      if (get_int('confirmed', true)) { | 
| 965 | 965 | abort_batch($batch); | 
| 966 | -        page_head("Batch $batch_id aborted"); | |
| 966 | +        page_head("batch $batch_id aborted"); | |
| 967 | 967 | return_link(); | 
| 968 | 968 | page_tail(); | 
| 969 | 969 |      } else { | 
| @@ -993,7 +993,7 @@ discard block | ||
| 993 | 993 | |
| 994 | 994 |      if (get_int('confirmed', true)) { | 
| 995 | 995 | retire_batch($batch); | 
| 996 | -        page_head("Batch $batch_id retired"); | |
| 996 | +        page_head("batch $batch_id retired"); | |
| 997 | 997 | return_link(); | 
| 998 | 998 | page_tail(); | 
| 999 | 999 |      } else { | 
| @@ -216,7 +216,7 @@ discard block | ||
| 216 | 216 |  function get_file($user) { | 
| 217 | 217 | $dir = sandbox_dir($user); | 
| 218 | 218 |      $url = post_str('url'); | 
| 219 | -    if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) { | |
| 219 | +    if (filter_var($url, FILTER_VALIDATE_URL) === false) { | |
| 220 | 220 |          error_page('Not a valid URL'); | 
| 221 | 221 | } | 
| 222 | 222 | $fname = basename($url); | 
| @@ -225,7 +225,7 @@ discard block | ||
| 225 | 225 | } | 
| 226 | 226 | $path = "$dir/$fname"; | 
| 227 | 227 |      if (file_exists($path)) { | 
| 228 | -        error_page("File $fname exists; delete it first."); | |
| 228 | +        error_page("file $fname exists; delete it first."); | |
| 229 | 229 | } | 
| 230 | 230 | copy($url, $path); | 
| 231 | 231 | $notice = "Fetched file from <strong>$url</strong><br/>"; | 
| @@ -56,10 +56,10 @@ discard block | ||
| 56 | 56 |      return file_exists("$d/stop_sched"); | 
| 57 | 57 | } | 
| 58 | 58 | |
| 59 | -function xml_error($num=-1, $msg=null, $file=null, $line=null) { | |
| 59 | +function xml_error($num = -1, $msg = null, $file = null, $line = null) { | |
| 60 | 60 | global $xml_outer_tag; | 
| 61 | 61 |      if (!$msg) { | 
| 62 | -        switch($num) { | |
| 62 | +        switch ($num) { | |
| 63 | 63 | case -112: $msg = "Invalid XML"; break; | 
| 64 | 64 | case -136: $msg = "Not found"; break; | 
| 65 | 65 | case -137: $msg = "Name or email address is not unique"; break; | 
| @@ -104,7 +104,7 @@ discard block | ||
| 104 | 104 | // If it's a single-tag element, and it's present, just return the tag | 
| 105 | 105 | // | 
| 106 | 106 |  function parse_element($xml, $tag) { | 
| 107 | - $closetag = "</" . substr($tag,1); | |
| 107 | + $closetag = "</".substr($tag, 1); | |
| 108 | 108 | $x = strstr($xml, $tag); | 
| 109 | 109 |      if ($x) { | 
| 110 | 110 | if (strstr($tag, "/>")) return $tag; | 
| @@ -120,8 +120,8 @@ discard block | ||
| 120 | 120 | |
| 121 | 121 |  function parse_next_element($xml, $tag, &$cursor) { | 
| 122 | 122 | $element = null; | 
| 123 | - $closetag = "</" . substr($tag,1); | |
| 124 | - $pos = substr($xml,$cursor); | |
| 123 | + $closetag = "</".substr($tag, 1); | |
| 124 | + $pos = substr($xml, $cursor); | |
| 125 | 125 | $x = strstr($pos, $tag); | 
| 126 | 126 |      if ($x) { | 
| 127 | 127 | if (strstr($tag, "/>")) return $tag; | 
| @@ -222,7 +222,7 @@ discard block | ||
| 222 | 222 | // ALSO: allow spaces. | 
| 223 | 223 | // | 
| 224 | 224 |  function is_valid_filename($x) { | 
| 225 | - if (strlen($x)>255) return false; | |
| 225 | + if (strlen($x) > 255) return false; | |
| 226 | 226 | // \w means A-Za-z0-9_ | 
| 227 | 227 |      return preg_match('/^[\w\-. ]+$/', $x); | 
| 228 | 228 | } |