View previous topic :: View next topic |
Author |
Message |
sickboy Smarty Rookie
Joined: 17 Oct 2003 Posts: 9
|
Posted: Fri Oct 17, 2003 11:54 am Post subject: debug window |
|
|
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 |
|
harris Smarty Rookie
Joined: 15 Oct 2003 Posts: 5
|
Posted: Fri Oct 17, 2003 1:09 pm Post subject: |
|
|
weird,
try:
$your_site = new Smarty;
$your_site->debugging = true; |
|
Back to top |
|
sickboy Smarty Rookie
Joined: 17 Oct 2003 Posts: 9
|
Posted: Fri Oct 17, 2003 1:13 pm Post subject: |
|
|
I tried, but it still doesn't work :/ |
|
Back to top |
|
harris Smarty Rookie
Joined: 15 Oct 2003 Posts: 5
|
Posted: Fri Oct 17, 2003 1:38 pm Post subject: |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Fri Oct 17, 2003 1:55 pm Post subject: |
|
|
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 |
|
sickboy Smarty Rookie
Joined: 17 Oct 2003 Posts: 9
|
Posted: Fri Oct 17, 2003 5:08 pm Post subject: |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Fri Oct 17, 2003 5:42 pm Post subject: |
|
|
Does debug.tpl exist in your SMARTY_DIR ? |
|
Back to top |
|
sickboy Smarty Rookie
Joined: 17 Oct 2003 Posts: 9
|
Posted: Fri Oct 17, 2003 7:34 pm Post subject: |
|
|
yep :/ |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Fri Oct 17, 2003 7:53 pm Post subject: |
|
|
Can you please post your startup code? Otherwise I don't think we can help you. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Fri Oct 17, 2003 8:36 pm Post subject: |
|
|
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 |
|
sickboy Smarty Rookie
Joined: 17 Oct 2003 Posts: 9
|
Posted: Sat Oct 18, 2003 11:15 am Post subject: |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Tue Oct 21, 2003 2:56 am Post subject: |
|
|
where is debug.tpl located? |
|
Back to top |
|
sickboy Smarty Rookie
Joined: 17 Oct 2003 Posts: 9
|
Posted: Tue Oct 21, 2003 9:01 am Post subject: |
|
|
debug.tpl is in SMARTY_DIR. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Tue Oct 21, 2003 10:10 am Post subject: |
|
|
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 |
|
sickboy Smarty Rookie
Joined: 17 Oct 2003 Posts: 9
|
Posted: Tue Oct 21, 2003 1:45 pm Post subject: |
|
|
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 |
|
|