- bugfix unintended multiple debug windows (forum topic 25699)

This commit is contained in:
uwetews
2015-09-15 00:18:17 +02:00
parent 0eb7f4b8d1
commit ceb9afbb5d
4 changed files with 16 additions and 13 deletions

View File

@@ -5,6 +5,7 @@
- update template inheritance processing - update template inheritance processing
- move code of {call} processing back into Smarty_Internal_Template class - move code of {call} processing back into Smarty_Internal_Template class
- improvement invalidate OPCACHE for cleared compiled and cached template files (forum topic 25557) - improvement invalidate OPCACHE for cleared compiled and cached template files (forum topic 25557)
- bugfix unintended multiple debug windows (forum topic 25699)
30.08.2015 30.08.2015
- size optimization move some runtime functions into extension - size optimization move some runtime functions into extension

View File

@@ -119,7 +119,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/** /**
* smarty version * smarty version
*/ */
const SMARTY_VERSION = '3.1.28-dev/59'; const SMARTY_VERSION = '3.1.28-dev/60';
/** /**
* define variable scopes * define variable scopes

View File

@@ -152,7 +152,7 @@
</html> </html>
{/capture} {/capture}
<script type="text/javascript"> <script type="text/javascript">
{$id = ''} {$id = '__Smarty__'}
{if $display_mode}{$id = "$offset$template_name"|md5}{/if} {if $display_mode}{$id = "$offset$template_name"|md5}{/if}
_smarty_console = window.open("", "console{$id}", "width=1024,height=600,left={$offset},top={$offset},resizable,scrollbars=yes"); _smarty_console = window.open("", "console{$id}", "width=1024,height=600,left={$offset},top={$offset},resizable,scrollbars=yes");
_smarty_console.document.write("{$debug_output|escape:'javascript' nofilter}"); _smarty_console.document.write("{$debug_output|escape:'javascript' nofilter}");

View File

@@ -43,16 +43,12 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data
* @var int * @var int
*/ */
public $offset = 0; public $offset = 0;
public function __construct() {
}
/** /**
* Start logging template * Start logging template
* *
* @param \Smarty_Internal_Template $template template * @param \Smarty_Internal_Template $template template
* @param null $mode true: display false: fetch null: subtemolate * @param null $mode true: display false: fetch null: subtemplate
*/ */
public function start_template(Smarty_Internal_Template $template, $mode = null) public function start_template(Smarty_Internal_Template $template, $mode = null)
{ {
@@ -73,7 +69,8 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data
public function end_template(Smarty_Internal_Template $template) public function end_template(Smarty_Internal_Template $template)
{ {
$key = $this->get_key($template); $key = $this->get_key($template);
$this->template_data[$this->index][$key]['total_time'] += microtime(true) - $this->template_data[$this->index][$key]['start_template_time']; $this->template_data[$this->index][$key]['total_time'] +=
microtime(true) - $this->template_data[$this->index][$key]['start_template_time'];
//$this->template_data[$this->index][$key]['properties'] = $template->properties; //$this->template_data[$this->index][$key]['properties'] = $template->properties;
} }
@@ -89,7 +86,8 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data
$key = $template->compiler->trace_uid; $key = $template->compiler->trace_uid;
if (!isset($this->template_data[$this->index][$key])) { if (!isset($this->template_data[$this->index][$key])) {
if (isset($_is_stringy[$template->source->type])) { if (isset($_is_stringy[$template->source->type])) {
$this->template_data[$this->index][$key]['name'] = '\'' . substr($template->source->name, 0, 25) . '...\''; $this->template_data[$this->index][$key]['name'] =
'\'' . substr($template->source->name, 0, 25) . '...\'';
} else { } else {
$this->template_data[$this->index][$key]['name'] = $template->source->filepath; $this->template_data[$this->index][$key]['name'] = $template->source->filepath;
} }
@@ -122,7 +120,8 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data
$key = $this->get_key($template); $key = $this->get_key($template);
} }
$this->template_data[$this->index][$key]['compile_time'] += microtime(true) - $this->template_data[$this->index][$key]['start_time']; $this->template_data[$this->index][$key]['compile_time'] +=
microtime(true) - $this->template_data[$this->index][$key]['start_time'];
} }
/** /**
@@ -144,7 +143,8 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data
public function end_render(Smarty_Internal_Template $template) public function end_render(Smarty_Internal_Template $template)
{ {
$key = $this->get_key($template); $key = $this->get_key($template);
$this->template_data[$this->index][$key]['render_time'] += microtime(true) - $this->template_data[$this->index][$key]['start_time']; $this->template_data[$this->index][$key]['render_time'] +=
microtime(true) - $this->template_data[$this->index][$key]['start_time'];
} }
/** /**
@@ -166,7 +166,8 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data
public function end_cache(Smarty_Internal_Template $template) public function end_cache(Smarty_Internal_Template $template)
{ {
$key = $this->get_key($template); $key = $this->get_key($template);
$this->template_data[$this->index][$key]['cache_time'] += microtime(true) - $this->template_data[$this->index][$key]['start_time']; $this->template_data[$this->index][$key]['cache_time'] +=
microtime(true) - $this->template_data[$this->index][$key]['start_time'];
} }
/** /**
@@ -367,7 +368,8 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data
return $key; return $key;
} else { } else {
if (isset($_is_stringy[$template->source->type])) { if (isset($_is_stringy[$template->source->type])) {
$this->template_data[$this->index][$key]['name'] = '\'' . substr($template->source->name, 0, 25) . '...\''; $this->template_data[$this->index][$key]['name'] =
'\'' . substr($template->source->name, 0, 25) . '...\'';
} else { } else {
$this->template_data[$this->index][$key]['name'] = $template->source->filepath; $this->template_data[$this->index][$key]['name'] = $template->source->filepath;
} }