* @private
*/
function replace_callback ($text, $callbacks) {
+ wfProfileIn( __METHOD__ . '-self' );
$openingBraceStack = array(); # this array will hold a stack of parentheses which are not closed yet
$lastOpeningBrace = -1; # last not closed parentheses
'lineStart' => (($pieceStart > 0) && ($text[$pieceStart-1] == "\n")),
);
# finally we can call a user callback and replace piece of text
+ wfProfileOut( __METHOD__ . '-self' );
$replaceWith = call_user_func( $matchingCallback, $cbArgs );
+ wfProfileIn( __METHOD__ . '-self' );
$text = substr($text, 0, $pieceStart) . $replaceWith . substr($text, $pieceEnd);
$i = $pieceStart + strlen($replaceWith) - 1;
}
}
}
+ wfProfileOut( __METHOD__ . '-self' );
return $text;
}
# Load from database
$lastPathLevel = $this->mTemplatePath;
if ( !$found ) {
+ wfProfileIn( __METHOD__ . '-loadtpl' );
$ns = NS_TEMPLATE;
# declaring $subpage directly in the function call
# does not work correctly with references and breaks
$text = $linestart . $text;
}
}
+ wfProfileOut( __METHOD__ . '-loadtpl' );
}
# Recursive parsing, escaping and link table handling
wfProfileOut( $fname );
return $piece['text'];
} else {
+ wfProfileIn( __METHOD__ . '-placeholders' );
if ( $isHTML ) {
# Replace raw HTML by a placeholder
# Add a blank line preceding, to prevent it from mucking up
}
}
}
+ wfProfileOut( __METHOD__ . '-placeholders' );
}
# Prune lower levels off the recursion check path