* @return MagicWord
*/
static function &get( $id ) {
- wfProfileIn( __METHOD__ );
if ( !isset( self::$mObjects[$id] ) ) {
$mw = new MagicWord();
$mw->load( $id );
self::$mObjects[$id] = $mw;
}
- wfProfileOut( __METHOD__ );
return self::$mObjects[$id];
}
*/
function load( $id ) {
global $wgContLang;
+ wfProfileIn( __METHOD__ );
$this->mId = $id;
$wgContLang->getMagic( $this );
if ( !$this->mSynonyms ) {
#throw new MWException( "Error: invalid magic word '$id'" );
wfDebugLog( 'exception', "Error: invalid magic word '$id'\n" );
}
+ wfProfileOut( __METHOD__ );
}
/**
'[^][<>"\\x00-\\x20\\x7F]+) *([^\]\\x00-\\x08\\x0a-\\x1F]*?)\]/S';
if ( isset( $conf['preprocessorClass'] ) ) {
$this->mPreprocessorClass = $conf['preprocessorClass'];
+ } elseif ( defined( 'MW_COMPILED' ) ) {
+ # Preprocessor_Hash is much faster than Preprocessor_DOM in compiled mode
+ $this->mPreprocessorClass = 'Preprocessor_Hash';
} elseif ( extension_loaded( 'domxml' ) ) {
# PECL extension that conflicts with the core DOM extension (bug 13770)
wfDebug( "Warning: you have the obsolete domxml extension for PHP. Please remove it!\n" );
} else {
$this->mPreprocessorClass = 'Preprocessor_Hash';
}
+ wfDebug( __CLASS__ . ": using preprocessor: {$this->mPreprocessorClass}\n" );
}
/**