HRDIODB
[ class tree: HRDIODB ] [ index: HRDIODB ] [ all elements ]

Source for file debugging.php

Documentation is available at debugging.php

  1. <?php
  2. /**
  3.  * Debugging functions.
  4.  * Common debugging functions
  5.  * @package HRDIODB
  6.  */
  7.  
  8. /**
  9.  * This file is part of HRDIODB.
  10.  *
  11.  * HRDIODB is free software; you can redistribute it and/or modify
  12.  * it under the terms of the GNU General Public License as published by
  13.  * the Free Software Foundation; either version 2 of the License, or
  14.  * (at your option) any later version.
  15.  *
  16.  * HRDIODB is distributed in the hope that it will be useful,
  17.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19.  * GNU General Public License for more details.
  20.  *
  21.  * You should have received a copy of the GNU General Public License
  22.  * along with HRDIODB; if not, write to the Free Software
  23.  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  24.  */
  25.  
  26. /** Common class */
  27. require_once("common_class.php");
  28.  
  29. /**
  30.  * Debugging print.
  31.  * Prints out (dumps) the contents of a variable.
  32.  * @param mixed $var The variable to dump
  33.  */
  34. function dump($var){
  35.   print "<center><div id=dump><pre>";
  36.   print_r($var);
  37.   print "</pre></div></center>";
  38. }
  39.  
  40. /**
  41.  * Print an error.
  42.  * Prints an error message. The message format depends on the mode in which the
  43.  * function is called (online or offline) It returns FALSE so that it can be
  44.  * used in a return statement.
  45.  * @param string $string Error string
  46.  * @return FALSE 
  47.  */
  48. function error($string){
  49.   $offline common::offline();
  50.  
  51.   if ($offline{
  52.     print "ERROR$string\n\n";
  53.   else {
  54.     print "<center><table id=\"error\"><tr><td>$string</td></tr></table></center>";
  55.   }
  56.  
  57.   return FALSE;
  58. }
  59.  
  60. function inline_error($string){
  61.     $_SESSION['error'$string;
  62.     return false;
  63. }
  64. ?>

Documentation generated on Tue, 23 Jan 2007 22:57:46 -0500 by phpDocumentor 1.3.0RC6