<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.gitignore</filename>
    </added>
    <added>
      <filename>data/cache/.gitplaceholder</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -33,7 +33,6 @@
 * $Id: Templation.class.php,v 1.5 2005/09/05 20:43:25 dasil003 Exp $
 */
 
-require_once &quot;PEAR.php&quot;;
 require_once &quot;Templation_Widget.class.php&quot;;
 
 // Values for mode_vector of the parseTemplate function.
@@ -67,7 +66,7 @@ define(&quot;TEMPLATION_NOT_ENOUGH_INCLUDES&quot;,       -1001);
 define(&quot;TEMPLATION_WIDGET_NOTICE&quot;,             -1002);
 
 
-class Templation extends PEAR
+class Templation
 {
     /** If a critical error occurs, this should be set to true.
     * @access private
@@ -112,11 +111,6 @@ class Templation extends PEAR
     var $template_dirs = array();
     var $action_dirs = array();
 
-    /*** ERROR HANDLING ***/
-    var $errors = array();          //Array of PEAR errors that occurred during processing (if mode contains PEAR_ERROR_RETURN).
-    var $error_log = '';            //Full path filename to a Templation error log.
-    var $error_function = '';       //A callback function for Templation errors, should follow the PHP pseudo-type format for a function or class method.
-    
     /*** AUXILIARY VARIABLES not used by Templation directly (recommended for widget use) ***/
     var $index_filenames = array('index.php','index.html'); //Useful information when it comes to link recognition.
     
@@ -128,10 +122,6 @@ class Templation extends PEAR
     **/
     function Templation($tpl_dir = '', $file_path = '')
     {
-        /*** PEAR Constructor ***/
-        $this-&gt;PEAR();
-        
-        
         /*** SET UP GLOBAL SETTINGS ***/
         if($tpl_dir == '') {
             $p = strrpos(__FILE__,'/');
@@ -159,11 +149,6 @@ class Templation extends PEAR
         if($this-&gt;tpl_dir_local &amp;&amp; is_file($this-&gt;tpl_dir_local.'/settings.php')) include_once($this-&gt;tpl_dir_local.'/settings.php');
         
         
-        /*** SET UP ERROR HANDLING ***/
-        if(!empty($this-&gt;error_function)) $this-&gt;setErrorHandling(PEAR_ERROR_CALLBACK, $this-&gt;error_function);
-        else $this-&gt;setErrorHandling(PEAR_ERROR_PRINT, &quot;&lt;p&gt;&lt;strong&gt;Templation Error:&lt;/strong&gt; %s&lt;/p&gt;&quot;);
-        
-        
         /*** DEFAULT PAGE ***/
         if($file_path == '') {
             if($this-&gt;src_filename) $file_path = $_SERVER[$this-&gt;src_filename];
@@ -176,17 +161,17 @@ class Templation extends PEAR
         
         /*** ERROR CHECKING ***/
         if(!is_dir($this-&gt;tpl_dir)) {
-            $this-&gt;errors[] = $this-&gt;raiseError(&quot;Initialization error: The specified data repository '&lt;code&gt;{$this-&gt;tpl_dir}&lt;/code&gt;' is not a directory.&quot;, TEMPLATION_BAD_SETTING);
+            throw new Exception(&quot;Initialization error: The specified data repository '&lt;code&gt;{$this-&gt;tpl_dir}&lt;/code&gt;' is not a directory.&quot;, TEMPLATION_BAD_SETTING);
             $this-&gt;invalid = true;
             return;
         }
         
         if(!is_dir($this-&gt;root)) {
-            $this-&gt;errors[] = $this-&gt;raiseError(&quot;Initialization error: The specified site root '&lt;code&gt;{$this-&gt;root}&lt;/code&gt;' is not a directory.&quot;, TEMPLATION_BAD_SETTING);
+            throw new Exception(&quot;Initialization error: The specified site root '&lt;code&gt;{$this-&gt;root}&lt;/code&gt;' is not a directory.&quot;, TEMPLATION_BAD_SETTING);
             $this-&gt;invalid = true;
             return;
         } elseif(!is_file($file_path)) {
-            $this-&gt;errors[] = $this-&gt;raiseError(&quot;Initialization error: The specified file '&lt;code&gt;{$file_path}&lt;/code&gt;'&quot;.($file_path_autodetected ? &quot; (auto-detected from URL)&quot; : '').&quot; is not a file.&quot;, TEMPLATION_BAD_SETTING);
+            throw new Exception(&quot;Initialization error: The specified file '&lt;code&gt;{$file_path}&lt;/code&gt;'&quot;.($file_path_autodetected ? &quot; (auto-detected from URL)&quot; : '').&quot; is not a file.&quot;, TEMPLATION_BAD_SETTING);
             $this-&gt;invalid = true;
             return;
         }
@@ -201,7 +186,7 @@ class Templation extends PEAR
         &amp;&amp; Templation_File::isTemplationFile($this-&gt;pages[$page_num]) ) {
             return $this-&gt;pages[$page_num]-&gt;outputFile();
         } else {
-            $this-&gt;errors[] = $this-&gt;raiseError(&quot;output(): Requested page doesn't exist&quot;, TEMPLATION_INVALID_FILE_OBJECT);
+            throw new Exception(&quot;output(): Requested page doesn't exist&quot;, TEMPLATION_INVALID_FILE_OBJECT);
             return false;
         }
     }
@@ -284,7 +269,7 @@ class Templation extends PEAR
         }
         
         if (!isset($widget_path)) {
-            $this-&gt;errors[] = $this-&gt;raiseError(&quot;_processWidget(): Widget '$widget' does not exist&quot;, TEMPLATION_WIDGET_NOT_FOUND);
+            throw new Exception(&quot;_processWidget(): Widget '$widget' does not exist&quot;, TEMPLATION_WIDGET_NOT_FOUND);
         } else {
             if(!isset($this-&gt;widgets[$widget])) {
                 $this-&gt;widgets[$widget] = new Templation_Widget($widget_path, $argv, $data, $src_page);
@@ -692,9 +677,9 @@ class Templation_File
         }
 
         if (!isset($template_filename)) {
-            $this-&gt;tpl-&gt;errors[] = $this-&gt;tpl-&gt;raiseError(&quot;_readTemplate(): Unsuccessful finding '$filename'&quot;, TEMPLATION_TEMPLATE_NOT_FOUND, null, null, serialize($userinfo));
+            throw new Exception(&quot;_readTemplate(): Unsuccessful finding '$filename'&quot;, TEMPLATION_TEMPLATE_NOT_FOUND);
         } else if ( ($fp = fopen($template_filename, 'r')) === false) {
-            $this-&gt;tpl-&gt;errors[] = $this-&gt;tpl-&gt;raiseError(&quot;_readTemplate(): Unsuccessful opening '$filename'&quot;, TEMPLATION_TEMPLATE_UNOPENABLE, null, null, serialize($userinfo));
+            throw new Exception(&quot;_readTemplate(): Unsuccessful opening '$filename'&quot;, TEMPLATION_TEMPLATE_UNOPENABLE);
         } else {
             $this-&gt;addDependency($template_filename);
             $template = fread($fp, filesize($template_filename));
@@ -717,7 +702,7 @@ class Templation_File
                 foreach($this-&gt;tpl-&gt;action_dirs as $path) {
                     if(is_file($path.'/'.$a)) $action_path = $path.'/'.$a;
                 }
-                if(!$action_path) $this-&gt;tpl-&gt;errors[] = $this-&gt;tpl-&gt;raiseError(&quot;_runActions(): Action '$a' not found.&quot;, TEMPLATION_ACTION_NOT_FOUND);
+                if(!$action_path) throw new Exception(&quot;_runActions(): Action '$a' not found.&quot;, TEMPLATION_ACTION_NOT_FOUND);
                 else include($action_path);
             }
         }</diff>
      <filename>Templation.class.php</filename>
    </modified>
    <modified>
      <diff>@@ -65,9 +65,9 @@ class Templation_Widget {
         $tpl =&amp; $this-&gt;src_page-&gt;tpl;
         
         if (!is_file($file)) {
-            $tpl-&gt;errors[] = $tpl-&gt;raiseError(&quot;getInclude(): Include file '$file' is not valid&quot;, TEMPLATION_INCLUDE_NOT_FOUND);
+            throw new Exception(&quot;getInclude(): Include file '$file' is not valid&quot;, TEMPLATION_INCLUDE_NOT_FOUND);
         } else if (!$fp = fopen($file, 'r')) {
-            $tpl-&gt;errors[] = $tpl-&gt;raiseError(&quot;getInclude(): Error opening '$file'&quot;, TEMPLATION_INCLUDE_UNOPENABLE);
+            throw new Exception(&quot;getInclude(): Error opening '$file'&quot;, TEMPLATION_INCLUDE_UNOPENABLE);
         } else {
             $this-&gt;src_page-&gt;addDependency($file);
             return fread($fp, filesize($file));
@@ -87,14 +87,14 @@ class Templation_Widget {
         $paths = array();
         
         if (!isset($dir)) {
-			$dir = $tpl-&gt;root . substr($_SERVER['SCRIPT_NAME'],0,strrpos($_SERVER['SCRIPT_NAME'],'/'));
-		}
-	
-	    if (substr($dir,0,strlen($tpl-&gt;root)) != $tpl-&gt;root) {
-	        $tpl-&gt;errors[] = $tpl-&gt;raiseError(&quot;findIncludes(): The directory '$dir' is not within the site root&quot;, TEMPLATION_INVALID_PATH);
-	        return false;
-	    }
-	    
+            $dir = $tpl-&gt;root . substr($_SERVER['SCRIPT_NAME'],0,strrpos($_SERVER['SCRIPT_NAME'],'/'));
+        }
+        
+        if (substr($dir,0,strlen($tpl-&gt;root)) != $tpl-&gt;root) {
+            throw new Exception(&quot;findIncludes(): The directory '$dir' is not within the site root&quot;, TEMPLATION_INVALID_PATH);
+            return false;
+        }
+        
         $path = $dir.'/'.$tpl-&gt;includes_dir.'/'.$file;
          if(is_file($path)) {
              $paths[] = $path;
@@ -123,7 +123,7 @@ class Templation_Widget {
         }
         
         /*if($num &gt; 0) {
-            $tpl-&gt;errors[] = $tpl-&gt;raiseError(&quot;findIncludes(): Less than the requested number of includes were returned&quot;, TEMPLATION_NOT_ENOUGH_INCLUDES);
+            throw new Exception(&quot;findIncludes(): Less than the requested number of includes were returned&quot;, TEMPLATION_NOT_ENOUGH_INCLUDES);
         }*/
         
         foreach($paths as $p) {
@@ -162,10 +162,6 @@ class Templation_Widget {
         return $this-&gt;statics[$key];
     }
     
-    function raiseError($msg, $code = TEMPLATION_WIDGET_WARNING) {
-        $this-&gt;src_page-&gt;tpl-&gt;errors[] = $this-&gt;src_page-&gt;tpl-&gt;raiseError('Widget '.$this-&gt;widget.': '.$msg,$code);
-    }
-    
     
     /**
     * Reinitializes the widget with new arguments, data and source page so that</diff>
      <filename>Templation_Widget.class.php</filename>
    </modified>
    <modified>
      <diff>@@ -40,15 +40,6 @@ The Templation class lists a number of variables that can be modified globally o
 	&lt;dt&gt;&lt;code&gt;pages&lt;/code&gt;&lt;/dt&gt;
 		&lt;dd&gt;Array of Templation_File objects.  By default there is only one element in this array, and it holds the constructed page.  However, Templation reserves the right to build multiple pages at once.  This functionality serves little purpose except to aid in the building of admin tools.  If you want to use this variable you should first become very familiar with Templation's main code base.&lt;/dd&gt;
 
-	&lt;dt&gt;&lt;code&gt;errors&lt;/code&gt;&lt;/dt&gt;
-		&lt;dd&gt;Array of PEAR errors that occurred during processing (if mode contains PEAR_ERROR_RETURN).  Usually it's easier to create a custom handler function for errors or just have them printed out.  However, it may occasionally be useful to have a big list of errors at your fingertips if you are writing code that might make use of them.&lt;/dd&gt;
-
-	&lt;dt&gt;&lt;code&gt;error_log&lt;/code&gt;&lt;/dt&gt;
-		&lt;dd&gt;Full path filename to a Templation error log.&lt;/dd&gt;
-
-	&lt;dt&gt;&lt;code&gt;error_function&lt;/code&gt;&lt;/dt&gt;
-		&lt;dd&gt;A callback function for Templation errors, should follow the PHP pseudo-type format for a function or class method.&lt;/dd&gt;
-
 	&lt;dt&gt;&lt;code&gt;index_filenames&lt;/code&gt;&lt;/dt&gt;
 		&lt;dd&gt;Useful information when it comes to link recognition.  Not used by the templation core, but commonly needed by widgets for such things as recognizing links to the current page etc.&lt;/dd&gt;
 &lt;/dl&gt;</diff>
      <filename>docs/settings.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>49cb038e4e746bb9c9cc75cb184f7c751a986b64</id>
    </parent>
  </parents>
  <author>
    <name>Gabe da Silveira</name>
    <email>gabe@websaviour.com</email>
  </author>
  <url>http://github.com/dasil003/templation/commit/1aa31f7c963961299164d53140d89ce995958bfa</url>
  <id>1aa31f7c963961299164d53140d89ce995958bfa</id>
  <committed-date>2009-05-06T14:37:44-07:00</committed-date>
  <authored-date>2009-05-06T14:29:00-07:00</authored-date>
  <message>Remove PEAR dependency in favor of PHP 5 Exceptions.  Yes PHP 5 is now required bitches.</message>
  <tree>a40f9935ecf1019f576a2b500746b6217a3b2b30</tree>
  <committer>
    <name>Gabe da Silveira</name>
    <email>gabe@websaviour.com</email>
  </committer>
</commit>
