Exemplo n.º 1
0
 /**
  * Lazy loading of PEAR, and the error handler..
  * This should load HTML_Template_Flexy_Error really..
  * 
  * @param   string message
  * @param   int      error type.
  * @param   int      an equivalant to pear error return|die etc.
  *
  * @return   object      pear error.
  * @access   public
  */
 function raiseError($message, $type = null, $fatal = HTML_TEMPLATE_FLEXY_ERROR_RETURN)
 {
     HTML_Template_Flexy::debug("<B>HTML_Template_Flexy::raiseError</B>{$message}");
     require_once 'PEAR.php';
     if (HTML_Template_Flexy_is_a($this, 'HTML_Template_Flexy') && $fatal == HTML_TEMPLATE_FLEXY_ERROR_DIE) {
         // rewrite DIE!
         return PEAR::raiseError($message, $type, $this->options['fatalError']);
     }
     if (isset($GLOBALS['_HTML_TEMPLATE_FLEXY']['fatalError']) && $fatal == HTML_TEMPLATE_FLEXY_ERROR_DIE) {
         return PEAR::raiseError($message, $type, $GLOBALS['_HTML_TEMPLATE_FLEXY']['fatalError']);
     }
     return PEAR::raiseError($message, $type, $fatal);
 }
Exemplo n.º 2
0
Arquivo: Flexy.php Projeto: roojs/pear
 /**
  * static version of raiseError 
  * @see HTML_Template_Flexy::raiseError
  * 
  * @param   string message
  * @param   int      error type.
  * @param   int      an equivalant to pear error return|die etc.
  *
  * @return   object      pear error.
  * @static
  * @access   public
  */
 static function staticRaiseError($message, $type = null, $fatal = HTML_TEMPLATE_FLEXY_ERROR_RETURN)
 {
     HTML_Template_Flexy::debug("<B>HTML_Template_Flexy::raiseError</B>{$message}");
     require_once 'PEAR.php';
     if (isset($GLOBALS['_HTML_TEMPLATE_FLEXY']['fatalError']) && $fatal == HTML_TEMPLATE_FLEXY_ERROR_DIE) {
         $p = new PEAR();
         return $p->raiseError($message, $type, $GLOBALS['_HTML_TEMPLATE_FLEXY']['fatalError']);
     }
     $p = new PEAR();
     return $p->raiseError($message, $type, $fatal);
 }