--- /dev/null
+<?php
+
+//==============================================================
+//
+// To load environement variable
+//
+//==============================================================
+function loadenv()
+
+{
+$var_arrs=array();
+$phase=0;
+$proceed=true;
+while ($proceed==true) {
+ switch ($phase) {
+ case 0 : //Loading environment variable
+ $env_file_path=realpath("/etc/mailleur/"."mailleur.conf");
+ echo $env_file_path;
+ break;
+ case 1 : //checking if file exist
+ if(!is_file($env_file_path)){
+ throw new ErrorException("Environment File is Missing.");
+ $phase=999; //no need to go further
+ }
+ break;
+ case 2 : //opening file
+ $fopen=fopen($env_file_path,'r');
+ if (!$fopen) {
+ throw new ErrorException("Unable to read file <".($env_file_path).">");
+ $phase=999;
+ break;
+ case 3 : //scanning file
+ break;
+ case 4 : //closing file
+ fclose($fopen);
+ break;
+ default : //SAFE Guard
+ $proceed=false;
+ break;
+ }
+ $phase++;
+ }
+}
+
+?>