* or false if no link is needed
*/
protected function getMarkPatrolledLinkInfo() {
- global $wgUseRCPatrol;
-
$user = $this->getUser();
+ $config = $this->getConfig();
// Prepare a change patrol link, if applicable
if (
// Is patrolling enabled and the user allowed to?
- $wgUseRCPatrol && $this->mNewPage && $this->mNewPage->quickUserCan( 'patrol', $user ) &&
+ $config->get( 'UseRCPatrol' ) &&
+ $this->mNewPage && $this->mNewPage->quickUserCan( 'patrol', $user ) &&
// Only do this if the revision isn't more than 6 hours older
// than the Max RC age (6h because the RC might not be cleaned out regularly)
RecentChange::isInRCLifespan( $this->mNewRev->getTimestamp(), 21600 )
* @return string
*/
protected function debug( $generator = "internal" ) {
- global $wgShowHostnames;
if ( !$this->enableDebugComment ) {
return '';
}
$data = [ $generator ];
- if ( $wgShowHostnames ) {
+ if ( $this->getConfig()->get( 'ShowHostnames' ) ) {
$data[] = wfHostname();
}
$data[] = wfTimestamp( TS_DB );
* @param ImagePage $imagePage
*/
public function __construct( $imagePage ) {
- global $wgShowArchiveThumbnails;
+ $context = $imagePage->getContext();
$this->current = $imagePage->getPage()->getFile();
$this->img = $imagePage->getDisplayedFile();
$this->title = $imagePage->getTitle();
$this->imagePage = $imagePage;
- $this->showThumb = $wgShowArchiveThumbnails && $this->img->canRender();
- $this->setContext( $imagePage->getContext() );
+ $this->showThumb = $context->getConfig()->get( 'ShowArchiveThumbnails' ) &&
+ $this->img->canRender();
+ $this->setContext( $context );
}
/**
public function showReturnToPage(
$type, $returnTo = '', $returnToQuery = '', $stickHTTPS = false
) {
- global $wgRedirectOnLogin, $wgSecureLogin;
-
- if ( $type !== 'error' && $wgRedirectOnLogin !== null ) {
- $returnTo = $wgRedirectOnLogin;
+ $config = $this->getConfig();
+ if ( $type !== 'error' && $config->get( 'RedirectOnLogin' ) !== null ) {
+ $returnTo = $config->get( 'RedirectOnLogin' );
$returnToQuery = [];
} elseif ( is_string( $returnToQuery ) ) {
$returnToQuery = wfCgiToArray( $returnToQuery );
$returnToTitle = Title::newFromText( $returnTo ) ?: Title::newMainPage();
- if ( $wgSecureLogin && !$stickHTTPS ) {
+ if ( $config->get( 'SecureLogin' ) && !$stickHTTPS ) {
$options = [ 'http' ];
$proto = PROTO_HTTP;
- } elseif ( $wgSecureLogin ) {
+ } elseif ( $config->get( 'SecureLogin' ) ) {
$options = [ 'https' ];
$proto = PROTO_HTTPS;
} else {