Esempio n. 1
0
 /**
  * Returns an Error Queue instance.
  *
  * @return Zym_Error_Stack
  */
 public static function getInstance()
 {
     // Create an instance if one does not exist
     if (self::$_instance === null) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Esempio n. 2
0
 /**
  * PHP Error handler
  *
  * @param integer $code
  * @param string $message
  * @param string $file
  * @param integer $line
  * @param array $context
  */
 public static function handle($code, $message, $file = null, $line = null, array $context = array())
 {
     /**
      * @see Zym_Error
      */
     require_once 'Zym/Error.php';
     // Create error object
     $error = new Zym_Error($code, $message, $file, $line, $context);
     /**
      * @see Zym_Error_Stack
      */
     require_once 'Zym/Error/Stack.php';
     // Store error
     Zym_Error_Stack::getInstance()->push($error);
 }
Esempio n. 3
0
 /**
  * PHP Error handler
  *
  * @param integer $code
  * @param string $message
  * @param string $file
  * @param integer $line
  * @param array $context
  * @return boolean
  */
 public static function handle($code, $message, $file = null, $line = null, array $context = array())
 {
     // Skip suppressed errors @
     if (error_reporting() == 0) {
         return false;
     }
     /**
      * @see Zym_Error
      */
     require_once 'Zym/Error.php';
     // Create error object
     $trace = debug_backtrace();
     $error = new Zym_Error($code, $message, $file, $line, $context, $trace);
     /**
      * @see Zym_Error_Stack
      */
     require_once 'Zym/Error/Stack.php';
     // Store error
     Zym_Error_Stack::getInstance()->push($error);
     return true;
 }