[limb-svn] r6326 - 3.x/trunk/limb/macro/src

svn at limb-project.com svn at limb-project.com
Thu Sep 20 22:59:19 MSD 2007


Author: pachanga
Date: 2007-09-20 22:59:19 +0400 (Thu, 20 Sep 2007)
New Revision: 6326
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6326

Modified:
   3.x/trunk/limb/macro/src/lmbMacroCompiler.class.php
   3.x/trunk/limb/macro/src/lmbMacroTemplate.class.php
Log:
-- code refactoring, adding  as a third optional argument for lmbMacroTemplate

Modified: 3.x/trunk/limb/macro/src/lmbMacroCompiler.class.php
===================================================================
--- 3.x/trunk/limb/macro/src/lmbMacroCompiler.class.php	2007-09-20 18:10:01 UTC (rev 6325)
+++ 3.x/trunk/limb/macro/src/lmbMacroCompiler.class.php	2007-09-20 18:59:19 UTC (rev 6326)
@@ -42,8 +42,8 @@
 
   function __construct($tag_dictionary, $template_locator)
   {
+    $this->tag_dictionary = $tag_dictionary;
     $this->template_locator = $template_locator;
-    $this->tag_dictionary = lmbMacroTagDictionary :: instance();
     $this->tree_builder = new lmbMacroTreeBuilder($this);
   }
 

Modified: 3.x/trunk/limb/macro/src/lmbMacroTemplate.class.php
===================================================================
--- 3.x/trunk/limb/macro/src/lmbMacroTemplate.class.php	2007-09-20 18:10:01 UTC (rev 6325)
+++ 3.x/trunk/limb/macro/src/lmbMacroTemplate.class.php	2007-09-20 18:59:19 UTC (rev 6326)
@@ -23,8 +23,9 @@
   protected $cache_dir;
   protected $vars = array();
   protected $child_executor;
+  protected $tag_dictionary;
 
-  function __construct($file, $cache_dir = null, $locator = null)
+  function __construct($file, $cache_dir = null, $locator = null, $tag_dictionary = null)
   {
     $this->file = $file;
 
@@ -35,6 +36,10 @@
     if(!$locator)
       $locator = new lmbMacroTemplateLocator();
     $this->locator = $locator;
+
+    if(!$tag_dictionary)
+      $tag_dictionary = lmbMacroTagDictionary :: instance();
+    $this->tag_dictionary = $tag_dictionary;
   }
 
   function setVars($vars)
@@ -80,9 +85,7 @@
 
   protected function _createCompiler()
   {
-    $tag_dictionary = lmbMacroTagDictionary :: instance();
-    $compiler = new lmbMacroCompiler($tag_dictionary, $this->locator);
-    return $compiler;
+    return new lmbMacroCompiler($this->tag_dictionary, $this->locator);
   }
 }
 



More information about the limb-svn mailing list