Ejemplo n.º 1
0
 /**
  * @todo Thomas fais ton taf!!
  *
  * @param
  * @param
  * @return void 
  */
 public function error($e)
 {
     $this->has_error = true;
     self::has_error();
     $msg = [self::$line, 'Error in the page!', self::$line];
     $b = debug_backtrace();
     foreach ($b as $c) {
         if (isset($c['file'])) {
             array_push($msg, 'File ' . $c['file'] . ' - Line ' . $c['line']);
             array_push($msg, (isset($c['class']) ? '  Class ' . $c['class'] . ' - ' : '') . (isset($c['function']) ? '  Function ' . $c['function'] : ''));
         }
     }
     array_push($msg, self::$line);
     if (is_string($e)) {
         array_push($msg, 'Error message: ' . $e);
     } else {
         if (method_exists($e, "getMessage")) {
             array_push($msg, 'Error message: ' . $e->getMessage());
         }
     }
     array_push($msg, self::$line);
     array_push($msg, $this->last());
     array_push($msg, self::$line);
     if ($this->last_params['values']) {
         array_push($msg, self::$line);
         array_push($msg, 'Parameters');
         array_push($msg, self::$line);
         array_push($msg, \bbn\tools::get_dump($this->last_params['values']));
         array_push($msg, self::$line);
     }
     $this->log(implode(PHP_EOL, $msg));
     if ($this->on_error === self::E_DIE) {
         die(implode('<br>', $msg));
     }
 }