Source for file Util.class.php

Documentation is available at Util.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 Utility
  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.  * Utility Class
  22.  *
  23.  * @category Gumbo
  24.  * @package Utility
  25.  * @copyright Copyright (c) 2007, iBayou, Michael Luster
  26.  * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
  27.  * @author Michael Luster <mluster79@yahoo.com>
  28.  * @link http://sourceforge.net/projects/phpgumbo
  29.  * @desc Utility Class
  30.  * @version 0.0.1
  31.  */
  32.  
  33. class Gumbo_Util {
  34.     
  35.     /**
  36.      * Outputs a test of a particular entity
  37.      * @param mixed $value 
  38.      * @param boolean $stop indicates if the program should stop execution
  39.      */
  40.     public static function test ($value$stop=false{
  41.         try {
  42.             // verify precondition
  43.             if (!is_bool ($stop)) {
  44.                 throw new Gumbo_Exception ("Invalid Argument 'stop:bool' => {$stop}:gettype ($stop));
  45.             }
  46.         catch (Gumbo_Exception $e{
  47.             $e->setFunction (__METHOD__);
  48.             gumbo_trigger ($e);
  49.             $stop false;
  50.         }
  51.         
  52.         echo "<pre>\n";
  53.         print_r ($value);
  54.         echo "</pre>";
  55.         
  56.         if ($stopexit ()}
  57.     }
  58.     
  59. }
  60.  
  61. ?>