}
}
+ // "Help" button
+ $this->addHelpLink( 'Page information' );
+
// Page header
if ( !$this->msg( 'pageinfo-header' )->isDisabled() ) {
$content .= $this->msg( 'pageinfo-header' )->parse();
}
// 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'][] = [
// Display image SHA-1 value
if ( $title->inNamespace( NS_FILE ) ) {
- $fileObj = wfFindFile( $title );
+ $fileObj = $services->getRepoGroup()->findFile( $title );
if ( $fileObj !== false ) {
// Convert the base-36 sha1 value obtained from database to base-16
$output = Wikimedia\base_convert( $fileObj->getSha1(), 36, 16, 40 );
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() );