Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Error Reporting Helper
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods Completed

2019-11-24 14:50:05
Taken from github
Heres a tool for logging errors, in testing i used to use this to assist
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);


This can make it look bad TT has loads of errors caused by undefined vars, indexs etc and the above code should never be used on a live site anyway.

So here is a way to log these to a file on live site, if members use this please can you share any fixed errors

in backend/functions find
require_once(BACKEND."/languages.php");


add below
// DEBUG Error Report
const TT_ERRORS_FILE = 'errors/unknown-errors.txt';
require_once(BACKEND."/errors-helper.php");
set_error_handler('tt_error_handler');


Add error folder to root & make unknown error txt to cmod 777
Add error helper to backend folder
error.reporting.zip
Download
Unknown User
2019-11-24 15:05:20
2019-11-24 15:37:34
its maybe best to add this to config so it can be turned on & off,

Wrap function
// DEBUG Error Report
if ($site_config['SETDEBUG']){
const TT_ERRORS_FILE = 'errors/unknown-errors.txt';
require_once(BACKEND."/errors-helper.php");
set_error_handler('tt_error_handler');
}


in config
$site_config['SETDEBUG'] = true;
2019-11-29 16:51:25
"m-jay, post: 67564, member: 20288":

its maybe best to add this to config so it can be turned on & off,

Wrap function
// DEBUG Error Report
if ($site_config['SETDEBUG']){
const TT_ERRORS_FILE = 'errors/unknown-errors.txt';
require_once(BACKEND."/errors-helper.php");
set_error_handler('tt_error_handler');
}


in config
$site_config['SETDEBUG'] = true;



By adding like this I get white pages and http 500 error.

Adding it without the wrapper, works ok.

Has it been tested?
If It Ain't Dutch, It Ain't Much!!
Unknown User
2019-11-30 16:36:49
try with
if ($site_config['SETDEBUG'] === true) {
...
}
2019-12-06 15:45:39
"shadows, post: 67586, member: 20311":

try with
if ($site_config['SETDEBUG'] === true) {
...
}


No luck, white page again.
If It Ain't Dutch, It Ain't Much!!
Unknown User
2019-12-06 16:07:44
"Propaganda, post: 67631, member: 60":

No luck, white page again.

It's your side issue either php / the general code structure.
2019-12-06 16:11:04
Maybe it is, maybe it isn't ;-)

Attaching the functions.php file, no funny things in there...
functions.rar
Download

If It Ain't Dutch, It Ain't Much!!
2019-12-06 16:12:52
Ahhh...maybe I did not read correctly
The only change is in the config.php file....right?

Or should this still be added to the functions.php file?

// DEBUG Error Report
if ($site_config['SETDEBUG']){
const TT_ERRORS_FILE = 'errors/unknown-errors.txt';
require_once(BACKEND."/errors-helper.php");
set_error_handler('tt_error_handler');
}
If It Ain't Dutch, It Ain't Much!!
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 5
  • Members: 0
  • Guests online: 5
  • Comments: 3
  • Messages: 1,728