| 180 | | // always log errors |
|---|
| 181 | | @ini_set('log_errors', '1'); |
|---|
| 182 | | @ini_set('error_log', $CFG->dataroot . 'errors.log'); |
|---|
| 183 | | // hide error of screen, handled by error handler function |
|---|
| 184 | | @ini_set('display_errors', '0'); |
|---|
| 185 | | // handle errors |
|---|
| 186 | | set_error_handler('elgg_error_handler'); |
|---|
| | 180 | // if not debug log errors |
|---|
| | 181 | // else if enabled show raw errors on screen |
|---|
| | 182 | if ($CFG->debug < 2047) { |
|---|
| | 183 | // always log errors |
|---|
| | 184 | @ini_set('log_errors', '1'); |
|---|
| | 185 | @ini_set('error_log', $CFG->dataroot . 'errors.log'); |
|---|
| | 186 | // hide error of screen, handled by error handler function |
|---|
| | 187 | @ini_set('display_errors', '0'); |
|---|
| | 188 | // handle errors |
|---|
| | 189 | //TODO: work on better error handler |
|---|
| | 190 | set_error_handler('elgg_error_handler'); |
|---|
| | 191 | } else { |
|---|
| | 192 | //force display errors on screen |
|---|
| | 193 | @ini_set('display_errors', '1'); |
|---|
| | 194 | @ini_set('display_startup_errors', '1'); // maybe not good idea... |
|---|
| | 195 | error_reporting($CFG->debug); |
|---|
| | 196 | } |
|---|