Note: this list is kept only as a demonstration for CVSNotice. For the latest CVS notices, see the Xaraya and Postnuke sites
View Statistics - Next Notice - Previous NoticeDirectory filter : [ all ] / postnuke_modules / postcalendar / pnincludes / Smarty [ view in CVS ]
| Date | Directory [filter] | File(s) [view] | Author [filter] |
| 21 Aug 2002 20:21:47 | postnuke_modules/postcalendar/pnincludes/Smarty | Config_File.class.php,1.1,1.2 Smarty.class.php,1.1,1.2 Smarty_Compiler.class.php,1.1,1.2 | Roger Raymond |
| Smarty 2.3.0 | |||
Update of /home/cvsroot/postnuke_modules/postcalendar/pnincludes/Smarty
In directory ns7.hostnuke.net:/tmp/cvs-serv14933
Modified Files:
Config_File.class.php Smarty.class.php
Smarty_Compiler.class.php
Log Message:
Smarty 2.3.0
Index: Config_File.class.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/postcalendar/pnincludes/Smarty/Config_File.class.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Config_File.class.php 6 Jun 2002 21:15:02 -0000 1.1
--- Config_File.class.php 21 Aug 2002 20:21:44 -0000 1.2
***************
*** 4,8 ****
* Config_File class.
*
! * @version 2.0.1
* @author Andrei Zmievski <andrei@php.net>
* @access public
--- 4,8 ----
* Config_File class.
*
! * @version 2.3.0
* @author Andrei Zmievski <andrei@php.net>
* @access public
***************
*** 125,139 ****
if (!empty($var_name)) {
! if (empty($section_name))
! {
return $this->_config_data[$file_name]["vars"][$var_name];
}
- else
- return $this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name];
} else {
! if (empty($section_name))
return (array)$this->_config_data[$file_name]["vars"];
! else
! return (array)$this->_config_data[$file_name]["sections"][$section_name]["vars"];
}
}
--- 125,145 ----
if (!empty($var_name)) {
! if (empty($section_name)) {
return $this->_config_data[$file_name]["vars"][$var_name];
+ } else {
+ if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name]))
+ return $this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name];
+ else
+ return array();
}
} else {
! if (empty($section_name)) {
return (array)$this->_config_data[$file_name]["vars"];
! } else {
! if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"]))
! return (array)$this->_config_data[$file_name]["sections"][$section_name]["vars"];
! else
! return array();
! }
}
}
Index: Smarty.class.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/postcalendar/pnincludes/Smarty/Smarty.class.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Smarty.class.php 6 Jun 2002 21:15:02 -0000 1.1
--- Smarty.class.php 21 Aug 2002 20:21:44 -0000 1.2
***************
*** 6,10 ****
* Andrei Zmievski <andrei@php.net>
*
! * Version: 2.1.1
* Copyright: 2001,2002 ispi of Lincoln, Inc.
*
--- 6,10 ----
* Andrei Zmievski <andrei@php.net>
*
! * Version: 2.3.0
* Copyright: 2001,2002 ispi of Lincoln, Inc.
[...1011 lines suppressed...]
+ $_ini_include_path = ini_get('include_path');
+
+ if(strstr($_ini_include_path,';')) {
+ // windows pathnames
+ $_path_array = explode(';',$_ini_include_path);
+ } else {
+ $_path_array = explode(':',$_ini_include_path);
+ }
+ }
+ foreach ($_path_array as $_include_path) {
+ if (@file_exists($_include_path . DIR_SEP . $file_path)) {
+ $new_file_path = $_include_path . DIR_SEP . $file_path;
+ return true;
+ }
+ }
+ return false;
+ }
+
}
Index: Smarty_Compiler.class.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/postcalendar/pnincludes/Smarty/Smarty_Compiler.class.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Smarty_Compiler.class.php 6 Jun 2002 21:15:02 -0000 1.1
--- Smarty_Compiler.class.php 21 Aug 2002 20:21:44 -0000 1.2
***************
*** 7,11 ****
* Andrei Zmievski <andrei@php.net>
*
! * Version: 2.1.1
* Copyright: 2001,2002 ispi of Lincoln, Inc.
*
--- 7,11 ----
* Andrei Zmievski <andrei@php.net>
*
! * Version: 2.3.0
* Copyright: 2001,2002 ispi of Lincoln, Inc.
*
***************
*** 111,119 ****
/* loop through text blocks */
! for ($curr_tb = 0; $curr_tb < count($text_blocks); $curr_tb++) {
/* match anything within <? ?> */
if (preg_match_all('!(<\?[^?]*?\?>|<script\s+language\s*=\s*[\"\']?php[\"\']?\s*>)!is', $text_blocks[$curr_tb], $sp_match)) {
/* found at least one match, loop through each one */
! for ($curr_sp = 0; $curr_sp < count($sp_match[0]); $curr_sp++) {
if (preg_match('!^(<\?(php\s|\s|=\s)|<script\s*language\s*=\s*[\"\']?php[\"\']?\s*>)!is', $sp_match[0][$curr_sp])) {
/* php tag */
--- 111,119 ----
/* loop through text blocks */
! for ($curr_tb = 0, $for_max = count($text_blocks); $curr_tb < $for_max; $curr_tb++) {
/* match anything within <? ?> */
if (preg_match_all('!(<\?[^?]*?\?>|<script\s+language\s*=\s*[\"\']?php[\"\']?\s*>)!is', $text_blocks[$curr_tb], $sp_match)) {
/* found at least one match, loop through each one */
! for ($curr_sp = 0, $for_max2 = count($sp_match[0]); $curr_sp < $for_max2; $curr_sp++) {
if (preg_match('!^(<\?(php\s|\s|=\s)|<script\s*language\s*=\s*[\"\']?php[\"\']?\s*>)!is', $sp_match[0][$curr_sp])) {
/* php tag */
***************
*** 141,145 ****
/* Compile the template tags into PHP code. */
$compiled_tags = array();
! for ($i = 0; $i < count($template_tags); $i++) {
$this->_current_line_no += substr_count($text_blocks[$i], "\n");
$compiled_tags[] = $this->_compile_tag($template_tags[$i]);
--- 141,145 ----
/* Compile the template tags into PHP code. */
$compiled_tags = array();
! for ($i = 0, $for_max = count($template_tags); $i < $for_max; $i++) {
$this->_current_line_no += substr_count($text_blocks[$i], "\n");
$compiled_tags[] = $this->_compile_tag($template_tags[$i]);
***************
*** 150,154 ****
/* Interleave the compiled contents and text blocks to get the final result. */
! for ($i = 0; $i < count($compiled_tags); $i++) {
$template_compiled .= $text_blocks[$i].$compiled_tags[$i];
}
--- 150,154 ----
/* Interleave the compiled contents and text blocks to get the final result. */
! for ($i = 0, $for_max = count($compiled_tags); $i < $for_max; $i++) {
$template_compiled .= $text_blocks[$i].$compiled_tags[$i];
}
***************
*** 160,164 ****
$strip_tags_modified = preg_replace("!{$ldq}/?strip{$rdq}|[\t ]+$|^[\t ]+!m", '', $strip_tags);
$strip_tags_modified = preg_replace('![\r\n]+!m', '', $strip_tags_modified);
! for ($i = 0; $i < count($strip_tags); $i++)
$template_compiled = preg_replace("!{$ldq}strip{$rdq}.*?{$ldq}/strip{$rdq}!s",
$this->quote_replace($strip_tags_modified[$i]),
--- 160,164 ----
$strip_tags_modified = preg_replace("!{$ldq}/?strip{$rdq}|[\t ]+$|^[\t ]+!m", '', $strip_tags);
$strip_tags_modified = preg_replace('![\r\n]+!m', '', $strip_tags_modified);
! for ($i = 0, $for_max = count($strip_tags); $i < $for_max; $i++)
$template_compiled = preg_replace("!{$ldq}strip{$rdq}.*?{$ldq}/strip{$rdq}!s",
$this->quote_replace($strip_tags_modified[$i]),
***************
*** 236,240 ****
/* If the tag name matches a variable or section property definition,
we simply process it. */
! if (preg_match('!^\$\w+(?>(\[(\d+|\w+(\.\w+)?)\])|((\.|->)\$?\w+))*(?>\|@?\w+(:(?>' . $qstr_regexp . '|[^|]+))*)*$!', $tag_command) || // if a variable
preg_match('!^#(\w+)#(?>\|@?\w+(:(?>' . $qstr_regexp . '|[^|]+))*)*$!', $tag_command) || // or a configuration variable
preg_match('!^%\w+\.\w+%(?>\|@?\w+(:(?>' . $qstr_regexp . '|[^|]+))*)*$!', $tag_command)) { // or a section property
--- 236,240 ----
/* If the tag name matches a variable or section property definition,
we simply process it. */
! if (preg_match('!^\$\w+(?>(\[(\d+|\$\w+|\w+(\.\w+)?)\])|((\.|->)\$?\w+))*(?>\|@?\w+(:(?>' . $qstr_regexp . '|[^|]+))*)*$!', $tag_command) || // if a variable
preg_match('!^#(\w+)#(?>\|@?\w+(:(?>' . $qstr_regexp . '|[^|]+))*)*$!', $tag_command) || // or a configuration variable
preg_match('!^%\w+\.\w+%(?>\|@?\w+(:(?>' . $qstr_regexp . '|[^|]+))*)*$!', $tag_command)) { // or a section property
***************
*** 349,358 ****
$have_function = true;
- $plugin_file = SMARTY_DIR .
- $this->plugins_dir . DIR_SEP .
- 'compiler.' .
- $tag_command .
- '.php';
-
/*
* First we check if the compiler function has already been registered
--- 349,352 ----
***************
*** 371,375 ****
* inside it.
*/
! else if (file_exists($plugin_file) && is_readable($plugin_file)) {
$found = true;
--- 365,369 ----
* inside it.
*/
! else if ($plugin_file = $this->_get_plugin_filepath('compiler', $tag_command)) {
$found = true;
***************
*** 419,428 ****
$have_function = true;
- $plugin_file = SMARTY_DIR .
- $this->plugins_dir . DIR_SEP .
- 'block.' .
- $tag_command .
- '.php';
-
/*
* First we check if the block function has already been registered
--- 413,416 ----
***************
*** 441,445 ****
* inside it.
*/
! else if (file_exists($plugin_file) && is_readable($plugin_file)) {
$found = true;
--- 429,433 ----
* inside it.
*/
! else if ($plugin_file = $this->_get_plugin_filepath('block', $tag_command)) {
$found = true;
***************
*** 633,638 ****
$assign_var = $this->_dequote($attrs['assign']);
!
! return "<?php \$this->_smarty_include_php($attrs[file], '$assign_var'); ?>";
}
--- 621,628 ----
$assign_var = $this->_dequote($attrs['assign']);
!
! $once_var = ( $attrs['once'] === false ) ? 'false' : 'true';
!
! return "<?php \$this->_smarty_include_php($attrs[file], '$assign_var', $once_var); ?>";
}
***************
*** 713,719 ****
}
! $output .= "if ({$section_props}['show']) {\n" .
! " {$section_props}['total'] = min(ceil(({$section_props}['step'] > 0 ? {$section_props}['loop'] - {$section_props}['start'] : {$section_props}['start']+1)/abs({$section_props}['step'])), {$section_props}['max']);\n" .
! " if ({$section_props}['total'] == 0)\n" .
" {$section_props}['show'] = false;\n" .
"} else\n" .
--- 703,713 ----
}
! $output .= "if ({$section_props}['show']) {\n";
! if (!isset($attrs['start']) && !isset($attrs['step']) && !isset($attrs['max'])) {
! $output .= " {$section_props}['total'] = {$section_props}['loop'];\n";
! } else {
! $output .= " {$section_props}['total'] = min(ceil(({$section_props}['step'] > 0 ? {$section_props}['loop'] - {$section_props}['start'] : {$section_props}['start']+1)/abs({$section_props}['step'])), {$section_props}['max']);\n";
! }
! $output .= " if ({$section_props}['total'] == 0)\n" .
" {$section_props}['show'] = false;\n" .
"} else\n" .
***************
*** 843,847 ****
$is_arg_stack = array();
! for ($i = 0; $i < count($tokens); $i++) {
$token = &$tokens[$i];
--- 837,841 ----
$is_arg_stack = array();
! for ($i = 0, $for_max = count($tokens); $i < $for_max; $i++) {
$token = &$tokens[$i];
***************
*** 1082,1086 ****
$qstr_regexp = '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'';
! $var_exprs = preg_grep('!^\$\w+(?>(\[(\d+|\w+(\.\w+)?)\])|((\.|->)\$?\w+))*(?>\|@?\w+(:(?>' . $qstr_regexp . '|[^|]+))*)*$!', $tokens);
$conf_var_exprs = preg_grep('!^#(\w+)#(?>\|@?\w+(:(?>' . $qstr_regexp . '|[^|]+))*)*$!', $tokens);
$sect_prop_exprs = preg_grep('!^%\w+\.\w+%(?>\|@?\w+(:(?>' . $qstr_regexp . '|[^|]+))*)*$!', $tokens);
--- 1076,1080 ----
$qstr_regexp = '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'';
! $var_exprs = preg_grep('!^\$\w+(?>(\[(\d+|\$\w+|\w+(\.\w+)?)\])|((\.|->)\$?\w+))*(?>\|@?\w+(:(?>' . $qstr_regexp . '|[^|]+))*)*$!', $tokens);
$conf_var_exprs = preg_grep('!^#(\w+)#(?>\|@?\w+(:(?>' . $qstr_regexp . '|[^|]+))*)*$!', $tokens);
$sect_prop_exprs = preg_grep('!^%\w+\.\w+%(?>\|@?\w+(:(?>' . $qstr_regexp . '|[^|]+))*)*$!', $tokens);
***************
*** 1115,1120 ****
$var_ref = $parts[0];
$modifiers = isset($parts[1]) ? $parts[1] : '';
!
! preg_match_all('!\[\w+(\.\w+)?\]|(->|\.)\$?\w+|^\w+!', $var_ref, $match);
$indexes = $match[0];
$var_name = array_shift($indexes);
--- 1109,1119 ----
$var_ref = $parts[0];
$modifiers = isset($parts[1]) ? $parts[1] : '';
!
! if(!empty($this->default_modifiers) && !preg_match('!(^|\|)smarty:nodefaults($|\|)!',$modifiers)) {
! $_default_mod_string = implode('|',(array)$this->default_modifiers);
! $modifiers = empty($modifiers) ? $_default_mod_string : $_default_mod_string . '|' . $modifiers;
! }
!
! preg_match_all('!\[(?:\$\w+|\w+(\.\w+)?)\]|(->|\.)\$?\w+|^\w+!', $var_ref, $match);
$indexes = $match[0];
$var_name = array_shift($indexes);
***************
*** 1142,1145 ****
--- 1141,1146 ----
if (is_numeric($index)) {
$output .= "[$index]";
+ } elseif ($index{0} == '$') {
+ $output .= "[\$this->_tpl_vars['" . substr($index, 1) . "']]";
} else {
$parts = explode('.', $index);
***************
*** 1216,1221 ****
list(, $modifiers, $modifier_arg_strings) = $match;
! for ($i = 0; $i < count($modifiers); $i++) {
$modifier_name = $modifiers[$i];
preg_match_all('!:(' . $qstr_regexp . '|[^:]+)!', $modifier_arg_strings[$i], $match);
$modifier_args = $match[1];
--- 1217,1228 ----
list(, $modifiers, $modifier_arg_strings) = $match;
! for ($i = 0, $for_max = count($modifiers); $i < $for_max; $i++) {
$modifier_name = $modifiers[$i];
+
+ if($modifier_name == 'smarty') {
+ // skip smarty modifier
+ continue;
+ }
+
preg_match_all('!:(' . $qstr_regexp . '|[^:]+)!', $modifier_arg_strings[$i], $match);
$modifier_args = $match[1];
***************
*** 1227,1231 ****
$map_array = 'true';
}
!
$this->_add_plugin('modifier', $modifier_name);
--- 1234,1238 ----
$map_array = 'true';
}
!
$this->_add_plugin('modifier', $modifier_name);
***************
*** 1342,1345 ****
--- 1349,1356 ----
}
break;
+
+ case 'version':
+ $compiled_ref = "'$this->_version'";
+ break;
default:
View Statistics - Next Notice - Previous Notice
| Visit Developer Site - Browse CVS Repository |
Syndicate via backend.rss (max. once per hour please) | Powered by CVSNotice 0.1.3 |