function preSaveTransform( $text, &$title, &$user, $options, $clearState = true )
{
$this->mOptions = $options;
- $this->mTitle = $title;
+ $this->mTitle =& $title;
$this->mOutputType = OT_WIKI;
if ( $clearState ) {
return $text;
}
-
+ # Set up some variables which are usually set up in parse()
+ # so that an external function can call some class members with confidence
+ function startExternalParse( &$title, $options, $outputType, $clearState = true )
+ {
+ $this->mTitle =& $title;
+ $this->mOptions = $options;
+ $this->mOutputType = $outputType;
+ if ( $clearState ) {
+ $this->clearState();
+ }
+ }
}
class ParserOutput
function isBot()
{
$this->loadFromDatabase();
- if ( 0 == $this->mId ) { return false; }
+
+ # Why was this here? I need a UID=0 conversion script [TS]
+ # if ( 0 == $this->mId ) { return false; }
return in_array( "bot", $this->mRights );
}
return $allowed;
}
-
-
+ # Set mDataLoaded, return previous value
+ # Use this to prevent DB access in command-line scripts or similar situations
+ function setLoaded( $loaded )
+ {
+ wfSetVar( $this->mDataLoaded, $loaded );
+ }
}
?>