File: run_algorithm.php

package info (click to toggle)
assemblytics 1.0+ds-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 416 kB
  • sloc: python: 564; perl: 234; php: 124; sh: 94; makefile: 11
file content (42 lines) | stat: -rw-r--r-- 1,850 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<html>
    <body>
        
<?php

    if( !isset($_POST['code']) ) { echo shell_exec('echo ERROR: No code passed to run_algorithm.php >> user_data/ERRORS/run_algorithm.log');}
    $code=$_POST["code"];
    if( !isset($_POST['nickname']) ) { echo shell_exec('echo ERROR: No nickname passed to run_algorithm.php >> user_data/$code/run_algorithm.log');}
    if( !isset($_POST['uniqlength']) ) { echo shell_exec('echo ERROR: No uniqlength passed to run_algorithm.php >> user_data/$code/run_algorithm.log');} 
    if( !isset($_POST['min_size']) ) { echo shell_exec('echo ERROR: No min_size passed to run_algorithm.php >> user_data/$code/run_algorithm.log');} 
    if( !isset($_POST['max_size']) ) { echo shell_exec('echo ERROR: No max_size passed to run_algorithm.php >> user_data/$code/run_algorithm.log');} 
    $nickname = $_POST["nickname"];
    $uniqlength = $_POST["uniqlength"];
    $min_size = $_POST["min_size"];
    $max_size = $_POST["max_size"];
    $url="analysis.php?code=$code";
    $filename="user_uploads/$code";
    $oldmask = umask(0);
    mkdir("user_data/$code");
    umask($oldmask);
    
    echo shell_exec("./bin/web_pipeline $filename user_data/$code/$nickname $uniqlength $min_size $max_size &> user_data/$code/run_algorithm_errors.log &"); 

    $new_dataset = array( "date"=>time(), "codename"=>$code, "description"=> $nickname );

    $my_datasets = array();
    if(isset($_COOKIE["results"])) {
      // echo "cookie is already there, adding to it.";
      $my_datasets = json_decode($_COOKIE["results"], true);
    } else {
      // echo "cookie not set, creating new one";
    }
    array_push($my_datasets, $new_dataset);
    setcookie("results", json_encode($my_datasets));


    header('Location: '.$url);
?>
    </body>
</html>

<!-- <form name="input_code_form" action="run.php" id="analysis_form" method="post"> -->