Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

JErrorHandler.class.php

Go to the documentation of this file.
00001 <?php
00006 include_once("core/system/JBaseObject.class.php");
00007 
00012 class JErrorHandler extends JBaseObject
00013 {
00014         var $errorstack;        
00015         
00019         function JErrorHandler()
00020         {
00021                 $this->errorstack = array();
00022         }
00023         
00028         function &GetInstance()
00029         {
00030                 static $ob;
00031                 
00032                 if (!isset ($ob))
00033                 {
00034                         $ob = new JErrorHandler();
00035                 }
00036                 
00037                 return $ob;
00038         }
00039         
00045         function IsError($error)
00046         {
00047                 if (get_class($error) == "jerror" || is_subclass_of($error, "jerror"))
00048                         $result = true;
00049                 else
00050                 {
00051                         if (is_subclass_of($error, "jbaseobject"))
00052                                 $result = $error->GetBaseErrorConstructor();
00053                 }
00054                 
00055                 return $result;
00056         }       
00057         
00063         function PushError($error)
00064         {
00065                 $this->errorstack[0] = $error;
00066                 
00067                 return $error;
00068         }
00069         
00074         function HasErrors()
00075         {
00076                 return (count($this->errorstack) > 0);
00077         }
00078         
00083         function PopError()
00084         {
00085                 return array_pop($this->errorstack);
00086         }
00087 }
00088 ?>

Generated on Wed Nov 19 20:29:35 2003 for James by doxygen 1.3.4