$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 ];
}
// 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'][] = [
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();
$joins = [];
}
- $watchedItemStore = MediaWikiServices::getInstance()->getWatchedItemStore();
+ $watchedItemStore = $services->getWatchedItemStore();
$result = [];
$result['watchers'] = $watchedItemStore->countWatchers( $title );
);
// 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() );