MyXoops Forum

Forum - myXOOPS German Support

9 + 9 = ?  
Geben Sie das Ergebnis der Berechnung ein
Sie haben max. 10 Versuche.
 
* = Erforderlich

Aw:: XOOPS-Debug ohne XOOPS-Debug!

Betreff: Aw:: XOOPS-Debug ohne XOOPS-Debug!
von frankblack am 29.07.2009 17:43:20

Fast vergessen: Der Ordner "FirePHPCore" muss mitsamt Inhalt in eure XOOPS-root.

Okay, ich habe gerade versucht auch den smarty-debug einzubauen und habe hierfür einen Code gefunden. Leider ist der Code etwas veraltet und die Debug-Infos werden nicht kollabiert angezeigt. Benutzung auf eigene Gefahr.

Schritt 1: class/template.php bearbeiten, sollte Zeile 56 sein, von
if ( $xoopsConfig['debug_mode'] == ) {

ändern in
if ( $xoopsConfig['debug_mode'] == ) {


Schritt 2: include/common.php bearbeiten, sollte Zeile 182 sein, von
if ( $xoopsConfig['debug_mode'] == || $xoopsConfig['debug_mode'] == ) {

ändern in
if ( $xoopsConfig['debug_mode'] == || $xoopsConfig['debug_mode'] == || $xoopsConfig['debug_mode'] == ) {


Schritt 3: class/smarty/internals/core.display_debug_console.php bearbeiten und komplett mit dem folgenden Code ersetzen
<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

/**
 * Smarty debug_console function plugin
 *
 * Type:     core<br>
 * Name:     display_debug_console<br>
 * Purpose:  display the javascript debug console window
 * @param array Format: null
 * @param Smarty
 */

if (!defined('XOOPS_ROOT_PATH')) die('XOOPS_ROOT_PATH not defined');
require_once 
XOOPS_ROOT_PATH.'/FirePHPCore/FirePHP.class.php';

function 
smarty_core_display_debug_console($params, &$smarty)
{
    
//get required debug variables
    
$assigned_vars $smarty->_tpl_vars;
    
ksort($assigned_vars);

    
$config_vars = array();
    if(@
is_array($smarty->_config[0])){
        
$config_vars $smarty->_config[0];
        
ksort($config_vars);
    }

    
$firephp FirePHP::getInstance(true);

    
$firephp->group('Smarty Debug Output');
    
/*Log template files*/
    
$firephp->group('included templates & config files (load time in seconds)');
    foreach( 
$smarty->_smarty_debug_info as $tml ){
        
$msg str_repeat('--'$tml['depth']);
        
$msg .= ( $tml['depth'] != ) ? '>' '';
        if (isset(
$tml['exec_time'])) $getthetime ' (' substr($tml['exec_time'], 07) . 's)';
        else 
$getthetime '';
        
$msg .= $tml['filename'] . $getthetime;
        
$firephp->log($msg);
    }
    
$firephp->groupEnd(); //end group 'included templates &...'


    /*Log assigned template variables*/
    
$firephp->group('assigned template variables');
    foreach( 
$assigned_vars as $key => $value ){
        
$firephp->log($value'{$' $key '}');
    }
    
$firephp->groupEnd(); //end group 'assigned template variables'


    /*Log assigned config file variables (outer template scope)*/
    
$firephp->group('assigned config file variables (outer template scope)');
    
/*Check if there is something in the config*/
    
if(!empty($config_vars)){
        foreach( 
$config_vars as $key => $value ){
            
$firephp->log($value'{#' $key '#}');
        }
    } else{
        
$firephp->log("No configuration values available");
    }
    
$firephp->groupEnd(); //end group 'assigned config file variables (outer template scope)'


    
$firephp->groupEnd(); //end group 'Smarty Debug Output'

}

/* vim: set expandtab: */

?>


Have fun!

Aktuell aus dem Forum

Forum Thema Antworten Views Letzter Beitrag
Modulentwicklung New Xoops Xcreate Module 0 5324 26.11.2025 15:22
efkan Gehe zum letzten Beitrag
Modulentwicklung XOOPS Custom Field Module 1 1813 24.11.2025 11:21
Goffy Gehe zum letzten Beitrag