<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -47,7 +47,7 @@ class H2o {
         ), $options);
     }
     
-    function __construct($file = false, $options = array()) {
+    function __construct($file = null, $options = array()) {
         # Init a environment
         $this-&gt;options = $this-&gt;getOptions($options);        
         $loader = $this-&gt;options['loader'];
@@ -62,25 +62,24 @@ class H2o {
             $loader = &quot;H2o_{$loader}_Loader&quot;;
             if (!class_exists($loader))
                 throw new Exception('Invalid template loader');
-            
-            # Best effort to guess searchpath
+                
             if (isset($options['searchpath']))
                 $this-&gt;searchpath = realpath($options['searchpath']).DS;
             elseif ($file)
                 $this-&gt;searchpath = dirname(realpath($file)).DS;
             else
                 $this-&gt;searchpath = getcwd().DS;
+
             $this-&gt;loader = new $loader($this-&gt;searchpath, $this-&gt;options);        
         }
         
-        #i18n
         if (isset($options['i18n'])) {
             h2o::load('i18n');
             $this-&gt;i18n = new H2o_I18n($this-&gt;searchpath, $options['i18n']);
         }
-        
+    
         if ($file) {
-          $this-&gt;nodelist = $this-&gt;loadTemplate($file);
+            $this-&gt;nodelist = $this-&gt;loadTemplate($file);
         }
         
         $this-&gt;loader-&gt;runtime = $this;</diff>
      <filename>h2o.php</filename>
    </modified>
    <modified>
      <diff>@@ -14,11 +14,18 @@ class Describe_file_loader extends SimpleSpec {
         
         $h2o = h2o('templates/emails/base.html');
         expects($h2o-&gt;nodelist)-&gt;should_be_a('Nodelist');
-        
+
+    }
+    
+    function should_be_able_to_load_template_lazily() {
         $h2o = new H2o('a.html', array('searchpath' =&gt; 'templates'));
         expects($h2o-&gt;render())-&gt;should_not_be_empty();
+        
+        $h2o = new H2o(null, array('searchpath' =&gt; 'templates'));
+        $h2o-&gt;loadTemplate('b.html');
+        expects($h2o-&gt;render())-&gt;should_not_be_empty();
     }
-
+    
     function should_read_from_alternitive_working_path() {
         $h2o = h2o('emails/base.html', array(
             'searchpath' =&gt; dirname(__FILE__).DS.'templates'</diff>
      <filename>spec/loader_spec.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f00e0cde2241aca7f0d9a58e4759f619bda6cbac</id>
    </parent>
  </parents>
  <author>
    <name>speedmax</name>
    <email>subjective@gmail.com</email>
  </author>
  <url>http://github.com/speedmax/h2o-php/commit/fad2cbced9b71ccf8b3e2a02bf8632cb88744c51</url>
  <id>fad2cbced9b71ccf8b3e2a02bf8632cb88744c51</id>
  <committed-date>2009-05-19T04:49:40-07:00</committed-date>
  <authored-date>2009-05-19T04:49:40-07:00</authored-date>
  <message> - Fixed failing tests</message>
  <tree>523e18c26585fe2ecabef34616526131ba1b9b3b</tree>
  <committer>
    <name>speedmax</name>
    <email>subjective@gmail.com</email>
  </committer>
</commit>
