From: Jean-Marc Pigeon (Delson) Date: Wed, 27 Aug 2025 16:30:59 +0000 (-0400) Subject: unienv seems almost ready X-Git-Tag: end-0.15~63 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=0e745ce25671005727b4228fa6bce6417e89321f;p=jmp%2Fmailleur unienv seems almost ready --- diff --git a/www/unienv.php b/www/unienv.php index 37ca081..98cf2ea 100644 --- a/www/unienv.php +++ b/www/unienv.php @@ -28,17 +28,23 @@ while ($proceed==true) { $phase=999; } break; - case 3 : //scanning file + case 2 : //scanning file while (($line=fgets($fopen))!==false) { - if ((substr(trim($line),0,1)=='#') + if (substr(trim($line),0,1)=='#') continue; if (empty(trim($line))) continue; $line_no_comment=explode("#",$line,2)[0]; - echo ("no_com=<$line_no_comment>\n"); + $env_ex=preg_split('/(\s?)\=(\s?)/',$line_no_comment); + $env_name=trim($env_ex[0]); + $env_value=""; + if (isset($env_ex[1])) + $env_value=trim($env_ex[1]); + putenv($env_name,$env_value); + echo ("$env_name is equal to <$getenv($env_name)>\n"); } break; - case 4 : //closing file + case 3 : //closing file fclose($fopen); break; default : //SAFE Guard