[TYPO3-core] RFC: 0008112: Adding dontShowDebugOutput Option to INSTALL TOOL using in t3lib_div debug functions
Sebastian Böttger
sebastian.boettger at gmail.com
Sun Apr 13 12:12:24 CEST 2008
Hi Oliver,
no, not the debug functions. They just prints out without check.
I also thought this would be the behaviour, but that's not working like
this.
I also was thinking about handling this as a bug, but I guess that many
developers would be confused if we now let depending the output on
devIPmask.
Wile developing you call the debug functions by:
t3lib_div::debug($myvar); or t3lib_div::debug('I entered function xy now.');
Example old version:
/**
* Makes debug output
* Prints $var in bold between two vertical lines
* If not $var the word 'debug' is printed
* If $var is an array, the array is printed by t3lib_div::print_array()
* Usage: 8
*
* @param mixed Variable to print
* @param mixed If the parameter is a string it will be
used as header. Otherwise number of break tags to apply after (positive
integer) or before (negative integer) the output.
* @return void
*/
public static function debug($var='',$brOrHeader=0) {
// buffer the output of debug if no buffering started before
if (ob_get_level()==0) {
ob_start();
}
if ($brOrHeader && !t3lib_div::testInt($brOrHeader)) {
echo '<table class="typo3-debug" border="0" cellpadding="0"
cellspacing="0" bgcolor="white" style="border:0px; margin-top:3px;
margin-bottom:3px;"><tr><td style="background-color:#bbbbbb;
font-family: verdana,arial; font-weight: bold; font-size:
10px;">'.htmlspecialchars((string)$brOrHeader).'</td></tr><tr><td>';
} elseif ($brOrHeader<0) {
for($a=0;$a<abs(intval($brOrHeader));$a++){echo '<br />';}
}
if (is_array($var)) {
t3lib_div::print_array($var);
} elseif (is_object($var)) {
echo '<b>|Object:<pre>';
print_r($var);
echo '</pre>|</b>';
} elseif ((string)$var!='') {
echo '<b>|'.htmlspecialchars((string)$var).'|</b>';
} else {
echo '<b>| debug |</b>';
}
if ($brOrHeader && !t3lib_div::testInt($brOrHeader)) {
echo '</td></tr></table>';
} elseif ($brOrHeader>0) {
for($a=0;$a<intval($brOrHeader);$a++){echo '<br />';}
}
}
Sebastian
Oliver Klee schrieb:
> Hi,
>
> Sebastian Böttger schrieb:
>
>> Problem:
>> While developing extension you use t3lib_div::debug* functions for
>> showing output in the frontend. If you miss to delete one debug function
>> after developing, it could happen that debug output shows up LIVE.
>>
>> That's why, in my opinion, we should offer to disable all debug
>> functions in the INSTALL TOOL.
>>
>
> Isn't this already handled by devIPmask IIRC?
>
>
> Oliver
> _______________________________________________
> Before posting to this list, please have a look to the posting rules
> on the following websites:
>
> http://typo3.org/teams/core/core-mailinglist-rules/
> http://typo3.org/development/bug-fixing/diff-and-patch/
> _______________________________________________
> TYPO3-team-core mailing list
> TYPO3-team-core at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-team-core
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20080413/d0127a77/attachment.htm
More information about the TYPO3-team-core
mailing list