Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

debug window
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
sickboy
Smarty Rookie


Joined: 17 Oct 2003
Posts: 9

PostPosted: Fri Oct 17, 2003 11:54 am    Post subject: debug window Reply with quote

Hi everyone,

I have a problem with debug popup window - it doesn't start. I have

Code:
var $debugging       =  true;


but it doesn't work. What can I set to turn debugging on?

(btw: i have smarty 2.5.0 on php 4.3.0/apache 1.3.28/linux)
Back to top
View user's profile Send private message
harris
Smarty Rookie


Joined: 15 Oct 2003
Posts: 5

PostPosted: Fri Oct 17, 2003 1:09 pm    Post subject: Reply with quote

weird,

try:

$your_site = new Smarty;
$your_site->debugging = true;
Back to top
View user's profile Send private message
sickboy
Smarty Rookie


Joined: 17 Oct 2003
Posts: 9

PostPosted: Fri Oct 17, 2003 1:13 pm    Post subject: Reply with quote

I tried, but it still doesn't work :/
Back to top
View user's profile Send private message
harris
Smarty Rookie


Joined: 15 Oct 2003
Posts: 5

PostPosted: Fri Oct 17, 2003 1:38 pm    Post subject: Reply with quote

You can take a look at the debug function in Smarty.class.php, maybe there is some system specific check or something that is making debugging fail.
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Fri Oct 17, 2003 1:55 pm    Post subject: Reply with quote

chances are that you have to set your debug_tpl :
$smarty->debug_tpl = 'file:' . SMARTY_DIR . 'debug.tpl';

For completeness, you could also set the following (but this is the default):
$smarty->debugging_ctrl = 'SMARTY_DEBUG';

If you are using something like Mozilla or any browser enhancement that is capable of blocking popups, be sure to allow your site to be permitted to open popups (and/or that JavaScript is turned on).

HTH
Back to top
View user's profile Send private message
sickboy
Smarty Rookie


Joined: 17 Oct 2003
Posts: 9

PostPosted: Fri Oct 17, 2003 5:08 pm    Post subject: Reply with quote

My sever and smarty works on other machine (linux) and i check it via lan. Other machine works on windows, so I use ie (javascript is enabled, I don't have any popup blocker).

I checked all ways, but it still doesn't work. What else can I do?
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Fri Oct 17, 2003 5:42 pm    Post subject: Reply with quote

Does debug.tpl exist in your SMARTY_DIR ?
Back to top
View user's profile Send private message
sickboy
Smarty Rookie


Joined: 17 Oct 2003
Posts: 9

PostPosted: Fri Oct 17, 2003 7:34 pm    Post subject: Reply with quote

yep :/
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Fri Oct 17, 2003 7:53 pm    Post subject: Reply with quote

Can you please post your startup code? Otherwise I don't think we can help you.
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Fri Oct 17, 2003 8:36 pm    Post subject: Reply with quote

on my pages the debug-console sometimes breaks because it exceeds php's memory limit. certain versions of php don't throw this error on the page, but prefer to cause a segfault in the webserver (which leads to "document contains no data" or "this page cannot be displayed" or the like depending on the level of braindeadness of your webbrowser). in my case it's caused by some tpl-vars that reference to themselves and debug_print_var doesn't recognize it got in an endless recursion and fills the output_buffer to excess.

but it in this case the page is fully empty when debugging is enabled, not even the parts that don't belong to debugging are displayed.

how does the the output of your templates (the html-source) look when debugging is enabled?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sickboy
Smarty Rookie


Joined: 17 Oct 2003
Posts: 9

PostPosted: Sat Oct 18, 2003 11:15 am    Post subject: Reply with quote

I observe one weird thing. Debug window is displaying on other page in my webpage. Well... I have sometheng like that:

1. Config file (includes/config.inc.php), which contains:

Code:
$conf = array(

      'template.main_dir' => '/home/sickboy/templates',
      'template.cache_dir' => '/tmp',
      'template.config_dir' => '/home/sickboy/includes',
      'template.debugging' => true,

      ...


2. Smarty script in includes/smarty
3. Two classes in two files (for my webpage and for it's administrative panel)

a) for webpage:

Code:
class Template extends Smarty
{
      var $stack = array();

      function Template()
      {
            global $conf;

            $this -> template_dir = $conf['template.main_dir'];
            $this -> compile_dir = $conf['template.cache_dir'];
            $this -> config_dir = $conf['template.config_dir'];
            $this -> debugging = $conf['template.debugging'];
      }

      ...


b) ...and for admin CP:

Code:
class Template extends Smarty
{
      function Template()
      {
            global $conf;

            Header("Expires: Wed, 11 Nov 1998 11:11:11 GMT\r\n".
                        "Cache-Control: no-cache\r\n".
                        "Cache-Control: must-revalidate\r\n".
                        "Pragma: no-cache");

            $this -> template_dir = $conf['template.main_dir'] . '/admin';
            $this -> compile_dir = $conf['template.cache_dir'];
            $this -> config_dir = $conf['template.config_dir'];
            $this -> debugging = $conf['template.debugging'];
      }

      ...


4. I'm sure that config.inc.php is included.

Code:
require $basedir . 'includes/config.inc.php';


5. I'm sure that $conf array is global for both of these methods

6. Debug window is displaying in admin CP, but in main page it doesn't.
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Tue Oct 21, 2003 2:56 am    Post subject: Reply with quote

where is debug.tpl located?
Back to top
View user's profile Send private message
sickboy
Smarty Rookie


Joined: 17 Oct 2003
Posts: 9

PostPosted: Tue Oct 21, 2003 9:01 am    Post subject: Reply with quote

debug.tpl is in SMARTY_DIR.
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Tue Oct 21, 2003 10:10 am    Post subject: Reply with quote

you are using two different template_dirs with the same compile_dir . i don't know if that's the source of your problem with the debug-console, but undoubtly it calls for trouble.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sickboy
Smarty Rookie


Joined: 17 Oct 2003
Posts: 9

PostPosted: Tue Oct 21, 2003 1:45 pm    Post subject: Reply with quote

No, it isn't a problem. I changed it, but it doesn't give any effect.

for user interface: /tmp/cache
for admin interface: /tmp/cache/admin
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP