Page 1 of 1
Speed version of function debug_buffer
Posted: Mon Jun 09, 2008 8:24 am
by pb
This function has 80 references in the source (written in misc.functions.php).
Original:
Code: Select all
function debug_buffer($var, $title="")
{
global $gCms;
if ($gCms)
{
$config =& $gCms->GetConfig();
//debug_to_log($var, $title='');
if($config["debug"] == true)
{
$gCms->errors[] = debug_display($var, $title, false, true);
}
}
}
Speed version:
Code: Select all
function debug_buffer($var, $title="")
{
global $config,$gCms;
if($config['debug']==true && $gCms)
$gCms->errors[] = debug_display($var, $title, false, true);
}
Re: Speed version of function debug_buffer
Posted: Mon Jun 09, 2008 12:59 pm
by calguy1000
You can't rely on $config being global it isn't supposed to be, and that bug could be fixed at any time.
Re: Speed version of function debug_buffer
Posted: Mon Jun 09, 2008 1:04 pm
by pb
Wow ! See your Filemanager
function GetActionIcon($action) {
global $config;
and 19 occurrences in several source files.
Re: Speed version of function debug_buffer
Posted: Mon Jun 09, 2008 1:05 pm
by calguy1000
Yes, and I've already told that author to fix those.
Re: Speed version of function debug_buffer
Posted: Mon Jun 09, 2008 1:10 pm
by pb
Yes, and I've already told that author to fix those.
Ok more than 10 are in the core, greetings to ted.
There is nothing to fix it works since some years.
Re: Speed version of function debug_buffer
Posted: Mon Jun 09, 2008 4:24 pm
by Pierre M.
Free code reviews, quality improvements suggestions, open programming policy... I like free software
Pierre M.
Re: Speed version of function debug_buffer
Posted: Mon Jun 09, 2008 4:38 pm
by pb
From a dev a expected something more as
it isn't supposed to be
it is no problem to write this - the result is the same:
Code: Select all
function debug_buffer($var, $title="")
{
global $gCms;
if($gCms && $gCms->config['debug']== true)
$gCms->errors[] = debug_display($var, $title, false, true);
}
If someone is writing some code this setting is the best to use:
debug_buffer('__FILE__.' '.__LINE__.' '.__FUNCTION__);
and you have the complete file, the line number and the function (if is).
Re: Speed version of function debug_buffer
Posted: Tue Jun 10, 2008 12:06 pm
by thoms
I don't quite understand your attitude.
What do you intend posting good ideas, but refuse to put it in the forge? If you are such a good programmer (obviously you have some skills), what's the problem in looking and posting at the svn (a standard for nearly all open source software)?
What's the point of bashing the dev team? To show that you are so much smarter?
Your contribution to CMSms surely would be very welcome - but there are some rules.
If you don't like the rules, why don't you play at another place?
thoms
Re: Speed version of function debug_buffer
Posted: Tue Jun 10, 2008 1:27 pm
by calguy1000
We identified this guy as somebody we banned before. He's had problems with other websites too, like the AdodbLite and smarty forums. He's just generally anti-social and doesn't play well with others.
I banned him again.