[geeklog-cvs] geeklog: Speed up template class. Patch provided by mystralkk (P...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun May 1 16:29:11 EDT 2011


changeset 8267:1648b5a5b226
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/1648b5a5b226
user: Tom <websitemaster at cogeco.net>
date: Sun May 01 16:28:20 2011 -0400
description:
Speed up template class. Patch provided by mystralkk (Patch# 1302)

diffstat:

 system/classes/template.class.php |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 4026bef5ae24 -r 1648b5a5b226 system/classes/template.class.php
--- a/system/classes/template.class.php	Sat Apr 30 16:47:42 2011 +0200
+++ b/system/classes/template.class.php	Sun May 01 16:28:20 2011 -0400
@@ -367,12 +367,12 @@
 
     $str = $this->get_var($parent);
     $reg = "/[ \t]*<!--\s+BEGIN $varname\s+-->\s*?\n?(\s*.*?\n?)\s*<!--\s+END $varname\s+-->\s*?\n?/sm";
-    $matches = preg_match_all($reg, $str, $m);
+    $matches = preg_match($reg, $str, $m);
     if (($matches === false) || ($matches == 0)) {
         return false;
     }
-    $str = str_replace($m[0][0], '{' . $name . '}', $str);
-    $this->set_var($varname, $m[1][0]);
+    $str = str_replace($m[0], '{' . $name . '}', $str);
+    $this->set_var($varname, $m[1]);
     $this->set_var($parent, $str);
     return true;
   }
@@ -1011,7 +1011,7 @@
   function set_root($A) {
     $this->root = Array();
 	foreach ($A as $r) {
-	  if (path_exists($r)) {
+	  if (is_dir($r)) {
 	    $this->root[] = $r;
 	  }
 	}



More information about the geeklog-cvs mailing list