about summary refs log tree commit diff
path: root/sourcecodes/add_inv.php
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-09-28 14:48:57 +0000
committerPjotr <wrk@bosa.lan>2026-09-28 14:51:45 +0000
commit7f460113cc9c7eca91935549c25d78a9393e0977 (patch)
treee9a05e98fdaf571cd15975c6a1e3e73727b84bf2 /sourcecodes/add_inv.php
parent8380798b1c60c9844b9952921a8a7361e2fb28cd (diff)
downloadgn-bnw-7f460113cc9c7eca91935549c25d78a9393e0977.tar.gz
container: deployment fixes for the Guix container/VM
Changes previously carried as bnw-container-paths.patch in
guix-bioinformatics, now applied to the source directly:

* unify data directories on /var/lib/genenet/bnw (was /tmp/bnw and
  ./data/ mixed)
* make the shell_exec paths __DIR__-relative and the example/octave
  helper scripts location-independent, so php-fpm can run them from
  any working directory
* use core-octave randn/exp instead of the statistics-package
  normrnd/normpdf (not available in the container's octave)
* nnodes: strtrim before strfind so the node count parses with the
  container's octave output
* python3 instead of a hardcoded /home/jziebart path
* add diag.php, a debug page showing the request and data state
* bn_genenet.php: serve the GeneNetwork (GN2) handshake server-side;
  the My_Gennenet POST is converted (commas -> tabs, semicolons ->
  newlines) in PHP and the prepared-data page is returned in ONE
  request.  This removes the raw-echo of  into a JavaScript
  string (an XSS hole on public deployments) and is backward
  compatible for GN2 (same POST, better response).
Diffstat (limited to 'sourcecodes/add_inv.php')
-rw-r--r--sourcecodes/add_inv.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/sourcecodes/add_inv.php b/sourcecodes/add_inv.php
index 61845a46..185bc999 100644
--- a/sourcecodes/add_inv.php
+++ b/sourcecodes/add_inv.php
@@ -34,8 +34,8 @@ foreach($leve_l as $l)
 function mapid($name,$keyval)
 {
 
-  //$dir="./data/";
-$dir="/tmp/bnw/";
+  //$dir="/var/lib/genenet/bnw/";
+$dir="/var/lib/genenet/bnw/";
 
 $nm=$dir."$keyval"."mapdata.txt";
 $namelist=file_get_contents("$nm");
@@ -62,8 +62,8 @@ return $val;
 }
 
 
-//$dir="./data/";
-$dir="/tmp/bnw/";
+//$dir="/var/lib/genenet/bnw/";
+$dir="/var/lib/genenet/bnw/";
 
 $lfile=$dir.$keyval."nlevels.txt";
 $dmapdata=file_get_contents($lfile);
@@ -193,7 +193,7 @@ structure_change($keyval);
 
 
 
-//  $file1="./data/".$keyval."run_newintervention.sh";
+//  $file1="/var/lib/genenet/bnw/".$keyval."run_newintervention.sh";
 //  $initiallines=file_get_contents("./data/temp_intervention_file");
 //  $all_lines="$initiallines"."$keyval\nfi\nexit";
 
@@ -204,7 +204,7 @@ structure_change($keyval);
  // $cmd="./runmat_inv.sh $keyval";
 //  system($cmd);
 
-shell_exec('./run_scripts/run_octave_inv '.$keyval);
+shell_exec(__DIR__.'/run_scripts/run_octave_inv '.$keyval);
 
 
 
@@ -229,7 +229,7 @@ if ($fout !== false) {
 }
 
 
-//$g_file_name="./data/".$keyval."grviz_name_file_new.txt";
+//$g_file_name="/var/lib/genenet/bnw/".$keyval."grviz_name_file_new.txt";
 $g_file_name=$dir.$keyval."grviz_name_file_new.txt";
 $grviz_name_file=fopen($g_file_name,"w");