Guest User

Untitled

a guest
Nov 23rd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. <?php
  2. class CachedSandBoxParser extends SandBoxParser
  3. {
  4. protected
  5. $cache = array();
  6.  
  7. public function convertWikiText($wikiText, $wgTitle = ''){
  8. $key = sha1($wikiText . $wgTitle);
  9. if( ! array_key_exists($key, $this->cache)){
  10. $content = parent::convertWikiText($wikiText, $wgTitle);
  11. $this->cache[$key] = $content;
  12. }
  13. return $this->cache[$key];
  14. }
  15. }
Add Comment
Please, Sign In to add comment