const EDITSECTION_REGEX = '#<(?:mw:)?editsection page="(.*?)" section="(.*?)"(?:/>|>(.*?)(</(?:mw:)?editsection>))#';
function __construct( $text = '', $languageLinks = array(), $categoryLinks = array(),
- $containsOldMagic = false, $titletext = '' )
- {
+ $containsOldMagic = false, $titletext = ''
+ ) {
$this->mText = $text;
$this->mLanguageLinks = $languageLinks;
$this->mCategories = $categoryLinks;
* @throws MWException if given invalid input
*/
function addInterwikiLink( $title ) {
- $prefix = $title->getInterwiki();
- if ( $prefix == '' ) {
+ if ( !$title->isExternal() ) {
throw new MWException( 'Non-interwiki link passed, internal parser error.' );
}
+ $prefix = $title->getInterwiki();
if ( !isset( $this->mInterwikiLinks[$prefix] ) ) {
$this->mInterwikiLinks[$prefix] = array();
}
}
/**
- * Callback passed by the Parser to the ParserOptions to keep track of which options are used.
- * @access private
+ * Tags a parser option for use in the cache key for this parser output.
+ * Registered as a watcher at ParserOptions::registerWatcher() by Parser::clearState().
+ *
+ * @see ParserCache::getKey
+ * @see ParserCache::save
+ * @see ParserOptions::addExtraKey
+ * @see ParserOptions::optionsHash
*/
- function recordOption( $option ) {
+ public function recordOption( $option ) {
$this->mAccessedOptions[$option] = true;
}