23use InvalidArgumentException;
48 if ( !isset( $params[
'class'] ) ) {
49 if ( !isset( $params[
'uri'] ) ) {
50 throw new InvalidArgumentException(
'RCFeeds must have a class set' );
52 if ( strpos( $params[
'uri'],
'udp:' ) === 0 ) {
53 $params[
'class'] = UDPRCFeedEngine::class;
54 } elseif ( strpos( $params[
'uri'],
'redis:' ) === 0 ) {
55 $params[
'class'] = RedisPubSubFeedEngine::class;
59 $scheme = parse_url( $params[
'uri'], PHP_URL_SCHEME );
61 throw new InvalidArgumentException(
"Invalid RCFeed uri: {$params['uri']}" );
64 throw new InvalidArgumentException(
"Unknown RCFeed engine: $scheme" );
70 $class = $params[
'class'];
71 if ( defined(
'MW_PHPUNIT_TEST' ) && is_object( $class ) ) {
74 if ( !class_exists( $class ) ) {
75 throw new InvalidArgumentException(
"Unknown class '$class'." );
77 return new $class( $params );
81class_alias( RCFeed::class,
'RCFeed' );
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
if(!defined('MW_SETUP_CALLBACK'))
$wgRCEngines
Config variable stub for the RCEngines setting, for use by phpdoc and IDEs.