当前位置: 首页>>代码示例>>PHP>>正文


PHP Smarty_Internal_Template::disableSecurity方法代码示例

本文整理汇总了PHP中Smarty_Internal_Template::disableSecurity方法的典型用法代码示例。如果您正苦于以下问题:PHP Smarty_Internal_Template::disableSecurity方法的具体用法?PHP Smarty_Internal_Template::disableSecurity怎么用?PHP Smarty_Internal_Template::disableSecurity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Smarty_Internal_Template的用法示例。


在下文中一共展示了Smarty_Internal_Template::disableSecurity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: display_debug

 /**
  * Opens a window for the Smarty Debugging Consol and display the data
  */
 public static function display_debug($obj)
 {
     // prepare information of assigned variables
     $ptr = $obj;
     while (isset($ptr->parent)) {
         $ptr = $ptr->parent;
     }
     if ($obj instanceof Smarty) {
         $smarty = $obj;
     } else {
         $smarty = $obj->smarty;
     }
     $_assigned_vars = $ptr->tpl_vars;
     ksort($_assigned_vars);
     $_config_vars = $ptr->config_vars;
     ksort($_config_vars);
     $ldelim = $smarty->left_delimiter;
     $rdelim = $smarty->right_delimiter;
     $smarty->left_delimiter = '{';
     $smarty->right_delimiter = '}';
     $_template = new Smarty_Internal_Template($smarty->debug_tpl, $smarty);
     $_template->caching = false;
     $_template->force_compile = false;
     $_template->disableSecurity();
     $_template->cache_id = null;
     $_template->compile_id = null;
     $_template->assign('template_data', self::$template_data);
     $_template->assign('assigned_vars', $_assigned_vars);
     $_template->assign('config_vars', $_config_vars);
     $_template->assign('execution_time', microtime(true) - $smarty->start_time);
     echo $smarty->fetch($_template);
     $smarty->left_delimiter = $ldelim;
     $smarty->right_delimiter = $rdelim;
 }
开发者ID:ChrstnMgcn,项目名称:revolution,代码行数:37,代码来源:smarty_internal_debug.php

示例2: start_render

 }
 /**
  * Start logging of render time
  *
  * @param object $template
  */
 public static function start_render($template)
 {
     $key = self::get_key($template);
     self::$template_data[$key]['start_time'] = microtime(true);
 }
 /**
  * End logging of compile time
  *
  * @param object $template
  */
 public static function end_render($template)
 {
     $key = self::get_key($template);
     self::$template_data[$key]['render_time'] += microtime(true) - self::$template_data[$key]['start_time'];
 }
 /**
  * Start logging of cache time
  *
  * @param object $template cached template
  */
 public static function start_cache($template)
 {
     $key = self::get_key($template);
     self::$template_data[$key]['start_time'] = microtime(true);
 }
 /**
  * End logging of cache time
  *
  * @param object $template cached template
  */
 public static function end_cache($template)
 {
     $key = self::get_key($template);
     self::$template_data[$key]['cache_time'] += microtime(true) - self::$template_data[$key]['start_time'];
开发者ID:RqHe,项目名称:aunet1,代码行数:40,代码来源:smarty_internal_debug.php


注:本文中的Smarty_Internal_Template::disableSecurity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。