home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / Common.php < prev    next >
Encoding:
PHP Script  |  2004-03-24  |  1.2 KB  |  52 lines

  1. <?php
  2. //
  3. //  $Id: Common.php,v 1.1 2003/06/09 19:48:19 quipo Exp $
  4. //
  5.  
  6. require_once 'MDB/QueryTool.php';
  7.  
  8. // so we have all errors saved in one place
  9. // its just due to the strange error handling i implemented here ... gotta change that some day
  10. $_Common_Errors = array();
  11.  
  12. class tests_Common extends MDB_QueryTool
  13. {
  14.     var $tableSpec = array(
  15.                        array('name'      => TABLE_QUESTION,
  16.                              'shortName' => TABLE_QUESTION),
  17.                        array('name'      => TABLE_ANSWER,
  18.                              'shortName' => TABLE_ANSWER)
  19.                      );
  20.  
  21.     function tests_Common($table=null)
  22.     {
  23.         if ($table != null) {
  24.             $this->table = $table;
  25.         }
  26.         parent::MDB_QueryTool(DB_DSN);
  27.         $this->setErrorSetCallback(array(&$this,'errorSet'));
  28.         $this->setErrorLogCallback(array(&$this,'errorLog'));
  29.     }
  30.  
  31.     //
  32.     //  just for the error handling
  33.     //
  34.  
  35.     function errorSet($msg)
  36.     {
  37.         $GLOBALS['_Common_Errors'][] = array('set', $msg);
  38.     }
  39.  
  40.     function errorLog($msg)
  41.     {
  42.         $GLOBALS['_Common_Errors'][] = array('log', $msg);
  43.     }
  44.  
  45.     function getErrors()
  46.     {
  47.         return $GLOBALS['_Common_Errors'];
  48.     }
  49.  
  50. }
  51.  
  52. ?>