X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Factions%2FInfoAction.php;h=bfba59a02c7fbef60fb72110290d773bc40799c0;hb=8c59f43b3342292a464db5df492e478b29a64aa5;hp=25e4aaeabc1dd51920b6d5a589a46d47e2ca8b4e;hpb=aae7ba949a9fc35e49c14de44605cb68b04e5f76;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index 25e4aaeabc..bfba59a02c 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -264,6 +264,12 @@ class InfoAction extends FormlessAction { $this->msg( 'pageinfo-length' ), $lang->formatNum( $title->getLength() ) ]; + // Page namespace + $pageNamespace = $title->getNsText(); + if ( $pageNamespace ) { + $pageInfo['header-basic'][] = [ $this->msg( 'pageinfo-namespace' ), $pageNamespace ]; + } + // Page ID (number not localised, as it's a database ID) $pageInfo['header-basic'][] = [ $this->msg( 'pageinfo-article-id' ), $id ]; @@ -393,7 +399,7 @@ class InfoAction extends FormlessAction { } // Subpages of this page, if subpages are enabled for the current NS - if ( MWNamespace::hasSubpages( $title->getNamespace() ) ) { + if ( $services->getNamespaceInfo()->hasSubpages( $title->getNamespace() ) ) { $prefixIndex = SpecialPage::getTitleFor( 'Prefixindex', $title->getPrefixedText() . '/' ); $pageInfo['header-basic'][] = [ @@ -724,12 +730,13 @@ class InfoAction extends FormlessAction { protected function pageCounts( Page $page ) { $fname = __METHOD__; $config = $this->context->getConfig(); - $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); + $services = MediaWikiServices::getInstance(); + $cache = $services->getMainWANObjectCache(); return $cache->getWithSetCallback( self::getCacheKey( $cache, $page->getTitle(), $page->getLatest() ), WANObjectCache::TTL_WEEK, - function ( $oldValue, &$ttl, &$setOpts ) use ( $page, $config, $fname ) { + function ( $oldValue, &$ttl, &$setOpts ) use ( $page, $config, $fname, $services ) { global $wgActorTableSchemaMigrationStage; $title = $page->getTitle(); @@ -753,7 +760,7 @@ class InfoAction extends FormlessAction { $joins = []; } - $watchedItemStore = MediaWikiServices::getInstance()->getWatchedItemStore(); + $watchedItemStore = $services->getWatchedItemStore(); $result = []; $result['watchers'] = $watchedItemStore->countWatchers( $title ); @@ -818,7 +825,7 @@ class InfoAction extends FormlessAction { ); // Subpages (if enabled) - if ( MWNamespace::hasSubpages( $title->getNamespace() ) ) { + if ( $services->getNamespaceInfo()->hasSubpages( $title->getNamespace() ) ) { $conds = [ 'page_namespace' => $title->getNamespace() ]; $conds[] = 'page_title ' . $dbr->buildLike( $title->getDBkey() . '/', $dbr->anyString() );