absolutePath."cookies".$system->separator); define("includesDirectory",$system->absolutePath.$system->separator."includes".$system->separator); define("libDirectory",$system->absolutePath.$system->separator."lib".$system->separator); define("absolulte_img",$system->absolutePath.$system->separator."images".$system->separator); define("PATH",$system->absolutePath); class systemClass { public $absolutePath; public $separator; public $phpPath="D:\\server\\php\\php.exe"; //Linux: php; WINDOWS: D:\\Program files\\EasyPHP 3.0\\php\\php.exe public $isWindows; public $con; public $protocol; public $site; public $thisfile; public $real_directories; public $num_of_real_directories; public $virtual_directories = array(); public $num_of_virtual_directories = array(); public $baseurl; public $url; public function __construct() { $this->absolutePath=dirname(__FILE__); $this->separator=$this->getSeparator(); $this->absolutePath.=$this->separator; $this->VirtualDirectory(); global $connection; $this->con=$connection; } public function getSeparator() { if (substr(php_uname(), 0, 7) == "Windows") { $this->isWindows=true; return "\\"; } else { $this->isWindows=false; return "/"; } } function executeBackScript($file,$arg="") { //$path=$this->absultePath.$file; $cmd=$this->phpPath.' "'.$file.'" '.$arg; //$cmd=str_replace("\\","\\\\",$cmd); //die($cmd); if($this->isWindows) { $WshShell = new COM("WScript.Shell") or die("Unable to instantiate Mappoint COM object");; $WshShell->Run($cmd, 0, false); } else exec($cmd . " > /dev/null &"); } function executProgram($comand) { if (system($comand, $ret_value)) return $ret_value; return false; } function VirtualDirectory() { $this->protocol = "http";///$_SERVER['https'] == 'on' ? 'https' : 'http'; $this->site = $this->protocol . '://' . $_SERVER['HTTP_HOST']; $this->thisfile = basename($_SERVER['SCRIPT_FILENAME']); $this->real_directories = $this->cleanUp(explode("/", str_replace($this->thisfile, "", $_SERVER['PHP_SELF']))); $this->num_of_real_directories = count($this->real_directories); $this->virtual_directories = array_diff($this->cleanUp(explode("/", str_replace($this->thisfile, "", $_SERVER['REQUEST_URI']))),$this->real_directories); $this->num_of_virtual_directories = count($this->virtual_directories); $this->baseurl = $this->site . "/" . implode("/", $this->real_directories) . "/"; $this->url = $this->baseurl . implode("/", $this->virtual_directories) . "/"; } function cleanUp($array) { $cleaned_array = array(); foreach($array as $key => $value) { $qpos = strpos($value, "?"); if($qpos !== false) { break; } if($key != "" && $value != "") { $cleaned_array[] = $value; } } return $cleaned_array; } } ?>