[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 16:45:09 CEST 2008


Hi Steffen

Well, I guess that's not the point.
I agree with you, that a dev should take care of his debugs and maybe 
there shouldn't be any debugs at publishing time. But we have a TER 
where everyone (good AND bad DEVs) can upload his/her extension. How do 
you take care of these missed debugs?
As a matter of fact, if a "no-dev" would install such a buggy extension, 
he will think that the error comes from TYPO3 (because the error could 
just appear only in special cases).

It is a fallback - not a requirement, and also, it's not that bad having 
the possibility to leave the debugs in code, and switch them on in need.
What is the problem with debugs, which are giving the dev the opinion to 
get a quick overview of variable stati at specific point?
(That only with the devIPmask as default opinion, not with the param I 
added.)

What else the devIPmask is for?

vg Sebastian

Steffen Kamper schrieb:
> Hi,
>  
> i don't see need for this. Dev's have to take care about that. if an 
> extension is published, there shouldn't be any debug message. If 
> someone uses debugs on a live system he has to take care to remove them.
>  
> If we have such function, devs will leave their debugs in code.
>  
> vg Steffen
>  
> btw - could you disable HTML-mail here? It's hard to read.
>
>     "Sebastian Böttger" <sebastian.boettger at gmail.com
>     <mailto:sebastian.boettger at gmail.com>> schrieb im Newsbeitrag
>     news:mailman.5830.1208077027.3430.typo3-team-core at lists.netfielders.de...
>     This is an SVN patch request:
>
>     Type: feature
>
>     BT reference: http://bugs.typo3.org/view.php?id=8112
>
>     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.
>
>     Solution:
>     Thats why I created a diff which makes this possible. It adds the
>     option
>
>     dontShowDebugOutput to the SYS section of the INSTALL TOOL and
>     checks in the debug functions of t3lib_div wether this option is
>     set or not. The default is FALSE because of backwards compatibility.
>
>     Thx for testing.
>
>     Sebastian
>
>     ------------------------------------------------------------------------
>     Index: t3lib/class.t3lib_div.php
>     ===================================================================
>     --- t3lib/class.t3lib_div.php (revision 3557)
>     +++ t3lib/class.t3lib_div.php (working copy)
>     @@ -3019,6 +3019,7 @@
>       * @internal
>       */
>       public static function debug_ordvalue($string,$characters=100) {
>     + if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['dontShowDebugOutput'])
>     return '';
>       if(strlen($string) < $characters) $characters = strlen($string);
>       for ($i=0; $i<$characters; $i++) {
>       $valuestring.=' '.ord(substr($string,$i,1));
>     @@ -3102,7 +3103,8 @@
>       * @return void
>       */
>       public static function debug($var='',$brOrHeader=0) {
>     - // buffer the output of debug if no buffering started before
>     + if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['dontShowDebugOutput'])
>     return '';
>     + // buffer the output of debug if no buffering started before
>       if (ob_get_level()==0) {
>       ob_start();
>       }
>     @@ -3138,6 +3140,7 @@
>       * @return string
>       */
>       public static function debug_trail() {
>     + if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['dontShowDebugOutput'])
>     return '';
>       $trail = debug_backtrace();
>       $trail = array_reverse($trail);
>       array_pop($trail);
>     @@ -3159,6 +3162,7 @@
>       * @return void Outputs to browser.
>       */
>       public static function
>     debugRows($rows,$header='',$returnHTML=FALSE) {
>     + if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['dontShowDebugOutput'])
>     return '';
>       if (is_array($rows)) {
>       reset($rows);
>       $firstEl = current($rows);
>      
>     Index: t3lib/config_default.php
>     ===================================================================
>     --- t3lib/config_default.php (revision 3557)
>     +++ t3lib/config_default.php (working copy)
>     @@ -58,6 +58,7 @@
>       'recursiveDomainSearch' => 0, // Boolean. If set, the search for
>     domain records will be done recursively by stripping parts of the
>     host name off until a matching domain record is found.
>       'devIPmask' => '127.0.0.1,::1', // Defines a list of IP
>     addresses which will allow development-output to display. The
>     debug() function will use this as a filter. See the function
>     t3lib_div::cmpIP() for details on syntax. Setting this to blank
>     value will deny all. Setting to "*" will allow all.
>       'sqlDebug' => 0, // Boolean. If set, then database queries that
>     fails are outputted in browser. For development.
>     + 'dontShowDebugOutput' => 0, // Boolean. If set, then then no
>     output of the debug functions will be outputted in browser. For
>     making sure no forgetten t3lib_div::debug will output debug live.
>       'enable_DLOG' => FALSE, // Whether the developer log is enabled.
>     See constant "TYPO3_DLOG"
>       'ddmmyy' => 'd-m-y', // Format of Date-Month-Year - see
>     PHP-function date()
>       'hhmm' => 'H:i', // Format of Hours-Minutes - see PHP-function
>     date()
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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


More information about the TYPO3-team-core mailing list