protected $mSquidMaxage = 0;
/**
- * @var bool
- * @todo Document
+ * @var bool Controls if anti-clickjacking / frame-breaking headers will
+ * be sent. This should be done for pages where edit actions are possible.
+ * Setters: $this->preventClickjacking() and $this->allowClickjacking().
*/
protected $mPreventClickjacking = true;
// bug 44570: the core page itself may not change, but resources might
$modifiedTimes['sepoch'] = wfTimestamp( TS_MW, time() - $config->get( 'SquidMaxage' ) );
}
- wfRunHooks( 'OutputPageCheckLastModified', array( &$modifiedTimes ) );
+ Hooks::run( 'OutputPageCheckLastModified', array( &$modifiedTimes ) );
$maxModified = max( $modifiedTimes );
$this->mLastModified = wfTimestamp( TS_RFC2822, $maxModified );
}
/**
- * Set the page as printable, i.e. it'll be displayed with with all
+ * Set the page as printable, i.e. it'll be displayed with all
* print styles included
*/
public function setPrintable() {
}
# Add the remaining categories to the skin
- if ( wfRunHooks(
+ if ( Hooks::run(
'OutputPageMakeCategoryLinks',
array( &$this, $categories, &$this->mCategoryLinks ) )
) {
* @param string $text
* @param bool $linestart Is this the start of a line?
* @param bool $interface Is this text in the user interface language?
+ * @throws MWException
*/
public function addWikiText( $text, $linestart = true, $interface = true ) {
$title = $this->getTitle(); // Work around E_STRICT
) {
global $wgParser;
- wfProfileIn( __METHOD__ );
-
$popts = $this->parserOptions();
$oldTidy = $popts->setTidy( $tidy );
$popts->setInterfaceMessage( (bool)$interface );
$this->addParserOutput( $parserOutput );
- wfProfileOut( __METHOD__ );
}
/**
// Link flags are ignored for now, but may in the future be
// used to mark individual language links.
$linkFlags = array();
- wfRunHooks( 'LanguageLinks', array( $this->getTitle(), &$this->mLanguageLinks, &$linkFlags ) );
- wfRunHooks( 'OutputPageParserOutput', array( &$this, $parserOutput ) );
+ Hooks::run( 'LanguageLinks', array( $this->getTitle(), &$this->mLanguageLinks, &$linkFlags ) );
+ Hooks::run( 'OutputPageParserOutput', array( &$this, $parserOutput ) );
}
/**
*/
public function addParserOutputText( $parserOutput ) {
$text = $parserOutput->getText();
- wfRunHooks( 'OutputPageBeforeHTML', array( &$this, &$text ) );
+ Hooks::run( 'OutputPageBeforeHTML', array( &$this, &$text ) );
$this->addHTML( $text );
}
),
$config->get( 'CacheVaryCookies' )
);
- wfRunHooks( 'GetCacheVaryCookies', array( $this, &$cookies ) );
+ Hooks::run( 'GetCacheVaryCookies', array( $this, &$cookies ) );
}
return $cookies;
}
return;
}
- wfProfileIn( __METHOD__ );
-
$response = $this->getRequest()->response();
$config = $this->getConfig();
$redirect = $this->mRedirect;
$code = $this->mRedirectCode;
- if ( wfRunHooks( "BeforePageRedirect", array( $this, &$redirect, &$code ) ) ) {
+ if ( Hooks::run( "BeforePageRedirect", array( $this, &$redirect, &$code ) ) ) {
if ( $code == '301' || $code == '303' ) {
if ( !$config->get( 'DebugRedirects' ) ) {
$message = HttpStatus::getMessage( $code );
}
}
- wfProfileOut( __METHOD__ );
return;
} elseif ( $this->mStatusCode ) {
$message = HttpStatus::getMessage( $this->mStatusCode );
// Hook that allows last minute changes to the output page, e.g.
// adding of CSS or Javascript by extensions.
- wfRunHooks( 'BeforePageDisplay', array( &$this, &$sk ) );
+ Hooks::run( 'BeforePageDisplay', array( &$this, &$sk ) );
- wfProfileIn( 'Output-skin' );
$sk->outputPage();
- wfProfileOut( 'Output-skin' );
}
// This hook allows last minute changes to final overall output by modifying output buffer
- wfRunHooks( 'AfterFinalPageOutput', array( $this ) );
+ Hooks::run( 'AfterFinalPageOutput', array( $this ) );
$this->sendCacheControl();
ob_end_flush();
- wfProfileOut( __METHOD__ );
}
/**
public function headElement( Skin $sk, $includeStyle = true ) {
global $wgContLang;
- $section = new ProfileSection( __METHOD__ );
-
$userdir = $this->getLanguage()->getDir();
$sitedir = $wgContLang->getDir();
// Allow skins and extensions to add body attributes they need
$sk->addToBodyAttributes( $this, $bodyAttrs );
- wfRunHooks( 'OutputPageBodyAttributes', array( $this, $sk, &$bodyAttrs ) );
+ Hooks::run( 'OutputPageBodyAttributes', array( $this, $sk, &$bodyAttrs ) );
$ret .= Html::openElement( 'body', $bodyAttrs ) . "\n";
* call rather than a "<script src='...'>" tag.
* @return string The html "<script>", "<link>" and "<style>" tags
*/
- protected function makeResourceLoaderLink( $modules, $only, $useESI = false,
+ public function makeResourceLoaderLink( $modules, $only, $useESI = false,
array $extraQuery = array(), $loadCall = false
) {
$modules = (array)$modules;
* have to be purged on configuration changes.
* @return array
*/
- private function getJSVars() {
+ public function getJSVars() {
global $wgContLang;
$curRevisionId = 0;
// Use the 'ResourceLoaderGetConfigVars' hook if the variable is not
// page-dependant but site-wide (without state).
// Alternatively, you may want to use OutputPage->addJsConfigVars() instead.
- wfRunHooks( 'MakeGlobalVariablesScript', array( &$vars, $this ) );
+ Hooks::run( 'MakeGlobalVariablesScript', array( &$vars, $this ) );
// Merge in variables from addJsConfigVars last
return array_merge( $vars, $this->getJsConfigVars() );