Index: trunk/phase3/includes/parser/ParserOptions.php |
— | — | @@ -38,6 +38,7 @@ |
39 | 39 | var $mIsSectionPreview; # Parsing the page for a "preview" operation on a single section |
40 | 40 | var $mIsPrintable; # Parsing the printable version of the page |
41 | 41 | |
| 42 | + var $mExtraKey = ''; # Extra key that should be present in the caching key. |
42 | 43 | |
43 | 44 | protected $accessedOptions; |
44 | 45 | |
— | — | @@ -133,6 +134,13 @@ |
134 | 135 | function setIsSectionPreview( $x ) { return wfSetVar( $this->mIsSectionPreview, $x ); } |
135 | 136 | function setIsPrintable( $x ) { return wfSetVar( $this->mIsPrintable, $x ); } |
136 | 137 | |
| 138 | + /** |
| 139 | + * Extra key that should be present in the parser cache key. |
| 140 | + */ |
| 141 | + function addExtraKey( $key ) { |
| 142 | + $this->mExtraKey .= '!' . $key; |
| 143 | + } |
| 144 | + |
137 | 145 | function __construct( $user = null ) { |
138 | 146 | $this->initialiseFromUser( $user ); |
139 | 147 | } |
— | — | @@ -299,6 +307,9 @@ |
300 | 308 | if ( $this->mIsPrintable && in_array( 'printable', $forOptions ) ) |
301 | 309 | $confstr .= '!printable=1'; |
302 | 310 | |
| 311 | + if ( $this->mExtraKey != '' ) |
| 312 | + $confstr .= $this->mExtraKey; |
| 313 | + |
303 | 314 | // Give a chance for extensions to modify the hash, if they have |
304 | 315 | // extra options or other effects on the parser cache. |
305 | 316 | wfRunHooks( 'PageRenderingHash', array( &$confstr ) ); |