X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiFeedRecentChanges.php;h=7239a2967f4dd3b7b98b83c9f910da2f49ab3a32;hb=f85ae83503058a8fdc7b69bd256fe14fe3821eea;hp=a2641ee646c95c5df6fbb19dc09f134d08d16c46;hpb=f9a88733ee9d4987b375147001ec6f9895748407;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiFeedRecentChanges.php b/includes/api/ApiFeedRecentChanges.php index a2641ee646..7239a2967f 100644 --- a/includes/api/ApiFeedRecentChanges.php +++ b/includes/api/ApiFeedRecentChanges.php @@ -40,15 +40,16 @@ class ApiFeedRecentChanges extends ApiBase { * as an RSS/Atom feed. */ public function execute() { - global $wgFeed, $wgFeedClasses; + $config = $this->getConfig(); $this->params = $this->extractRequestParams(); - if ( !$wgFeed ) { + if ( !$config->get( 'Feed' ) ) { $this->dieUsage( 'Syndication feeds are not available', 'feed-unavailable' ); } - if ( !isset( $wgFeedClasses[$this->params['feedformat']] ) ) { + $feedClasses = $config->get( 'FeedClasses' ); + if ( !isset( $feedClasses[$this->params['feedformat']] ) ) { $this->dieUsage( 'Invalid subscription feed type', 'feed-invalid' ); } @@ -110,8 +111,8 @@ class ApiFeedRecentChanges extends ApiBase { } public function getAllowedParams() { - global $wgFeedClasses, $wgAllowCategorizedRecentChanges, $wgFeedLimit; - $feedFormatNames = array_keys( $wgFeedClasses ); + $config = $this->getConfig(); + $feedFormatNames = array_keys( $config->get( 'FeedClasses' ) ); $ret = array( 'feedformat' => array( @@ -133,7 +134,7 @@ class ApiFeedRecentChanges extends ApiBase { 'limit' => array( ApiBase::PARAM_DFLT => 50, ApiBase::PARAM_MIN => 1, - ApiBase::PARAM_MAX => $wgFeedLimit, + ApiBase::PARAM_MAX => $config->get( 'FeedLimit' ), ApiBase::PARAM_TYPE => 'integer', ), 'from' => array( @@ -157,7 +158,7 @@ class ApiFeedRecentChanges extends ApiBase { 'showlinkedto' => false, ); - if ( $wgAllowCategorizedRecentChanges ) { + if ( $config->get( 'AllowCategorizedRecentChanges' ) ) { $ret += array( 'categories' => array( ApiBase::PARAM_TYPE => 'string', @@ -197,13 +198,6 @@ class ApiFeedRecentChanges extends ApiBase { return 'Returns a recent changes feed'; } - public function getPossibleErrors() { - return array_merge( parent::getPossibleErrors(), array( - array( 'code' => 'feed-unavailable', 'info' => 'Syndication feeds are not available' ), - array( 'code' => 'feed-invalid', 'info' => 'Invalid subscription feed type' ), - ) ); - } - public function getExamples() { return array( 'api.php?action=feedrecentchanges',