Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3068
dP
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 9:21 PM
2014-11-21 21:21:06 (UTC+0)
Size
2 KB
Referenced Files
None
Subscribers
None
dP
View Options
--- 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
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2638
Default Alt Text
dP (2 KB)
Attached To
Mode
T8692: time() and timestamps might become inconsistent during parsing
Attached
Detach File
Event Timeline
Log In to Comment