예제 #1
0
 /**
  * Store the error in db
  * @param $function, Function name where error occured
  * @param $image, Details of attachment
  * @param $exception, Details about error
  */
 function error($function, $image, $exception)
 {
     WpSmushitErrorRegistry::store($exception);
     $info = is_object($exception) && method_exists($exception, 'getMessage') ? $exception->getMessage() : $exception;
     //If image variable is an array, display the details per line, otherwise display it directly
     $image = is_array($image) ? implode("<br/>", $image) : $image;
     $this->_update_error_queue(array('date' => current_time('timestamp'), 'area' => $function, 'image' => $image, 'info' => $info));
 }
 public static function clear()
 {
     self::$_errors = array();
 }