* @return string
*/
public function makeHolder( $nt, $text = '', $query = array(), $trail = '', $prefix = '' ) {
- wfProfileIn( __METHOD__ );
if ( !is_object( $nt ) ) {
# Fail gracefully
$retVal = "<!-- ERROR -->{$prefix}{$text}{$trail}";
}
$this->size++;
}
- wfProfileOut( __METHOD__ );
return $retVal;
}
* @param string $text
*/
public function replace( &$text ) {
- wfProfileIn( __METHOD__ );
$this->replaceInternal( $text );
$this->replaceInterwiki( $text );
- wfProfileOut( __METHOD__ );
-
}
/**
return;
}
- wfProfileIn( __METHOD__ );
global $wgContLang, $wgContentHandlerUseDB;
$colours = array();
$linkCache = LinkCache::singleton();
$output = $this->parent->getOutput();
- wfProfileIn( __METHOD__ . '-check' );
$dbr = wfGetDB( DB_SLAVE );
$threshold = $this->parent->getOptions()->getStubThreshold();
}
if ( count( $linkcolour_ids ) ) {
//pass an array of page_ids to an extension
- wfRunHooks( 'GetLinkColours', array( $linkcolour_ids, &$colours ) );
+ Hooks::run( 'GetLinkColours', array( $linkcolour_ids, &$colours ) );
}
- wfProfileOut( __METHOD__ . '-check' );
# Do a second query for different language variants of links and categories
if ( $wgContLang->hasVariants() ) {
}
# Construct search and replace arrays
- wfProfileIn( __METHOD__ . '-construct' );
$replacePairs = array();
foreach ( $this->internals as $ns => $entries ) {
foreach ( $entries as $index => $entry ) {
}
}
$replacer = new HashtableReplacer( $replacePairs, 1 );
- wfProfileOut( __METHOD__ . '-construct' );
# Do the thing
- wfProfileIn( __METHOD__ . '-replace' );
$text = preg_replace_callback(
'/(<!--LINK .*?-->)/',
$replacer->cb(),
$text
);
- wfProfileOut( __METHOD__ . '-replace' );
- wfProfileOut( __METHOD__ );
}
/**
return;
}
- wfProfileIn( __METHOD__ );
# Make interwiki link HTML
$output = $this->parent->getOutput();
$replacePairs = array();
'/<!--IWLINK (.*?)-->/',
$replacer->cb(),
$text );
- wfProfileOut( __METHOD__ );
}
/**
}
}
}
- wfRunHooks( 'GetLinkColours', array( $linkcolour_ids, &$colours ) );
+ Hooks::run( 'GetLinkColours', array( $linkcolour_ids, &$colours ) );
// rebuild the categories in original order (if there are replacements)
if ( count( $varCategories ) > 0 ) {
* @return string
*/
public function replaceText( $text ) {
- wfProfileIn( __METHOD__ );
$text = preg_replace_callback(
'/<!--(LINK|IWLINK) (.*?)-->/',
array( &$this, 'replaceTextCallback' ),
$text );
- wfProfileOut( __METHOD__ );
return $text;
}