~chronoscz/wowpreklad/trunk

« back to all changes in this revision

Viewing changes to Packages/Common/Error.php

  • Committer: chronos
  • Date: 2020-04-07 20:15:48 UTC
  • Revision ID: svn-v4:e0d647b5-504f-4be4-8469-84ac22119850:trunk:880
* Modified: Improved code formatting.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
      1024 => 'User Notice'
45
45
    );
46
46
 
47
 
    if(($this->UserErrors & $Number))
 
47
    if (($this->UserErrors & $Number))
48
48
    {
49
49
      // Error was suppressed with the @-operator
50
 
      if(0 === error_reporting())
 
50
      if (0 === error_reporting())
51
51
      {
52
52
        return false;
53
53
      }
57
57
      $Backtrace[0]['file'] = $FileName;
58
58
      $Backtrace[0]['line'] = $LineNumber;
59
59
      $this->Report($Backtrace);
60
 
      //if((E_ERROR | E_PARSE) & $Number)
 
60
      //if ((E_ERROR | E_PARSE) & $Number)
61
61
      die();
62
62
    }
63
63
  }
81
81
      '<meta http-equiv="Content-Type" content="text/html; charset='.$this->Encoding.'"></head><body>'."\n".
82
82
      'An internal error occurred!<br/>'.
83
83
      '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)
85
85
      $Output .= '<pre>'.$Message.'</pre><br/>';
86
86
    $Output .= '</body></html>';
87
87
    echo($Output);
91
91
  {
92
92
    $Date = date('Y-m-d H:i:s');
93
93
    $Error = '# '.$Date."\n";
94
 
    foreach($Backtrace as $Item)
 
94
    foreach ($Backtrace as $Item)
95
95
    {
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'] = '';
98
98
 
99
99
      $Error .= ' '.$Item['file'].'('.$Item['line'].")\t".$Item['function'];
100
100
      $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)
103
103
        {
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)."',";
106
106
          else $Arguments .= "'".$Item."',";
107
107
        }
108
 
        if(strlen($Arguments) > 0) $Error .= '('.substr($Arguments, 0, -1).')';
 
108
        if (strlen($Arguments) > 0) $Error .= '('.substr($Arguments, 0, -1).')';
109
109
        $Error .= "\n";
110
110
    }
111
111
    $Error .= "\n";
112
112
 
113
 
    foreach($this->OnError as $OnError)
 
113
    foreach ($this->OnError as $OnError)
114
114
      call_user_func($OnError, $Error);
115
115
  }
116
116
}