[TYPO3-core] RFC: 0008112: Adding dontShowDebugOutput Option to INSTALL TOOL using in t3lib_div debug functions

Steffen Kamper steffen at sk-typo3.de
Sun Apr 13 16:17:25 CEST 2008


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> 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()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20080413/f5ec5fee/attachment-0001.htm 


More information about the TYPO3-team-core mailing list