private function _pullConfigVariables() { $xmlHand = new class_xml(); // Load and read active config file $actConfig = $xmlHand->xml2array(ACTIVECONFIG); $actFileArray = $xmlHand->getValueByPath($actConfig, "config/file"); $actFile = $actFileArray['value']; // Load active Config $fileConfig = $xmlHand->xml2array(OPENSRSURI . OPENSRSCONFINGS . $actFile); $fileFileArray = $xmlHand->getValueByPath($fileConfig, "config/osrsFastLookup"); foreach ($fileFileArray as $ffa) { if ($ffa['name'] == "osrs_host" && isset($ffa['value'])) { $this->osrs_host = $ffa['value']; } if ($ffa['name'] == "osrs_port" && isset($ffa['value'])) { $this->osrs_port = $ffa['value']; } } if ($this->osrs_host == "" || $this->osrs_port == "") { if ($this->osrs_host == "") { trigger_error("oSRS Error - Incomplete config file - Missing osrs_host", E_USER_WARNING); } if ($this->osrs_port == "") { trigger_error("oSRS Error - Incomplete config file - Missing osrs_port", E_USER_WARNING); } die; } }
private function _pullConfigVariables() { $xmlHand = new class_xml(); // Load and read active config file $actConfig = $xmlHand->xml2array(ACTIVECONFIG); $actFileArray = $xmlHand->getValueByPath($actConfig, "config/file"); $actFile = $actFileArray['value']; // Load active Config $fileConfig = $xmlHand->xml2array(OPENSRSURI . OPENSRSCONFINGS . $actFile); $fileFileArray = $xmlHand->getValueByPath($fileConfig, "config/osrsEmail"); if ($fileFileArray == NULL) { trigger_error("oSRS-eMail Error - Could not fine the osrsEmail section in current config, please check your config file", E_USER_WARNING); } else { foreach ($fileFileArray as $ffa) { if ($ffa['name'] == "osrs_username" && isset($ffa['value'])) { $this->osrs_mailuser = $ffa['value']; } if ($ffa['name'] == "osrs_password" && isset($ffa['value'])) { $this->osrs_mailpassword = $ffa['value']; } if ($ffa['name'] == "osrs_domain" && isset($ffa['value'])) { $this->osrs_maildomain = $ffa['value']; } if ($ffa['name'] == "osrs_host" && isset($ffa['value'])) { $this->osrs_host = $ffa['value']; } if ($ffa['name'] == "osrs_port" && isset($ffa['value'])) { $this->osrs_port = $ffa['value']; } if ($ffa['name'] == "osrs_portwait" && isset($ffa['value'])) { $this->osrs_portwait = $ffa['value']; } if ($ffa['name'] == "osrs_processdelay" && isset($ffa['value'])) { $this->osrs_processdelay = $ffa['value']; } } // Verify all the variables if ($this->osrs_host == "" || $this->osrs_port == 0) { if ($this->osrs_host == "") { trigger_error("oSRS Error - Incomplete config file - Missing osrs_host", E_USER_WARNING); } if ($this->osrs_port == "") { trigger_error("oSRS Error - Incomplete config file - Missing osrs_port", E_USER_WARNING); } die; } } }
private function _pullConfigVariables() { $xmlHand = new class_xml(); // Load and read active config file $actConfig = $xmlHand->xml2array(ACTIVECONFIG); if ($actConfig != false) { $actFileArray = $xmlHand->getValueByPath($actConfig, "config/file"); $actFile = $actFileArray['value']; // Load active Config $fileConfig = $xmlHand->xml2array(OPENSRSURI . OPENSRSCONFINGS . $actFile); if ($fileConfig != false) { $fileFileArray = $xmlHand->getValueByPath($fileConfig, "config/osrsRegular"); foreach ($fileFileArray as $ffa) { if ($ffa['name'] == "osrs_username" && isset($ffa['value'])) { $this->osrs_username = $ffa['value']; } if ($ffa['name'] == "osrs_password" && isset($ffa['value'])) { $this->osrs_password = $ffa['value']; } if ($ffa['name'] == "osrs_key" && isset($ffa['value'])) { $this->osrs_key = $ffa['value']; } if ($ffa['name'] == "osrs_environment" && isset($ffa['value'])) { $this->osrs_environment = $ffa['value']; } if ($ffa['name'] == "osrs_protocol" && isset($ffa['value'])) { $this->osrs_protocol = $ffa['value']; } if ($ffa['name'] == "osrs_host" && isset($ffa['value'])) { $this->osrs_host = $ffa['value']; } if ($ffa['name'] == "osrs_port" && isset($ffa['value'])) { $this->osrs_port = $ffa['value']; } if ($ffa['name'] == "osrs_sslPort" && isset($ffa['value'])) { $this->osrs_sslPort = $ffa['value']; } if ($ffa['name'] == "osrs_baseClassVersion" && isset($ffa['value'])) { $this->osrs_baseClassVersion = $ffa['value']; } if ($ffa['name'] == "osrs_version" && isset($ffa['value'])) { $this->osrs_version = $ffa['value']; } } // Verify all the variables if ($this->osrs_username == "" || $this->osrs_key == "" || $this->osrs_environment == "" || $this->osrs_protocol == "") { if ($this->osrs_username == "") { trigger_error("oSRS Error - Incomplete config file - Missing osrs_username", E_USER_WARNING); } if ($this->osrs_key == "") { trigger_error("oSRS Error - Incomplete config file - Missing osrs_key", E_USER_WARNING); } if ($this->osrs_environment == "") { trigger_error("oSRS Error - Incomplete config file - Missing osrs_environment", E_USER_WARNING); } if ($this->osrs_protocol == "") { trigger_error("oSRS Error - Incomplete config file - Missing osrs_protocol", E_USER_WARNING); } die; } if ($this->osrs_host == "" || $this->osrs_port == "" || $this->osrs_sslPort == "" || $this->osrs_baseClassVersion == "" || $this->osrs_version == "") { if ($this->osrs_host == "") { trigger_error("oSRS Error - Incomplete config file - Missing osrs_host", E_USER_WARNING); } if ($this->osrs_port == "") { trigger_error("oSRS Error - Incomplete config file - Missing osrs_port", E_USER_WARNING); } if ($this->osrs_sslPort == "") { trigger_error("oSRS Error - Incomplete config file - Missing osrs_sslPort", E_USER_WARNING); } if ($this->osrs_baseClassVersion == "") { trigger_error("oSRS Error - Incomplete config file - Missing osrs_baseClassVersion", E_USER_WARNING); } if ($this->osrs_version == "") { trigger_error("oSRS Error - Incomplete config file - Missing osrs_version", E_USER_WARNING); } die; } // Some variables should be in upper case if ($this->osrs_environment != "") { $this->osrs_environment = strtoupper($this->osrs_environment); } if ($this->osrs_protocol) { $this->osrs_protocol = strtoupper($this->osrs_protocol); } } } }