dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Followup e48ecbc5: fix fatal error due to undefined variable
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiFeedRecentChanges.php
diff --git
a/includes/api/ApiFeedRecentChanges.php
b/includes/api/ApiFeedRecentChanges.php
index
9062ad9
..
bb68d5a
100644
(file)
--- a/
includes/api/ApiFeedRecentChanges.php
+++ b/
includes/api/ApiFeedRecentChanges.php
@@
-40,18
+40,25
@@
class ApiFeedRecentChanges extends ApiBase {
* as an RSS/Atom feed.
*/
public function execute() {
* as an RSS/Atom feed.
*/
public function execute() {
-
global $wgFeed, $wgFeedClasses
;
+
$config = $this->getConfig()
;
$this->params = $this->extractRequestParams();
$this->params = $this->extractRequestParams();
- if ( !$
wgFeed
) {
+ if ( !$
config->get( 'Feed' )
) {
$this->dieUsage( 'Syndication feeds are not available', 'feed-unavailable' );
}
$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' );
}
$this->dieUsage( 'Invalid subscription feed type', 'feed-invalid' );
}
+ $this->getMain()->setCacheMode( 'public' );
+ if ( !$this->getMain()->getParameter( 'smaxage' ) ) {
+ // bug 63249: This page gets hit a lot, cache at least 15 seconds.
+ $this->getMain()->setCacheMaxAge( 15 );
+ }
+
$feedFormat = $this->params['feedformat'];
$specialClass = $this->params['target'] !== null
? 'SpecialRecentchangeslinked'
$feedFormat = $this->params['feedformat'];
$specialClass = $this->params['target'] !== null
? 'SpecialRecentchangeslinked'
@@
-104,8
+111,8
@@
class ApiFeedRecentChanges extends ApiBase {
}
public function getAllowedParams() {
}
public function getAllowedParams() {
-
global $wgFeedClasses, $wgAllowCategorizedRecentChanges, $wgFeedLimit
;
- $feedFormatNames = array_keys( $
wgFeedClasses
);
+
$config = $this->getConfig()
;
+ $feedFormatNames = array_keys( $
config->get( 'FeedClasses' )
);
$ret = array(
'feedformat' => array(
$ret = array(
'feedformat' => array(
@@
-127,7
+134,7
@@
class ApiFeedRecentChanges extends ApiBase {
'limit' => array(
ApiBase::PARAM_DFLT => 50,
ApiBase::PARAM_MIN => 1,
'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(
ApiBase::PARAM_TYPE => 'integer',
),
'from' => array(
@@
-151,7
+158,7
@@
class ApiFeedRecentChanges extends ApiBase {
'showlinkedto' => false,
);
'showlinkedto' => false,
);
- if ( $
wgAllowCategorizedRecentChanges
) {
+ if ( $
config->get( 'AllowCategorizedRecentChanges' )
) {
$ret += array(
'categories' => array(
ApiBase::PARAM_TYPE => 'string',
$ret += array(
'categories' => array(
ApiBase::PARAM_TYPE => 'string',