Paths: System messages are cached in RAM now
authorDan
Wed, 13 May 2009 09:47:59 -0400
changeset 974 6bfe9eb428e9
parent 973 451141c834fe
child 975 bff25c6113ae
Paths: System messages are cached in RAM now
includes/paths.php
--- a/includes/paths.php	Wed May 13 09:47:31 2009 -0400
+++ b/includes/paths.php	Wed May 13 09:47:59 2009 -0400
@@ -435,6 +435,10 @@
   function sysmsg($n)
   {
     global $db, $session, $paths, $template, $plugins; // Common objects
+    static $sm_cache = array();
+    
+    if ( isset($sm_cache[$n]) )
+      return $sm_cache[$n];
     
     // sometimes this gets called during die_semicritical()...
     if ( !is_object($db) )
@@ -460,6 +464,8 @@
     $message = preg_replace('/<noinclude>(.*?)<\/noinclude>/is', '', $message);
     $message = preg_replace('/<nodisplay>(.*?)<\/nodisplay>/is', '\\1', $message);
     
+    $sm_cache[$n] = $message;
+    
     return $message;
   }
   function get_pageid_from_url()