public static function load($forceReload = false) { if (Environment::$currentEnvironment != null and !$forceReload) { return; } if (file_exists(Util::getRootPath() . "plugins/Cloud/Cloud.class.php")) { //!defined("PHYNX_VIA_INTERFACE") removed because of ZPush/lightCRM 03.07.2013 require_once Util::getRootPath() . "plugins/Cloud/Cloud.class.php"; require_once Util::getRootPath() . "plugins/Cloud/mCloud.class.php"; require_once Util::getRootPath() . "plugins/Cloud/CloudStorage.class.php"; Environment::$currentEnvironment = mCloud::getEnvironment(); return; } $h = "Environment" . str_replace(array(":", "-"), "_", implode("", array_map("ucfirst", explode(".", isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : "NonExistentABCDEF")))); if (defined("PHYNX_VIA_INTERFACE")) { if (file_exists(Util::getRootPath() . "specifics/{$h}.class.php")) { require_once Util::getRootPath() . "specifics/{$h}.class.php"; Environment::$currentEnvironment = new $h(); } else { Environment::$currentEnvironment = new Environment(); } return; } try { try { Environment::$currentEnvironment = new $h(); } catch (ClassNotFoundException $e) { Environment::$currentEnvironment = new EnvironmentCurrent(); } } catch (ClassNotFoundException $e) { Environment::$currentEnvironment = new Environment(); } }
public static function load() { if (Environment::$currentEnvironment != null) { return; } if (file_exists(Util::getRootPath() . "plugins/Cloud/Cloud.class.php") and !defined("PHYNX_VIA_INTERFACE")) { require_once Util::getRootPath() . "plugins/Cloud/Cloud.class.php"; require_once Util::getRootPath() . "plugins/Cloud/mCloud.class.php"; Environment::$currentEnvironment = mCloud::getEnvironment(); } else { try { Environment::$currentEnvironment = new EnvironmentCurrent(); } catch (ClassNotFoundException $e) { Environment::$currentEnvironment = new Environment(); } } }