From: Ori Livneh Date: Mon, 26 Aug 2013 20:58:29 +0000 (-0700) Subject: Rename '$wgStreamLoggers' => '$wgRCEngines' X-Git-Tag: 1.31.0-rc.0~18865^2 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=ffc71cb6afeae296ed4365dcccdc07f2621b099d;p=lhc%2Fweb%2Fwiklou.git Rename '$wgStreamLoggers' => '$wgRCEngines' The name '$wgStreamLoggers' captures the direction in which I'd like to see this evolve, but for the time being it is a misnomer, giving the false impression that it is more general than it in fact is. I did not bother deprecating the old name since it was only merged to master yesterday. Also renamed: RecentChange::getStreamEngine -> RecentChange::getEngine (for consistency with the change to the config var name). Change-Id: I0d7b08e591e897b24528ea0981a6fcb93cfe8831 --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 20c72ee7a2..22b7f1ecd4 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -5470,10 +5470,10 @@ $wgRC2UDPOmitBots = false; $wgRCFeeds = array(); /** - * Used by RecentChange::getStreamEngine to find the correct engine to use for a given URI protocol. + * Used by RecentChange::getEngine to find the correct engine to use for a given URI scheme. * Keys are scheme names, values are names of engine classes. */ -$wgStreamLoggers = array( +$wgRCEngines = array( 'udp' => 'UDPRCFeedEngine', ); diff --git a/includes/RecentChange.php b/includes/RecentChange.php index 939e9246db..45a8fbcaee 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -317,7 +317,7 @@ class RecentChange { global $wgRCFeeds; foreach ( $wgRCFeeds as $feed ) { - $engine = self::getStreamEngine( $feed['uri'] ); + $engine = self::getEngine( $feed['uri'] ); if ( isset( $this->mExtras['actionCommentIRC'] ) ) { $actionComment = $this->mExtras['actionCommentIRC']; @@ -342,24 +342,24 @@ class RecentChange { } /** - * Gets the stream engine object for a given URI from $wgStreamLoggers + * Gets the stream engine object for a given URI from $wgRCEngines * * @param $uri string URI to get the engine object for * @return object The engine object */ - private static function getStreamEngine( $uri ) { - global $wgStreamLoggers; + private static function getEngine( $uri ) { + global $wgRCEngines; $scheme = parse_url( $uri, PHP_URL_SCHEME ); if ( !$scheme ) { throw new MWException( __FUNCTION__ . ": Invalid stream logger URI: '$uri'" ); } - if ( !isset( $wgStreamLoggers[$scheme] ) ) { + if ( !isset( $wgRCEngines[$scheme] ) ) { throw new MWException( __FUNCTION__ . ": Unknown stream logger URI scheme: $scheme" ); } - return new $wgStreamLoggers[$scheme]; + return new $wgRCEngines[$scheme]; } /**