File: MV_ParserCache.php

package info (click to toggle)
mediawiki-metavidwiki 0.2-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,864 kB
  • ctags: 2,647
  • sloc: php: 10,652; sql: 65; makefile: 34; xml: 34
file content (34 lines) | stat: -rw-r--r-- 891 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/*
 * MV_ParserCache.php Created on Feb 27, 2008
 *
 * All Metavid Wiki code is Released under the GPL2
 * for more info visit http:/metavid.ucsc.edu/code
 * 
 * @author Michael Dale
 * @email dale@ucsc.edu
 * @url http://metavid.ucsc.edu
 */
 //quick hack to shift namespace of inline metavid parse cache 
 //avoids conflicts of inline display with full article display
 class MV_ParserCache extends ParserCache{
 	var $extraKeyOpt='mv';
 	var $addToKey ='';
 	public static function & singleton() {
		static $instance;
		if ( !isset( $instance ) ) {
			global $parserMemc;
			$instance = new MV_ParserCache( $parserMemc );
		}
		//reset addToKey
		$instance->addToKey='';
		return $instance;
	} 	
	function addToKey($opt){
		$this->addToKey=$opt;
	}
 	function getKey( &$article, &$user ) { 	
 		return parent::getKey( $article, $user ).$this->extraKeyOpt.$this->addToKey;
 	}
 }
?>