$wgTitleInterwikiCache = array();
define ( 'GAID_FOR_UPDATE', 1 );
+# Title::newFromTitle maintains a cache to avoid
+# expensive re-normalization of commonly used titles.
+# On a batch operation this can become a memory leak
+# if not bounded. After hitting this many titles,
+# reset the cache.
+define( 'MW_TITLECACHE_MAX', 1000 );
+
/**
* Title class
* - Represents a title, which may contain an interwiki designation or namespace
if( $t->secureAndSplit() ) {
if( $defaultNamespace == 0 ) {
+ if( count( $titleCache ) >= MW_TITLECACHE_MAX ) {
+ # Avoid memory leaks on mass operations...
+ $titleCache = array();
+ }
$titleCache[$text] =& $t;
}
wfProfileOut( $fname );
$text = $wgArticle->getContent( true );
$wgLinkCache = new LinkCache;
$wgLinkCache->forUpdate( true );
+
+ global $wgLinkHolders;
+ $wgLinkHolders = array(
+ 'namespaces' => array(),
+ 'dbkeys' => array(),
+ 'queries' => array(),
+ 'texts' => array(),
+ 'titles' => array()
+ );
+
# Parse the text and replace links with placeholders
$wgOut->addWikiText( $text );