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
Merge "Add Special:MediaStatistics page for file type stats"
[lhc/web/wiklou.git]
/
includes
/
actions
/
InfoAction.php
diff --git
a/includes/actions/InfoAction.php
b/includes/actions/InfoAction.php
index
c2c1ff5
..
f932a40
100644
(file)
--- a/
includes/actions/InfoAction.php
+++ b/
includes/actions/InfoAction.php
@@
-193,13
+193,13
@@
class InfoAction extends FormlessAction {
* @return array
*/
protected function pageInfo() {
* @return array
*/
protected function pageInfo() {
- global $wgContLang, $wgRCMaxAge, $wgMemc, $wgMiserMode,
- $wgUnwatchedPageThreshold, $wgPageInfoTransclusionLimit, $wgPageLanguageUseDB;
+ global $wgContLang, $wgMemc;
$user = $this->getUser();
$lang = $this->getLanguage();
$title = $this->getTitle();
$id = $title->getArticleID();
$user = $this->getUser();
$lang = $this->getLanguage();
$title = $this->getTitle();
$id = $title->getArticleID();
+ $config = $this->context->getConfig();
$memcKey = wfMemcKey( 'infoaction',
sha1( $title->getPrefixedText() ), $this->page->getLatest() );
$memcKey = wfMemcKey( 'infoaction',
sha1( $title->getPrefixedText() ), $this->page->getLatest() );
@@
-207,7
+207,7
@@
class InfoAction extends FormlessAction {
$version = isset( $pageCounts['cacheversion'] ) ? $pageCounts['cacheversion'] : false;
if ( $pageCounts === false || $version !== self::CACHE_VERSION ) {
// Get page information that would be too "expensive" to retrieve by normal means
$version = isset( $pageCounts['cacheversion'] ) ? $pageCounts['cacheversion'] : false;
if ( $pageCounts === false || $version !== self::CACHE_VERSION ) {
// Get page information that would be too "expensive" to retrieve by normal means
- $pageCounts =
self::
pageCounts( $title );
+ $pageCounts =
$this->
pageCounts( $title );
$pageCounts['cacheversion'] = self::CACHE_VERSION;
$wgMemc->set( $memcKey, $pageCounts );
$pageCounts['cacheversion'] = self::CACHE_VERSION;
$wgMemc->set( $memcKey, $pageCounts );
@@
-276,7
+276,7
@@
class InfoAction extends FormlessAction {
// Language in which the page content is (supposed to be) written
$pageLang = $title->getPageLanguage()->getCode();
// Language in which the page content is (supposed to be) written
$pageLang = $title->getPageLanguage()->getCode();
- if ( $
wgPageLanguageUseDB
&& $this->getTitle()->userCan( 'pagelang' ) ) {
+ if ( $
config->get( 'PageLanguageUseDB' )
&& $this->getTitle()->userCan( 'pagelang' ) ) {
// Link to Special:PageLanguage with pre-filled page title if user has permissions
$titleObj = SpecialPage::getTitleFor( 'PageLanguage', $title->getPrefixedText() );
$langDisp = Linker::link(
// Link to Special:PageLanguage with pre-filled page title if user has permissions
$titleObj = SpecialPage::getTitleFor( 'PageLanguage', $title->getPrefixedText() );
$langDisp = Linker::link(
@@
-321,19
+321,20
@@
class InfoAction extends FormlessAction {
);
}
);
}
+ $unwatchedPageThreshold = $config->get( 'UnwatchedPageThreshold' );
if (
$user->isAllowed( 'unwatchedpages' ) ||
if (
$user->isAllowed( 'unwatchedpages' ) ||
- ( $
wgU
nwatchedPageThreshold !== false &&
- $pageCounts['watchers'] >= $
wgU
nwatchedPageThreshold )
+ ( $
u
nwatchedPageThreshold !== false &&
+ $pageCounts['watchers'] >= $
u
nwatchedPageThreshold )
) {
// Number of page watchers
$pageInfo['header-basic'][] = array(
$this->msg( 'pageinfo-watchers' ), $lang->formatNum( $pageCounts['watchers'] )
);
) {
// Number of page watchers
$pageInfo['header-basic'][] = array(
$this->msg( 'pageinfo-watchers' ), $lang->formatNum( $pageCounts['watchers'] )
);
- } elseif ( $
wgU
nwatchedPageThreshold !== false ) {
+ } elseif ( $
u
nwatchedPageThreshold !== false ) {
$pageInfo['header-basic'][] = array(
$this->msg( 'pageinfo-watchers' ),
$pageInfo['header-basic'][] = array(
$this->msg( 'pageinfo-watchers' ),
- $this->msg( 'pageinfo-few-watchers' )->numParams( $
wgU
nwatchedPageThreshold )
+ $this->msg( 'pageinfo-few-watchers' )->numParams( $
u
nwatchedPageThreshold )
);
}
);
}
@@
-521,7
+522,7
@@
class InfoAction extends FormlessAction {
// Recent number of edits (within past 30 days)
$pageInfo['header-edits'][] = array(
// Recent number of edits (within past 30 days)
$pageInfo['header-edits'][] = array(
- $this->msg( 'pageinfo-recent-edits', $lang->formatDuration( $
wgRCMaxAge
) ),
+ $this->msg( 'pageinfo-recent-edits', $lang->formatDuration( $
config->get( 'RCMaxAge' )
) ),
$lang->formatNum( $pageCounts['recent_edits'] )
);
$lang->formatNum( $pageCounts['recent_edits'] )
);
@@
-555,9
+556,9
@@
class InfoAction extends FormlessAction {
$pageCounts['transclusion']['from'] > 0 ||
$pageCounts['transclusion']['to'] > 0
) {
$pageCounts['transclusion']['from'] > 0 ||
$pageCounts['transclusion']['to'] > 0
) {
- $options = array( 'LIMIT' => $
wgPageInfoTransclusionLimit
);
+ $options = array( 'LIMIT' => $
config->get( 'PageInfoTransclusionLimit' )
);
$transcludedTemplates = $title->getTemplateLinksFrom( $options );
$transcludedTemplates = $title->getTemplateLinksFrom( $options );
- if ( $
wgMiserMode
) {
+ if ( $
config->get( 'MiserMode' )
) {
$transcludedTargets = array();
} else {
$transcludedTargets = $title->getTemplateLinksTo( $options );
$transcludedTargets = array();
} else {
$transcludedTargets = $title->getTemplateLinksTo( $options );
@@
-602,7
+603,7
@@
class InfoAction extends FormlessAction {
);
}
);
}
- if ( !$
wgMiserMode
&& $pageCounts['transclusion']['to'] > 0 ) {
+ if ( !$
config->get( 'MiserMode' )
&& $pageCounts['transclusion']['to'] > 0 ) {
if ( $pageCounts['transclusion']['to'] > count( $transcludedTargets ) ) {
$more = Linker::link(
$whatLinksHere,
if ( $pageCounts['transclusion']['to'] > count( $transcludedTargets ) ) {
$more = Linker::link(
$whatLinksHere,
@@
-635,16
+636,15
@@
class InfoAction extends FormlessAction {
* @param Title $title Title to get counts for
* @return array
*/
* @param Title $title Title to get counts for
* @return array
*/
- protected static function pageCounts( Title $title ) {
- global $wgRCMaxAge, $wgDisableCounters, $wgMiserMode;
-
+ protected function pageCounts( Title $title ) {
wfProfileIn( __METHOD__ );
$id = $title->getArticleID();
wfProfileIn( __METHOD__ );
$id = $title->getArticleID();
+ $config = $this->context->getConfig();
$dbr = wfGetDB( DB_SLAVE );
$result = array();
$dbr = wfGetDB( DB_SLAVE );
$result = array();
- if ( !$
wgDisableCounters
) {
+ if ( !$
config->get( 'DisableCounters' )
) {
// Number of views
$views = (int)$dbr->selectField(
'page',
// Number of views
$views = (int)$dbr->selectField(
'page',
@@
-685,8
+685,8
@@
class InfoAction extends FormlessAction {
);
$result['authors'] = $authors;
);
$result['authors'] = $authors;
- // "Recent" threshold defined by
$wgRCMaxAge
- $threshold = $dbr->timestamp( time() - $
wgRCMaxAge
);
+ // "Recent" threshold defined by
RCMaxAge setting
+ $threshold = $dbr->timestamp( time() - $
config->get( 'RCMaxAge' )
);
// Recent number of edits
$edits = (int)$dbr->selectField(
// Recent number of edits
$edits = (int)$dbr->selectField(
@@
-740,7
+740,7
@@
class InfoAction extends FormlessAction {
}
// Counts for the number of transclusion links (to/from)
}
// Counts for the number of transclusion links (to/from)
- if ( $
wgMiserMode
) {
+ if ( $
config->get( 'MiserMode' )
) {
$result['transclusion']['to'] = 0;
} else {
$result['transclusion']['to'] = (int)$dbr->selectField(
$result['transclusion']['to'] = 0;
} else {
$result['transclusion']['to'] = (int)$dbr->selectField(
@@
-780,8
+780,6
@@
class InfoAction extends FormlessAction {
* @return string Html
*/
protected function getContributors() {
* @return string Html
*/
protected function getContributors() {
- global $wgHiddenPrefs;
-
$contributors = $this->page->getContributors();
$real_names = array();
$user_names = array();
$contributors = $this->page->getContributors();
$real_names = array();
$user_names = array();
@@
-794,9
+792,10
@@
class InfoAction extends FormlessAction {
? SpecialPage::getTitleFor( 'Contributions', $user->getName() )
: $user->getUserPage();
? SpecialPage::getTitleFor( 'Contributions', $user->getName() )
: $user->getUserPage();
+ $hiddenPrefs = $this->context->getConfig()->get( 'HiddenPrefs' );
if ( $user->getID() == 0 ) {
$anon_ips[] = Linker::link( $page, htmlspecialchars( $user->getName() ) );
if ( $user->getID() == 0 ) {
$anon_ips[] = Linker::link( $page, htmlspecialchars( $user->getName() ) );
- } elseif ( !in_array( 'realname', $
wgH
iddenPrefs ) && $user->getRealName() ) {
+ } elseif ( !in_array( 'realname', $
h
iddenPrefs ) && $user->getRealName() ) {
$real_names[] = Linker::link( $page, htmlspecialchars( $user->getRealName() ) );
} else {
$user_names[] = Linker::link( $page, htmlspecialchars( $user->getName() ) );
$real_names[] = Linker::link( $page, htmlspecialchars( $user->getRealName() ) );
} else {
$user_names[] = Linker::link( $page, htmlspecialchars( $user->getName() ) );