/** * @param $langCode string * @return array * @throws MWException */ private static function getFeedsInternal($langCode) { global $wgFeaturedFeeds, $wgFeaturedFeedsDefaults, $wgContLang; wfProfileIn(__METHOD__); $feedDefs = $wgFeaturedFeeds; wfRunHooks('FeaturedFeeds::getFeeds', array(&$feedDefs)); // fill defaults foreach ($feedDefs as $name => $opts) { foreach ($wgFeaturedFeedsDefaults as $setting => $value) { if (!isset($opts[$setting])) { $feedDefs[$name][$setting] = $value; } } } $feeds = array(); $requestedLang = Language::factory($langCode); $parser = new Parser(); foreach ($feedDefs as $name => $opts) { $feed = new FeaturedFeedChannel($name, $opts, $requestedLang); if (!$feed->isOK()) { continue; } $feed->getFeedItems(); $feeds[$name] = $feed; } wfProfileOut(__METHOD__); return $feeds; }
/** * @param $langCode string * @return array * @throws MWException */ private static function getFeedsInternal($langCode) { wfProfileIn(__METHOD__); $feedDefs = self::getFeedDefinitions(); $feeds = array(); $requestedLang = Language::factory($langCode); foreach ($feedDefs as $name => $opts) { $feed = new FeaturedFeedChannel($name, $opts, $requestedLang); if (!$feed->isOK()) { continue; } $feed->getFeedItems(); $feeds[$name] = $feed; } wfProfileOut(__METHOD__); return $feeds; }