Nucleus Support Forum Index

Find on the forum:
any terms  all terms  Advanced Search

RSS 2.0
Browse posts: Unanswered | Mark all read

« »
Loading Nucleus FAQ ticker...
Post new topic Reply to topic
Author Message
matt_t_hat
Nucleus Geek


Joined: 21 Aug 2005
Posts: 1124
Location: UK

Post Posted: Fri Aug 19, 2011 12:49 am   Post subject: CONF debug
Reply with quote

I've come upon a rather odd bit of code in the globalfunctions.php file:

Code:
$CONF['debug'] = 0;
if ($CONF['debug']) {
    error_reporting(E_ALL); // report all errors!
} else {
    ini_set('display_errors','0');
    error_reporting(E_ERROR | E_WARNING | E_PARSE);
}


Surely setting a var and then testing it right away is a bit redundant?

_________________
Host Plugins | Blog | Hundred Quid A Day | My Big Fat Arse

Back to top

View user's profile Send private message Visit poster's website
ftruscot
Nucleus Guru
Nucleus Guru


Joined: 22 Feb 2006
Posts: 7449
Location: Massachusetts

Post Posted: Fri Aug 19, 2011 1:36 pm   Post subject:
Reply with quote

I think the intention is that if you want to set debug to on, you change just that first line in your snippet and no other coding is needed. The conditional is already in place.
_________________
Is your question not solved yet?
Search our FAQ,
read the Documentation, or
browse the list of available plugins.

Check out my plugins

Back to top

View user's profile Send private message Visit poster's website
matt_t_hat
Nucleus Geek


Joined: 21 Aug 2005
Posts: 1124
Location: UK

Post Posted: Sat Aug 20, 2011 9:24 am   Post subject:
Reply with quote

ftruscot wrote:
I think the intention is that if you want to set debug to on, you change just that first line in your snippet and no other coding is needed. The conditional is already in place.


In which case this would make more sense to me.

Code:
if ( ! isset($CONF['debug']) || $CONF['debug'] == '' || $CONF['debug'] = null){
   $CONF['debug'] =false;
}
if ($CONF['debug']) {
    ini_set('display_errors',1); // PHP5 has this off by default
    error_reporting(E_ALL); // report all errors!
} else {
    ini_set('display_errors',0);
    error_reporting(E_ERROR | E_WARNING | E_PARSE);
}

_________________
Host Plugins | Blog | Hundred Quid A Day | My Big Fat Arse

Back to top

View user's profile Send private message Visit poster's website
Post new topic Reply to topic
Display posts from previous:   

Page 1 of 1

All times are GMT + 1 Hour

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2002 phpBB Group