mirror of
https://github.com/friendica/friendica
synced 2025-04-25 03:10:11 +00:00
reverting tinymce changes, updating smarty to 3.1.19
This commit is contained in:
parent
5633e88aad
commit
0e1f8f6486
155 changed files with 13663 additions and 10784 deletions
|
@ -1,22 +1,21 @@
|
|||
<?php
|
||||
/**
|
||||
* Smarty Internal Plugin Debug
|
||||
*
|
||||
* Class to collect data for the Smarty Debugging Consol
|
||||
*
|
||||
* @package Smarty
|
||||
* @package Smarty
|
||||
* @subpackage Debug
|
||||
* @author Uwe Tews
|
||||
* @author Uwe Tews
|
||||
*/
|
||||
|
||||
/**
|
||||
* Smarty Internal Plugin Debug Class
|
||||
*
|
||||
* @package Smarty
|
||||
* @package Smarty
|
||||
* @subpackage Debug
|
||||
*/
|
||||
class Smarty_Internal_Debug extends Smarty_Internal_Data {
|
||||
|
||||
class Smarty_Internal_Debug extends Smarty_Internal_Data
|
||||
{
|
||||
/**
|
||||
* template data
|
||||
*
|
||||
|
@ -24,6 +23,27 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data {
|
|||
*/
|
||||
public static $template_data = array();
|
||||
|
||||
/**
|
||||
* List of uid's which shall be ignored
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $ignore_uid = array();
|
||||
|
||||
/**
|
||||
* Ignore template
|
||||
*
|
||||
* @param object $template
|
||||
*/
|
||||
public static function ignore($template)
|
||||
{
|
||||
// calculate Uid if not already done
|
||||
if ($template->source->uid == '') {
|
||||
$template->source->filepath;
|
||||
}
|
||||
self::$ignore_uid[$template->source->uid] = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start logging of compile time
|
||||
*
|
||||
|
@ -31,7 +51,25 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data {
|
|||
*/
|
||||
public static function start_compile($template)
|
||||
{
|
||||
$key = self::get_key($template);
|
||||
static $_is_stringy = array('string' => true, 'eval' => true);
|
||||
if (!empty($template->compiler->trace_uid)) {
|
||||
$key = $template->compiler->trace_uid;
|
||||
if (!isset(self::$template_data[$key])) {
|
||||
if (isset($_is_stringy[$template->source->type])) {
|
||||
self::$template_data[$key]['name'] = '\'' . substr($template->source->name, 0, 25) . '...\'';
|
||||
} else {
|
||||
self::$template_data[$key]['name'] = $template->source->filepath;
|
||||
}
|
||||
self::$template_data[$key]['compile_time'] = 0;
|
||||
self::$template_data[$key]['render_time'] = 0;
|
||||
self::$template_data[$key]['cache_time'] = 0;
|
||||
}
|
||||
} else {
|
||||
if (isset(self::$ignore_uid[$template->source->uid])) {
|
||||
return;
|
||||
}
|
||||
$key = self::get_key($template);
|
||||
}
|
||||
self::$template_data[$key]['start_time'] = microtime(true);
|
||||
}
|
||||
|
||||
|
@ -42,7 +80,15 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data {
|
|||
*/
|
||||
public static function end_compile($template)
|
||||
{
|
||||
$key = self::get_key($template);
|
||||
if (!empty($template->compiler->trace_uid)) {
|
||||
$key = $template->compiler->trace_uid;
|
||||
} else {
|
||||
if (isset(self::$ignore_uid[$template->source->uid])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$key = self::get_key($template);
|
||||
}
|
||||
self::$template_data[$key]['compile_time'] += microtime(true) - self::$template_data[$key]['start_time'];
|
||||
}
|
||||
|
||||
|
@ -115,6 +161,7 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data {
|
|||
$smarty->left_delimiter = '{';
|
||||
$smarty->right_delimiter = '}';
|
||||
$smarty->debugging = false;
|
||||
$smarty->debugging_ctrl = 'NONE';
|
||||
$smarty->force_compile = false;
|
||||
$_template = new Smarty_Internal_Template($smarty->debug_tpl, $smarty);
|
||||
$_template->caching = false;
|
||||
|
@ -138,7 +185,8 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data {
|
|||
/**
|
||||
* Recursively gets variables from all template/data scopes
|
||||
*
|
||||
* @param Smarty_Internal_Template|Smarty_Data $obj object to debug
|
||||
* @param Smarty_Internal_Template|Smarty_Data $obj object to debug
|
||||
*
|
||||
* @return StdClass
|
||||
*/
|
||||
public static function get_debug_vars($obj)
|
||||
|
@ -169,14 +217,16 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (object) array('tpl_vars' => $tpl_vars, 'config_vars' => $config_vars);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return key into $template_data for template
|
||||
*
|
||||
* @param object $template template object
|
||||
* @return string key into $template_data
|
||||
* @param object $template template object
|
||||
*
|
||||
* @return string key into $template_data
|
||||
*/
|
||||
private static function get_key($template)
|
||||
{
|
||||
|
@ -190,17 +240,15 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data {
|
|||
return $key;
|
||||
} else {
|
||||
if (isset($_is_stringy[$template->source->type])) {
|
||||
self::$template_data[$key]['name'] = '\''.substr($template->source->name,0,25).'...\'';
|
||||
self::$template_data[$key]['name'] = '\'' . substr($template->source->name, 0, 25) . '...\'';
|
||||
} else {
|
||||
self::$template_data[$key]['name'] = $template->source->filepath;
|
||||
}
|
||||
self::$template_data[$key]['compile_time'] = 0;
|
||||
self::$template_data[$key]['render_time'] = 0;
|
||||
self::$template_data[$key]['cache_time'] = 0;
|
||||
|
||||
return $key;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue