Skip to content

Commit b7f114a

Browse files
committed
add tracker information
1 parent 4faa774 commit b7f114a

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

compiler.require.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ function smarty_compiler_require($arrParams, $smarty){
1818
$strResourceApiPath = preg_replace('/[\\/\\\\]+/', '/', dirname(__FILE__) . '/FISResource.class.php');
1919
$strCode .= '<?php if(!class_exists(\'FISResource\', false)){require_once(\'' . $strResourceApiPath . '\');}';
2020
if ($strName) {
21+
$strCode .= 'if (array_key_exists(\'fis_debug\', $_GET)) {echo "<!--require '.str_replace("\"", '\"', $strName).'-->\n";}';
2122
$strCode .= 'FISResource::load(' . $strName . ',$_smarty_tpl->smarty, '.$async.');';
2223
} else if (is_string($src)) {
24+
$strCode .= 'if (array_key_exists(\'fis_debug\', $_GET)) {echo "<!--add static '.str_replace("\"", '\"', $str).'-->\n";}';
2325
$strCode .= 'FISResource::addStatic(' . $src . ', ' . $type . ');';
2426
}
2527
$strCode .= '?>';

compiler.widget.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ function smarty_compiler_widget($arrParams, $smarty){
5454
if($strName){
5555
$strCode .= '$_tpl_path=FISResource::getUri(' . $strName . ',$_smarty_tpl->smarty);';
5656
$strCode .= 'if(isset($_tpl_path)){';
57+
58+
$strCode .= 'if (array_key_exists(\'fis_debug\', $_GET)) {echo "<!--widget start '.str_replace("\"", '\"', $strName).'-->\n";}';
59+
5760
if($bHasCall){
5861
$strCode .= '$_smarty_tpl->getSubTemplate($_tpl_path, $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, $_smarty_tpl->caching, $_smarty_tpl->cache_lifetime, ' . $strFuncParams . ', Smarty::SCOPE_LOCAL);';
5962
$strCode .= 'if(is_callable('. $strTplFuncName . ')){';
@@ -64,6 +67,9 @@ function smarty_compiler_widget($arrParams, $smarty){
6467
} else {
6568
$strCode .= 'echo $_smarty_tpl->getSubTemplate($_tpl_path, $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, $_smarty_tpl->caching, $_smarty_tpl->cache_lifetime, ' . $strFuncParams . ', Smarty::SCOPE_LOCAL);';
6669
}
70+
71+
$strCode .= 'if (array_key_exists(\'fis_debug\', $_GET)) {echo "\n<!--widget end '.str_replace("\"", '\"', $strName).'-->";}';
72+
6773
$strCode .= '}else{';
6874
$strCode .= 'trigger_error(\'unable to locale resource "\'.' . $strName . '.\'"\', E_USER_ERROR);';
6975
$strCode .= '}';
@@ -84,6 +90,9 @@ function getWidgetStrCode($path, $arrParams){
8490
$path = trim($path,"\"");
8591
$fn = '"smarty_template_function_fis_' . strtr(substr($path, 0, strrpos($path, '/')), '/', '_') . '"';
8692
$strCode = '<?php ';
93+
94+
$strCode .= 'if (array_key_exists(\'fis_debug\', $_GET)) {echo "<!--widget start '.str_replace("\"", '\"', $path).'-->\n";}';
95+
8796
$strCode .= 'if(is_callable(' . $fn . ')){';
8897
$strCode .= 'return call_user_func(' . $fn . ',$_smarty_tpl,' . $strFuncParams . ');';
8998
$strCode .= '}else{';
@@ -93,6 +102,9 @@ function getWidgetStrCode($path, $arrParams){
93102
$strCode .= '}else{';
94103
$strCode .= 'echo $fis_widget_output;';
95104
$strCode .= '}';
105+
106+
$strCode .= 'if (array_key_exists(\'fis_debug\', $_GET)) {echo "\n<!--widget end '.str_replace("\"", '\"', $path).'-->";}';
107+
96108
$strCode .= '}?>';
97109
return $strCode;
98110
}

0 commit comments

Comments
 (0)