Source for file Error.class.php

Documentation is available at Error.class.php

  1. <?php
  2. /**
  3.  * Gumbo Library Framework
  4.  *
  5.  * LICENSE
  6.  * This library is being released under the terms of the New BSD License.  A
  7.  * copy of the license is packaged with the software (LICENSE.txt).  If no
  8.  * copy is found, a copy of the license template can be found at:
  9.  * http://www.opensource.org/licenses/bsd-license.php
  10.  * 
  11.  * @category Gumbo
  12.  * @package Error
  13.  * @copyright Copyright (c) 2007, iBayou, Michael Luster
  14.  * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
  15.  * @author Michael Luster <mluster79@yahoo.com>
  16.  * @link http://sourceforge.net/projects/phpgumbo
  17.  * @version 0.0.1
  18.  */
  19.  
  20. /**
  21.  * Error Interface
  22.  * 
  23.  * The Error Interface is responsible for holding a lit of all the Errors
  24.  * thrown by the program.  This allows the program to have a central location
  25.  * for getting all the Errors that have occured.
  26.  * 
  27.  * The Report Level is the minimum level of Errors that will be reported.  All Errors
  28.  * will be saved, however only the Errors at or above the Report Level will be
  29.  * displayed.
  30.  * 
  31.  * The Ignore Level is the maximum level of Errors that will be ignored.  The idea
  32.  * is to have the Error handler ignore certain Errors thrown.  Any Errors at or
  33.  * below the ignore level should be thrown out.
  34.  *
  35.  * @category Gumbo
  36.  * @package Error
  37.  * @copyright Copyright (c) 2007, iBayou, Michael Luster
  38.  * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
  39.  * @author Michael Luster <mluster79@yahoo.com>
  40.  * @link http://sourceforge.net/projects/phpgumbo
  41.  * @desc Error Interface
  42.  * @version 0.0.1
  43.  */
  44.  
  45. interface Gumbo_Interface_Error {
  46.     
  47.     /** ACTION METHODS **/
  48.     /**
  49.      * Adds an Exception to the list
  50.      * @param Exception $e 
  51.      */
  52.     public function add (Exception $e);
  53.     
  54.     /**
  55.      * Clears all the errors from the system
  56.      * @param int $level level to clear
  57.      */
  58.     public function clear ($level=null);
  59.     
  60.     
  61.     
  62.     /** MUTATOR METHODS **/
  63.     /**
  64.      * Sets the minimum error reporting level (inclusive and above)
  65.      * @param int $level 
  66.      */
  67.     public function setReportLevel ($level);
  68.     
  69.     /**
  70.      * Sets the ignore level (inclusive and below)
  71.      * @param int $level 
  72.      */
  73.     public function setIgnoreLevel ($level);
  74.     
  75.     
  76.     
  77.     /** ACCESSOR METHODS **/
  78.     /**
  79.      * Returns all Errors
  80.      * @param int $level limit to supplied level and above
  81.      * @param bool $only limits to only errors at the supplied level
  82.      * @return Exception[] 
  83.      */
  84.     public function getAll ($level=null$only=false);
  85.     
  86.     /**
  87.      * Returns if any Errors exist
  88.      * @param int $level if errors of this level exist
  89.      * @return bool 
  90.      */
  91.     public function exists ($level=null);
  92.     
  93.     /**
  94.      * Returns the current error level value
  95.      * 
  96.      * The Error level will be a base 2 int representation of the
  97.      * available error level constants.  This will allow the system
  98.      * to determine the level of errors triggered during program
  99.      * execution.
  100.      * 
  101.      * @return int 
  102.      */
  103.     public function level ();
  104.     
  105.     /**
  106.      * Returns the number of errors
  107.      * @param int $level number of errors at level
  108.      * @return int 
  109.      */
  110.     public function count ($level=null);
  111.     
  112.     /**
  113.      * Returns the minimum reporting level
  114.      * @return int 
  115.      */
  116.     public function getReportLevel ();
  117.     
  118.     /**
  119.      * Returns the minimum ignore level
  120.      * @return int 
  121.      */
  122.     public function getIgnoreLevel ();
  123.     
  124. }
  125.  
  126. ?>