/** * * laod Config of chat from json file (we need to use jsone file becasue w) * @param string $name */ static function getChatConfig($name) { global $wgWikiaLocalSettingsPath, $wgDevelEnvironment, $wgWikiaConfigDirectory; wfProfileIn(__METHOD__); if (empty(self::$configFile)) { $configFilePath = $wgWikiaConfigDirectory . '/ChatConfig.json'; $string = file_get_contents($configFilePath); self::$configFile = json_decode($string, true); } if (isset(self::$configFile[empty($wgDevelEnvironment) ? 'prod' : 'dev'][$name])) { wfProfileOut(__METHOD__); return self::$configFile[empty($wgDevelEnvironment) ? 'prod' : 'dev'][$name]; } if (isset(self::$configFile[$name])) { wfProfileOut(__METHOD__); return self::$configFile[$name]; } wfProfileOut(__METHOD__); return false; }
/** * * Load Config of chat from json file * * @param string $name * * @return bool */ static function getChatConfig($name) { global $wgWikiaEnvironment; $configDir = getenv('WIKIA_CONFIG_ROOT'); if (empty(self::$configFile)) { $configFilePath = $configDir . '/ChatConfig.json'; $string = file_get_contents($configFilePath); self::$configFile = json_decode($string, true); } if (empty(self::$configFile)) { return false; } $env = $wgWikiaEnvironment; if (isset(self::$configFile[$env][$name])) { return self::$configFile[$env][$name]; } if (isset(self::$configFile[$name])) { return self::$configFile[$name]; } return false; }