Ignore:
Timestamp:
Apr 7, 2020, 12:55:39 AM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved code formatting.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/Error.php

    r37 r55  
    4545    );
    4646
    47     if(($this->UserErrors & $Number))
     47    if (($this->UserErrors & $Number))
    4848    {
    4949      // Error was suppressed with the @-operator
    50       if(0 === error_reporting())
     50      if (0 === error_reporting())
    5151      {
    5252        return false;
     
    5858      $Backtrace[0]['line'] = $LineNumber;
    5959      $this->Report($Backtrace);
    60       //if((E_ERROR | E_PARSE) & $Number)
     60      //if ((E_ERROR | E_PARSE) & $Number)
    6161      die();
    6262    }
     
    8282      'An internal error occurred!<br/>'.
    8383      'Administrator will be notified and the problem will be investigated and fixed soon.'.'<br/><br/>';
    84     if($this->ShowError == true)
     84    if ($this->ShowError == true)
    8585      $Output .= '<pre>'.$Message.'</pre><br/>';
    8686    $Output .= '</body></html>';
     
    9292    $Date = date('Y-m-d H:i:s');
    9393    $Error = '# '.$Date."\n";
    94     foreach($Backtrace as $Item)
     94    foreach ($Backtrace as $Item)
    9595    {
    96       if(!array_key_exists('line', $Item)) $Item['line'] = '';
    97       if(!array_key_exists('file', $Item)) $Item['file'] = '';
     96      if (!array_key_exists('line', $Item)) $Item['line'] = '';
     97      if (!array_key_exists('file', $Item)) $Item['file'] = '';
    9898
    9999      $Error .= ' '.$Item['file'].'('.$Item['line'].")\t".$Item['function'];
    100100      $Arguments = '';
    101       if(array_key_exists('args', $Item) and is_array($Item['args']))
    102         foreach($Item['args'] as $Item)
     101      if (array_key_exists('args', $Item) and is_array($Item['args']))
     102        foreach ($Item['args'] as $Item)
    103103        {
    104           if(is_object($Item)) ;
    105           else if(is_array($Item)) $Arguments .= "'".serialize($Item)."',";
     104          if (is_object($Item)) ;
     105          else if (is_array($Item)) $Arguments .= "'".serialize($Item)."',";
    106106          else $Arguments .= "'".$Item."',";
    107107        }
    108         if(strlen($Arguments) > 0) $Error .= '('.substr($Arguments, 0, -1).')';
     108        if (strlen($Arguments) > 0) $Error .= '('.substr($Arguments, 0, -1).')';
    109109        $Error .= "\n";
    110110    }
    111111    $Error .= "\n";
    112112
    113     foreach($this->OnError as $OnError)
     113    foreach ($this->OnError as $OnError)
    114114      call_user_func($OnError, $Error);
    115115  }
Note: See TracChangeset for help on using the changeset viewer.