Page MenuHomePhabricator
Authored By
bzimport
Nov 21 2014, 9:21 PM
Size
2 KB
Referenced Files
None
Subscribers
None
--- Parser.php Fri Jul 14 01:28:01 2006
+++ xParser.php Sat Jul 15 10:42:19 2006
@@ -117,9 +117,10 @@
# Temporary
# These are variables reset at least once per parse regardless of $clearState
var $mOptions, // ParserOptions object
- $mTitle, // Title context, used for self-link rendering and similar things
$mOutputType, // Output type, one of the OT_xxx constants
- $mRevisionId; // ID to display in {{REVISIONID}} tags
+ $mRevisionId, // ID to display in {{REVISIONID}} tags
+ $mRunTime, // constant time() used for parse
+ $mTitle; // Title context, used for self-link rendering and similar things
/**#@-*/
@@ -210,6 +211,7 @@
'titles' => array()
);
$this->mRevisionId = null;
+ $this->mRunTime = time();
/**
* Prefix for temporary replacement strings for the multipass parser.
@@ -231,6 +233,26 @@
}
/**
+ * Accessors for Temporary variables.
+ *
+ * @public
+ */
+ function getRunTime() { return $this->mRunTime; }
+ function &getTitle() { return $this->mTitle; }
+
+ /**
+ * Accessors for Temporary Options variables.
+ *
+ * @public
+ */
+ function getOptions() { return $this->mOptions; }
+
+ function getFunctionLang() {
+ global $wgLang, $wgContLang;
+ return $this->mOptions->getInterfaceMessage() ? $wgLang : $wgContLang;
+ }
+
+ /**
* Accessor for mUniqPrefix.
*
* @public
@@ -273,6 +295,7 @@
$this->mRevisionId = $revid;
}
$this->mOutputType = OT_HTML;
+ $this->mRunTime = time();
//$text = $this->strip( $text, $this->mStripState );
// VOODOO MAGIC FIX! Sometimes the above segfaults in PHP5.
@@ -368,14 +391,6 @@
return dechex(mt_rand(0, 0x7fffffff)) . dechex(mt_rand(0, 0x7fffffff));
}
- function &getTitle() { return $this->mTitle; }
- function getOptions() { return $this->mOptions; }
-
- function getFunctionLang() {
- global $wgLang, $wgContLang;
- return $this->mOptions->getInterfaceMessage() ? $wgLang : $wgContLang;
- }
-
/**
* Replaces all occurrences of HTML-style comments and the given tags
* in the text with a random marker and returns teh next text. The output
@@ -2213,7 +2228,7 @@
if ( isset( $varCache[$index] ) )
return $varCache[$index];
- $ts = time();
+ $ts = $this->$mRunTime();
wfRunHooks( 'ParserGetVariableValueTs', array( &$this, &$ts ) );
switch ( $index ) {

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2638
Default Alt Text
dP (2 KB)

Event Timeline