@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | // |
86 | 86 | function unzip_batch_file($user, $batch_file) { |
87 | 87 | @mkdir("../../buda_batches"); |
88 | - for ($i=0; $i<1000; $i++) { |
|
88 | + for ($i = 0; $i < 1000; $i++) { |
|
89 | 89 | $batch_dir = "../../buda_batches/$i"; |
90 | 90 | $batch_dir_name = $i; |
91 | 91 | $ret = @mkdir($batch_dir); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | } |
137 | 137 | $job_files = []; |
138 | 138 | $cmdline = ''; |
139 | - foreach(scandir("$batch_dir/$fname") as $f2) { |
|
139 | + foreach (scandir("$batch_dir/$fname") as $f2) { |
|
140 | 140 | if ($f2[0] == '.') continue; |
141 | 141 | if ($f2 == 'cmdline') { |
142 | 142 | $cmdline = trim(file_get_contents("$batch_dir/$fname/cmdline")); |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | function stage_input_files($batch_dir, $batch_desc, $batch_id) { |
191 | 191 | $n = count($batch_desc->shared_files); |
192 | 192 | $batch_desc->shared_files_phys_names = []; |
193 | - for ($i=0; $i<$n; $i++) { |
|
193 | + for ($i = 0; $i < $n; $i++) { |
|
194 | 194 | $path = sprintf('%s/%s', $batch_dir, $batch_desc->shared_files[$i]); |
195 | 195 | [$md5, $size] = $batch_desc->shared_file_infos[$i]; |
196 | 196 | $phys_name = sprintf('batch_%d_%s', $batch_id, $md5); |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | foreach ($batch_desc->jobs as $job) { |
201 | 201 | $n = count($batch_desc->unshared_files); |
202 | 202 | $job->phys_names = []; |
203 | - for ($i=0; $i<$n; $i++) { |
|
203 | + for ($i = 0; $i < $n; $i++) { |
|
204 | 204 | $path = sprintf('%s/%s/%s', |
205 | 205 | $batch_dir, $job->dir, $batch_desc->unshared_files[$i] |
206 | 206 | ); |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | } |
250 | 250 | $wrapper_cmdline = sprintf('"--dockerfile %s %s %s"', |
251 | 251 | $variant_desc->dockerfile, |
252 | - $wrapper_verbose?'--verbose':'', |
|
252 | + $wrapper_verbose ? '--verbose' : '', |
|
253 | 253 | $cmdline |
254 | 254 | ); |
255 | 255 | $cmd = sprintf( |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | $max_runtime_days = (double)$max_runtime_days; |
299 | 299 | if ($max_runtime_days <= 0) error_page('bad runtime limit'); |
300 | 300 | if ($max_runtime_days > 100) error_page('bad runtime limit'); |
301 | - $max_fpops = $max_runtime_days * 4.3e9 * 86400; |
|
301 | + $max_fpops = $max_runtime_days*4.3e9*86400; |
|
302 | 302 | |
303 | 303 | $exp_runtime_days = get_str('exp_runtime_days'); |
304 | 304 | if (!is_numeric($exp_runtime_days)) error_page('bad expected runtime'); |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | if ($exp_runtime_days > $max_runtime_days) { |
309 | 309 | error_page('exp must be < max runtime'); |
310 | 310 | } |
311 | - $exp_fpops = $exp_runtime_days * 4.3e9 * 86400; |
|
311 | + $exp_fpops = $exp_runtime_days*4.3e9*86400; |
|
312 | 312 | |
313 | 313 | $app_desc = get_buda_desc($app); |
314 | 314 | |
@@ -361,9 +361,9 @@ discard block |
||
361 | 361 | |
362 | 362 | // clean up batch dir |
363 | 363 | // |
364 | - //system("rm -rf $batch_dir"); |
|
364 | + //system("rm - rf $batch_dir"); |
|
365 | 365 | |
366 | - header("Location: submit.php?action=query_batch&batch_id=$batch->id"); |
|
366 | + header("Location: submit.php ?action=query_batch&batch_id = $batch->id"); |
|
367 | 367 | } |
368 | 368 | |
369 | 369 | function show_list() { |
@@ -374,20 +374,20 @@ discard block |
||
374 | 374 | $desc = get_buda_desc($app); |
375 | 375 | $vars = get_buda_variants($app); |
376 | 376 | echo "$desc->long_name |
377 | - <ul> |
|
377 | + <ul > |
|
378 | 378 | "; |
379 | 379 | foreach ($vars as $var) { |
380 | 380 | echo sprintf('<li><a href=buda_submit.php?action=form&app=%s&variant=%s>%s</a>', |
381 | 381 | $app, $var, $var |
382 | 382 | ); |
383 | 383 | } |
384 | - echo "</ul>\n"; |
|
384 | + echo " < /ul > \n"; |
|
385 | 385 | } |
386 | 386 | page_tail(); |
387 | 387 | } |
388 | 388 | |
389 | 389 | $user = get_logged_in_user(); |
390 | -$buda_boinc_app = BoincApp::lookup("name='buda'"); |
|
390 | +$buda_boinc_app = BoincApp::lookup("name = 'buda'"); |
|
391 | 391 | if (!$buda_boinc_app) error_page('no buda app'); |
392 | 392 | if (!has_submit_access($user, $buda_boinc_app->id)) { |
393 | 393 | error_page('no access'); |