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
This commit is contained in:
Ori Livneh 2013-08-26 13:58:29 -07:00
parent a26ca14208
commit ffc71cb6af
2 changed files with 8 additions and 8 deletions

View file

@ -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',
);

View file

@ -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];
}
/**