/** * Loads the dynamic configuration from a file */ public static function dynamicLoad() { /* Loads the configuration file */ $configData = json_decode(file_get_contents(DEFAULT_CONFIG_FILE)); /* Loads the languages */ self::$LANGUAGES = json_decode(file_get_contents(LANGUAGES_LIST_FILE), true); /* Loads the css theme */ self::$DEFAULT_CSS_THEME = $configData->theme; /* Loads the language */ putenv('LANG=' . self::$LANGUAGES[$configData->lang]); putenv('LANGUAGE=' . self::$LANGUAGES[$configData->lang]); setlocale(LC_ALL, self::$LANGUAGES[$configData->lang]); /* Set the text domain as 'messages' */ $domain = 'messages'; bindtextdomain($domain, LOCALIZATION_DIR); bind_textdomain_codeset($domain, META_CHARSET); self::$DEFAULT_LANG = $configData->lang; /* Loads the server ip */ self::$REMOTE_SERVER_IP = $configData->serverIp; /* Sets the cache time */ self::$CACHE_TIME = $configData->cacheTime; }