Ignore:
Timestamp:
Apr 7, 2020, 11:53:58 AM (4 years ago)
Author:
chronos
Message:
  • Modified: Improved code formatting.
File:
1 edited

Legend:

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

    r77 r92  
    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>';
     
    9393    $Date = date('Y-m-d H:i:s');
    9494    $Error = '# '.$Date."\n";
    95     foreach($Backtrace as $Item)
     95    foreach ($Backtrace as $Item)
    9696    {
    97       if(!array_key_exists('line', $Item)) $Item['line'] = '';
    98       if(!array_key_exists('file', $Item)) $Item['file'] = '';
     97      if (!array_key_exists('line', $Item)) $Item['line'] = '';
     98      if (!array_key_exists('file', $Item)) $Item['file'] = '';
    9999
    100100      $Error .= ' '.$Item['file'].'('.$Item['line'].")\t".$Item['function'];
    101101      $Arguments = '';
    102       if(array_key_exists('args', $Item) and is_array($Item['args']))
    103         foreach($Item['args'] as $Item)
     102      if (array_key_exists('args', $Item) and is_array($Item['args']))
     103        foreach ($Item['args'] as $Item)
    104104        {
    105           if(is_object($Item)) ;
    106           else if(is_array($Item)) $Arguments .= "'".serialize($Item)."',";
     105          if (is_object($Item)) ;
     106          else if (is_array($Item)) $Arguments .= "'".serialize($Item)."',";
    107107          else $Arguments .= "'".$Item."',";
    108108        }
    109         if(strlen($Arguments) > 0) $Error .= '('.substr($Arguments, 0, -1).')';
     109        if (strlen($Arguments) > 0) $Error .= '('.substr($Arguments, 0, -1).')';
    110110        $Error .= "\n";
    111111    }
    112112    $Error .= "\n";
    113113
    114     foreach($this->OnError as $OnError)
     114    foreach ($this->OnError as $OnError)
    115115      call_user_func($OnError, $Error);
    116116  }
Note: See TracChangeset for help on using the changeset viewer.