*/
public $mDefaultNamespace = NS_MAIN;
- /**
- * @var bool Is $wgUser watching this page? null if unfilled, accessed
- * through userIsWatching()
- */
- protected $mWatched = null;
-
/** @var int The page length, 0 for special pages */
protected $mLength = -1;
* @param string $title The DB key form the title
* @param string $fragment The link fragment (after the "#")
* @param string $interwiki The interwiki prefix
- * @param bool $canoncialNamespace If true, use the canonical name for
+ * @param bool $canonicalNamespace If true, use the canonical name for
* $ns instead of the localized version.
* @return string The prefixed form of the title
*/
public static function makeName( $ns, $title, $fragment = '', $interwiki = '',
- $canoncialNamespace = false
+ $canonicalNamespace = false
) {
global $wgContLang;
- if ( $canoncialNamespace ) {
+ if ( $canonicalNamespace ) {
$namespace = MWNamespace::getCanonicalName( $ns );
} else {
$namespace = $wgContLang->getNsText( $ns );
return $s;
}
- /**
- * Is $wgUser watching this page?
- *
- * @deprecated since 1.20; use User::isWatched() instead.
- * @return bool
- */
- public function userIsWatching() {
- global $wgUser;
-
- if ( is_null( $this->mWatched ) ) {
- if ( NS_SPECIAL == $this->mNamespace || !$wgUser->isLoggedIn() ) {
- $this->mWatched = false;
- } else {
- $this->mWatched = $wgUser->isWatched( $this );
- }
- }
- return $this->mWatched;
- }
-
/**
* Can $user perform $action on this page?
* This skips potentially expensive cascading permission checks
return;
}
- $method = __METHOD__;
- $dbw = wfGetDB( DB_MASTER );
- $dbw->onTransactionIdle( function () use ( $dbw, $method ) {
- $dbw->delete(
- 'page_restrictions',
- array( 'pr_expiry < ' . $dbw->addQuotes( $dbw->timestamp() ) ),
- $method
- );
- $dbw->delete(
- 'protected_titles',
- array( 'pt_expiry < ' . $dbw->addQuotes( $dbw->timestamp() ) ),
- $method
- );
- } );
+ DeferredUpdates::addUpdate( new AtomicSectionUpdate(
+ wfGetDB( DB_MASTER ),
+ __METHOD__,
+ function ( IDatabase $dbw, $fname ) {
+ $dbw->delete(
+ 'page_restrictions',
+ array( 'pr_expiry < ' . $dbw->addQuotes( $dbw->timestamp() ) ),
+ $fname
+ );
+ $dbw->delete(
+ 'protected_titles',
+ array( 'pt_expiry < ' . $dbw->addQuotes( $dbw->timestamp() ) ),
+ $fname
+ );
+ }
+ ) );
}
/**
if ( $pageLang->hasVariants() ) {
$variants = $pageLang->getVariants();
foreach ( $variants as $vCode ) {
- $urls[] = $this->getInternalURL( '', $vCode );
+ $urls[] = $this->getInternalURL( $vCode );
}
}
// Checking $wgLanguageCode hasn't changed for the benefit of unit
// tests.
$contentHandler = ContentHandler::getForTitle( $this );
- $langObj = wfGetLangObj( $contentHandler->getPageLanguage( $this ) );
+ $langObj = $contentHandler->getPageLanguage( $this );
$this->mPageLanguage = array( $langObj->getCode(), $wgLanguageCode );
} else {
$langObj = wfGetLangObj( $this->mPageLanguage[0] );