├── bin └── fis-pc ├── .npmignore ├── test ├── util │ └── diff │ │ ├── old_fis_ready.sh │ │ ├── start.sh │ │ ├── new_fis_ready.sh │ │ ├── diffall.class.php │ │ ├── product_code.sh │ │ ├── result │ │ ├── productsdiff.tpl │ │ ├── diffdetails.tpl │ │ └── difflist.tpl │ │ ├── inline_diff │ │ ├── inline_function.php │ │ └── inline_renderer.php │ │ ├── config.php │ │ └── release.sh └── libs │ └── smarty-3.1.5 │ ├── plugins │ ├── modifiercompiler.noprint.php │ ├── variablefilter.htmlspecialchars.php │ ├── modifiercompiler.string_format.php │ ├── modifiercompiler.cat.php │ ├── modifiercompiler.count_paragraphs.php │ ├── modifier.spacify.php │ ├── modifiercompiler.count_sentences.php │ ├── modifiercompiler.indent.php │ ├── modifiercompiler.strip_tags.php │ ├── modifiercompiler.upper.php │ ├── modifiercompiler.lower.php │ ├── modifiercompiler.strip.php │ ├── modifiercompiler.default.php │ ├── modifiercompiler.to_charset.php │ ├── modifiercompiler.from_charset.php │ ├── modifier.replace.php │ ├── modifiercompiler.count_characters.php │ ├── modifiercompiler.count_words.php │ ├── shared.literal_compiler_param.php │ ├── shared.make_timestamp.php │ ├── modifiercompiler.unescape.php │ ├── shared.mb_unicode.php │ ├── modifier.regex_replace.php │ ├── modifiercompiler.wordwrap.php │ ├── shared.escape_special_chars.php │ ├── shared.mb_str_replace.php │ ├── function.counter.php │ ├── modifier.date_format.php │ ├── modifier.truncate.php │ ├── modifier.capitalize.php │ ├── shared.mb_wordwrap.php │ ├── function.math.php │ ├── outputfilter.trimwhitespace.php │ ├── modifiercompiler.escape.php │ ├── function.cycle.php │ ├── block.textformat.php │ ├── modifier.debug_print_var.php │ └── function.html_image.php │ ├── sysplugins │ ├── smarty_resource_recompiled.php │ ├── smarty_internal_get_include_path.php │ ├── smarty_internal_compile_ldelim.php │ ├── smarty_internal_compile_rdelim.php │ ├── smarty_internal_compile_debug.php │ ├── smarty_resource_uncompiled.php │ ├── smarty_internal_compile_append.php │ ├── smarty_internal_nocache_insert.php │ ├── smarty_internal_compile_nocache.php │ ├── smarty_internal_write_file.php │ ├── smarty_internal_compile_eval.php │ ├── smarty_internal_compile_setfilter.php │ ├── smarty_internal_compile_private_function_plugin.php │ ├── smarty_internal_resource_stream.php │ ├── smarty_internal_compile_break.php │ ├── smarty_internal_compile_continue.php │ ├── smarty_internal_function_call_handler.php │ ├── smarty_internal_compile_config_load.php │ ├── smarty_internal_compile_private_object_function.php │ ├── smarty_internal_filter_handler.php │ ├── smarty_internal_resource_eval.php │ ├── smarty_internal_resource_string.php │ ├── smarty_internal_resource_file.php │ ├── smarty_internal_compile_private_registered_function.php │ ├── smarty_resource_custom.php │ ├── smarty_config_source.php │ ├── smarty_internal_resource_registered.php │ ├── smarty_internal_compile_assign.php │ ├── smarty_internal_compile_capture.php │ ├── smarty_internal_compile_private_block_plugin.php │ ├── smarty_internal_compile_include_php.php │ ├── smarty_internal_compile_private_modifier.php │ ├── smarty_internal_smartytemplatecompiler.php │ ├── smarty_internal_compile_while.php │ ├── smarty_internal_compile_private_object_block_function.php │ ├── smarty_internal_compile_private_special_variable.php │ ├── smarty_internal_resource_php.php │ ├── smarty_internal_config_file_compiler.php │ ├── smarty_internal_compile_call.php │ └── smarty_internal_compile_extends.php │ └── debug.tpl ├── package.json ├── fis-pc.js ├── CHANGELOG.md └── README.md /bin/fis-pc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | require('../fis-pc.js').cli.run(process.argv); 4 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /.settings 3 | /.project 4 | /.gitignore 5 | /node_modules 6 | /test 7 | /.tmp 8 | 9 | 10 | .DS_Store 11 | 12 | *.db 13 | *.bak 14 | *.tmp 15 | ~* 16 | 17 | upload.py -------------------------------------------------------------------------------- /test/util/diff/old_fis_ready.sh: -------------------------------------------------------------------------------- 1 | #!/home/work/.jumbo/bin/expect 2 | 3 | set timeout 60 4 | spawn su - fis -c "sh /home/work/repos/fis2.0_pc/test/util/diff/release.sh old" 5 | expect "Password:" 6 | send cqmyg123\r 7 | expect eof 8 | exit 9 | -------------------------------------------------------------------------------- /test/util/diff/start.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | TEST_PATH=/home/work/repos/fis2.0_pc/test/util/diff 4 | cd ${TEST_PATH} 5 | if [ -f "result/report.xml" ];then 6 | rm "result/report.xml" 7 | fi 8 | sh product_code.sh 9 | sh new_fis_ready.sh 10 | chmod +x old_fis_ready.sh 11 | ./old_fis_ready.sh 12 | rm -rf result/*.html 13 | sleep 2s 14 | php -f diffall.class.php 15 | -------------------------------------------------------------------------------- /test/util/diff/new_fis_ready.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | TEST_PATH=/home/work/repos/fis2.0_pc/test/util/diff 4 | FISP_PATH=/home/work/repos/fis2.0_pc/ 5 | cd ${FISP_PATH} npm install 6 | npm install 7 | npm install fis-preprocessor-inline 8 | npm install fis-preprocessor-image-set 9 | sh ${TEST_PATH}/release.sh new 10 | -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifiercompiler.noprint.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: noprint
14 | * Purpose: return an empty string 15 | * 16 | * @author Uwe Tews 17 | * @param array $params parameters 18 | * @return string with compiled code 19 | */ 20 | function smarty_modifiercompiler_noprint($params, $compiler) 21 | { 22 | return "''"; 23 | } 24 | 25 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/variablefilter.htmlspecialchars.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifiercompiler.string_format.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: string_format
14 | * Purpose: format strings via sprintf 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.string.format.php string_format (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_string_format($params, $compiler) 22 | { 23 | return 'sprintf(' . $params[1] . ',' . $params[0] . ')'; 24 | } 25 | 26 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifiercompiler.cat.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: cat
14 | * Date: Feb 24, 2003
15 | * Purpose: catenate a value to a variable
16 | * Input: string to catenate
17 | * Example: {$var|cat:"foo"} 18 | * 19 | * @link http://smarty.php.net/manual/en/language.modifier.cat.php cat 20 | * (Smarty online manual) 21 | * @author Uwe Tews 22 | * @param array $params parameters 23 | * @return string with compiled code 24 | */ 25 | function smarty_modifiercompiler_cat($params, $compiler) 26 | { 27 | return '('.implode(').(', $params).')'; 28 | } 29 | 30 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifiercompiler.count_paragraphs.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: count_paragraphs
14 | * Purpose: count the number of paragraphs in a text 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php 17 | * count_paragraphs (Smarty online manual) 18 | * @author Uwe Tews 19 | * @param array $params parameters 20 | * @return string with compiled code 21 | */ 22 | function smarty_modifiercompiler_count_paragraphs($params, $compiler) 23 | { 24 | // count \r or \n characters 25 | return '(preg_match_all(\'#[\r\n]+#\', ' . $params[0] . ', $tmp)+1)'; 26 | } 27 | 28 | ?> -------------------------------------------------------------------------------- /test/util/diff/diffall.class.php: -------------------------------------------------------------------------------- 1 | $value){ 11 | $diff = new Diff($pro); 12 | // $diff->build(); 13 | // $diff->analyze(); 14 | $diff->Display(); 15 | $productlist[$pro]['url'] = diff::getConfig('url').str_replace("/home/work/repos/","", 16 | $smartyConfig['templatedir'].$pro."_difflist.html"); 17 | } 18 | $smarty = new Smarty(); 19 | $smarty->assign('productsdiff',$productlist); 20 | $html = $smarty->fetch($smartyConfig['templatedir']."/productsdiff.tpl"); 21 | File::write($smartyConfig['templatedir']."productsdiff.html",$html); -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifier.spacify.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: spacify
13 | * Purpose: add spaces between characters in a string 14 | * 15 | * @link http://smarty.php.net/manual/en/language.modifier.spacify.php spacify (Smarty online manual) 16 | * @author Monte Ohrt 17 | * @param string $string input string 18 | * @param string $spacify_char string to insert between characters. 19 | * @return string 20 | */ 21 | function smarty_modifier_spacify($string, $spacify_char = ' ') 22 | { 23 | // well… what about charsets besides latin and UTF-8? 24 | return implode($spacify_char, preg_split('//u', $string, -1, PREG_SPLIT_NO_EMPTY)); 25 | } 26 | 27 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifiercompiler.count_sentences.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: count_sentences 14 | * Purpose: count the number of sentences in a text 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php 17 | * count_sentences (Smarty online manual) 18 | * @author Uwe Tews 19 | * @param array $params parameters 20 | * @return string with compiled code 21 | */ 22 | function smarty_modifiercompiler_count_sentences($params, $compiler) 23 | { 24 | // find periods, question marks, exclamation marks with a word before but not after. 25 | return 'preg_match_all("#\w[\.\?\!](\W|$)#uS", ' . $params[0] . ', $tmp)'; 26 | } 27 | 28 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifiercompiler.indent.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: indent
13 | * Purpose: indent lines of text 14 | * 15 | * @link http://www.smarty.net/manual/en/language.modifier.indent.php indent (Smarty online manual) 16 | * @author Uwe Tews 17 | * @param array $params parameters 18 | * @return string with compiled code 19 | */ 20 | 21 | function smarty_modifiercompiler_indent($params, $compiler) 22 | { 23 | if (!isset($params[1])) { 24 | $params[1] = 4; 25 | } 26 | if (!isset($params[2])) { 27 | $params[2] = "' '"; 28 | } 29 | return 'preg_replace(\'!^!m\',str_repeat(' . $params[2] . ',' . $params[1] . '),' . $params[0] . ')'; 30 | } 31 | 32 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifiercompiler.strip_tags.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: strip_tags
14 | * Purpose: strip html tags from text 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.strip.tags.php strip_tags (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_strip_tags($params, $compiler) 22 | { 23 | if (!isset($params[1])) { 24 | $params[1] = true; 25 | } 26 | if ($params[1] === true) { 27 | return "preg_replace('!<[^>]*?>!', ' ', {$params[0]})"; 28 | } else { 29 | return 'strip_tags(' . $params[0] . ')'; 30 | } 31 | } 32 | 33 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifiercompiler.upper.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: lower
14 | * Purpose: convert string to uppercase 15 | * 16 | * @link http://smarty.php.net/manual/en/language.modifier.upper.php lower (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_upper($params, $compiler) 22 | { 23 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 24 | return 'mb_strtoupper(' . $params[0] . ',SMARTY_RESOURCE_CHAR_SET)' ; 25 | } 26 | // no MBString fallback 27 | return 'strtoupper(' . $params[0] . ')'; 28 | } 29 | 30 | ?> -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fis-pc", 3 | "version": "0.4.6", 4 | "description": "Front End Integrated Solution for PC", 5 | "main": "fis-pc.js", 6 | "bin": { 7 | "fis-pc": "bin/fis-pc", 8 | "fisp": "bin/fis-pc" 9 | }, 10 | "scripts": { 11 | "test": "echo \"Error: no test specified\" && exit 1" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/xiangshouding/fis-pc.git" 16 | }, 17 | "dependencies": { 18 | "fis": "1.4.19", 19 | "fis-preprocessor-extlang": "0.0.6", 20 | "fis-preprocessor-widget-inline": "0.0.6", 21 | "fis-postprocessor-require-async": "0.0.6", 22 | "fis-optimizer-smarty-xss": "0.0.8", 23 | "fis-optimizer-html-compress": "0.0.7", 24 | "fis-parser-bdtmpl": "0.0.3", 25 | "fis-parser-less": "0.0.8" 26 | }, 27 | "keywords": [ 28 | "fis", 29 | "fis-pc" 30 | ], 31 | "author": "fis", 32 | "license": "MIT" 33 | } 34 | -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifiercompiler.lower.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: lower
13 | * Purpose: convert string to lowercase 14 | * 15 | * @link http://www.smarty.net/manual/en/language.modifier.lower.php lower (Smarty online manual) 16 | * @author Monte Ohrt 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | 22 | function smarty_modifiercompiler_lower($params, $compiler) 23 | { 24 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 25 | return 'mb_strtolower(' . $params[0] . ',SMARTY_RESOURCE_CHAR_SET)' ; 26 | } 27 | // no MBString fallback 28 | return 'strtolower(' . $params[0] . ')'; 29 | } 30 | 31 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifiercompiler.strip.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: strip
14 | * Purpose: Replace all repeated spaces, newlines, tabs 15 | * with a single space or supplied replacement string.
16 | * Example: {$var|strip} {$var|strip:" "}
17 | * Date: September 25th, 2002 18 | * 19 | * @link http://www.smarty.net/manual/en/language.modifier.strip.php strip (Smarty online manual) 20 | * @author Uwe Tews 21 | * @param array $params parameters 22 | * @return string with compiled code 23 | */ 24 | 25 | function smarty_modifiercompiler_strip($params, $compiler) 26 | { 27 | if (!isset($params[1])) { 28 | $params[1] = "' '"; 29 | } 30 | return "preg_replace('!\s+!u', {$params[1]},{$params[0]})"; 31 | } 32 | 33 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifiercompiler.default.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: default
14 | * Purpose: designate default value for empty variables 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.default.php default (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_default ($params, $compiler) 22 | { 23 | $output = $params[0]; 24 | if (!isset($params[1])) { 25 | $params[1] = "''"; 26 | } 27 | 28 | array_shift($params); 29 | foreach ($params as $param) { 30 | $output = '(($tmp = @' . $output . ')===null||$tmp===\'\' ? ' . $param . ' : $tmp)'; 31 | } 32 | return $output; 33 | } 34 | 35 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifiercompiler.to_charset.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: to_charset
14 | * Purpose: convert character encoding from internal encoding to $charset 15 | * 16 | * @author Rodney Rehm 17 | * @param array $params parameters 18 | * @return string with compiled code 19 | */ 20 | function smarty_modifiercompiler_to_charset($params, $compiler) 21 | { 22 | if (!SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 23 | // FIXME: (rodneyrehm) shouldn't this throw an error? 24 | return $params[0]; 25 | } 26 | 27 | if (!isset($params[1])) { 28 | $params[1] = '"ISO-8859-1"'; 29 | } 30 | 31 | return 'mb_convert_encoding(' . $params[0] . ', ' . $params[1] . ', SMARTY_RESOURCE_CHAR_SET)'; 32 | } 33 | 34 | ?> -------------------------------------------------------------------------------- /test/util/diff/product_code.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | TEST_PATH=/home/work/repos/fis2.0_pc/test/util/diff 4 | cd ${TEST_PATH} 5 | 6 | PLACE_SVN=https://svn.baidu.com/app/search/lbs-webapp/trunk/pcmap/place 7 | PLACE_DIR=./product_code/place 8 | 9 | BATMAN_SVN=https://svn.baidu.com/app/search/lbs-webapp/trunk/mmap/batman 10 | BATMAN_DIR=./product_code/batman 11 | 12 | WENKU_SVN=https://svn.baidu.com/app/search/wenku/branches/fe/bookeditor/wenku_1001-0-253_BRANCH 13 | WENKU_DIR=./product_code/wenku 14 | 15 | TIEBA_SVN=https://svn.baidu.com/app/search/forum/branches/fe/pad/xpad/pb/xpadpb_1-0-0_BRANCH 16 | TIEBA_DIR=./product_code/tieba 17 | 18 | svn co --username=tianlili --password=tianlili --no-auth-cache ${PLACE_SVN} ${PLACE_DIR} 19 | svn co --username=tianlili --password=tianlili --no-auth-cache ${BATMAN_SVN} ${BATMAN_DIR} 20 | svn co --username=tianlili --password=tianlili --no-auth-cache ${WENKU_SVN} ${WENKU_DIR} 21 | svn co --username=tianlili --password=tianlili --no-auth-cache ${TIEBA_SVN} ${TIEBA_DIR} 22 | -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifiercompiler.from_charset.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: from_charset
14 | * Purpose: convert character encoding from $charset to internal encoding 15 | * 16 | * @author Rodney Rehm 17 | * @param array $params parameters 18 | * @return string with compiled code 19 | */ 20 | function smarty_modifiercompiler_from_charset($params, $compiler) 21 | { 22 | if (!SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 23 | // FIXME: (rodneyrehm) shouldn't this throw an error? 24 | return $params[0]; 25 | } 26 | 27 | if (!isset($params[1])) { 28 | $params[1] = '"ISO-8859-1"'; 29 | } 30 | 31 | return 'mb_convert_encoding(' . $params[0] . ', SMARTY_RESOURCE_CHAR_SET, ' . $params[1] . ')'; 32 | } 33 | 34 | ?> -------------------------------------------------------------------------------- /test/util/diff/result/productsdiff.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | diff file list 6 | 19 | 20 | 21 | 22 |

product difflist info:

23 | 24 | 25 | 26 | 27 | 28 | {foreach $productsdiff as $value} 29 | 30 | 31 | 32 | 33 | 34 | {/foreach} 35 |
product namediff result
{$value.name}click here >>
36 |

 

37 |

 

38 |

 

39 | 40 | 41 | -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_resource_recompiled.php: -------------------------------------------------------------------------------- 1 | filepath = false; 30 | $compiled->timestamp = false; 31 | $compiled->exists = false; 32 | } 33 | 34 | } 35 | 36 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifier.replace.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: replace
13 | * Purpose: simple search/replace 14 | * 15 | * @link http://smarty.php.net/manual/en/language.modifier.replace.php replace (Smarty online manual) 16 | * @author Monte Ohrt 17 | * @author Uwe Tews 18 | * @param string $string input string 19 | * @param string $search text to search for 20 | * @param string $replace replacement text 21 | * @return string 22 | */ 23 | function smarty_modifier_replace($string, $search, $replace) 24 | { 25 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 26 | require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php'); 27 | return smarty_mb_str_replace($search, $replace, $string); 28 | } 29 | 30 | return str_replace($search, $replace, $string); 31 | } 32 | 33 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_get_include_path.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifiercompiler.count_characters.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: count_characteres
14 | * Purpose: count the number of characters in a text 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.count.characters.php count_characters (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_count_characters($params, $compiler) 22 | { 23 | if (!isset($params[1]) || $params[1] != 'true') { 24 | return 'preg_match_all(\'/[^\s]/u\',' . $params[0] . ', $tmp)'; 25 | } 26 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 27 | return 'mb_strlen(' . $params[0] . ', SMARTY_RESOURCE_CHAR_SET)'; 28 | } 29 | // no MBString fallback 30 | return 'strlen(' . $params[0] . ')'; 31 | } 32 | 33 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifiercompiler.count_words.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: count_words
14 | * Purpose: count the number of words in a text 15 | * 16 | * @link http://www.smarty.net/manual/en/language.modifier.count.words.php count_words (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_count_words($params, $compiler) 22 | { 23 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 24 | // return 'preg_match_all(\'#[\w\pL]+#u\', ' . $params[0] . ', $tmp)'; 25 | // expression taken from http://de.php.net/manual/en/function.str-word-count.php#85592 26 | return 'preg_match_all(\'/\p{L}[\p{L}\p{Mn}\p{Pd}\\\'\x{2019}]*/u\', ' . $params[0] . ', $tmp)'; 27 | } 28 | // no MBString fallback 29 | return 'str_word_count(' . $params[0] . ')'; 30 | } 31 | 32 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/shared.literal_compiler_param.php: -------------------------------------------------------------------------------- 1 | getAttributes($compiler, $args); 31 | if ($_attr['nocache'] === true) { 32 | $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); 33 | } 34 | // this tag does not return compiled code 35 | $compiler->has_code = true; 36 | return $compiler->smarty->left_delimiter; 37 | } 38 | 39 | } 40 | 41 | ?> 42 | -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_rdelim.php: -------------------------------------------------------------------------------- 1 | getAttributes($compiler, $args); 31 | if ($_attr['nocache'] === true) { 32 | $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); 33 | } 34 | // this tag does not return compiled code 35 | $compiler->has_code = true; 36 | return $compiler->smarty->right_delimiter; 37 | } 38 | 39 | } 40 | 41 | ?> -------------------------------------------------------------------------------- /test/util/diff/result/diffdetails.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | diff details 6 | 20 | 21 | 22 | 23 |

 

24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 40 | 41 |
红色代表老版本编译后的结果{$old}
绿色代表新版本编译后的结果{$new}
diff details
36 |

37 | {$diffdata} 38 |

39 |
42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_debug.php: -------------------------------------------------------------------------------- 1 | getAttributes($compiler, $args); 32 | 33 | // compile always as nocache 34 | $compiler->tag_nocache = true; 35 | 36 | // display debug template 37 | $_output = "smarty->loadPlugin('Smarty_Internal_Debug'); Smarty_Internal_Debug::display_debug(\$_smarty_tpl); ?>"; 38 | return $_output; 39 | } 40 | 41 | } 42 | 43 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_resource_uncompiled.php: -------------------------------------------------------------------------------- 1 | filepath = false; 38 | $compiled->timestamp = false; 39 | $compiled->exists = false; 40 | } 41 | 42 | } 43 | 44 | ?> -------------------------------------------------------------------------------- /test/util/diff/result/difflist.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | diff file list 6 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 48 | 49 |
{$productname} diff info:
33 | 34 | 35 | 36 | 37 | 38 | 39 | {foreach $difflist as $value} 40 | 41 | 42 | 43 | 44 | 45 | {/foreach} 46 |
file name new({$newversion}) old({$oldversion})
{$value.name}{$value.new}{$value.old}
47 |
50 | 51 | 52 | -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/shared.make_timestamp.php: -------------------------------------------------------------------------------- 1 | 11 | * Purpose: used by other smarty functions to make a timestamp from a string. 12 | * 13 | * @author Monte Ohrt 14 | * @param DateTime|int|string $string date object, timestamp or string that can be converted using strtotime() 15 | * @return int 16 | */ 17 | function smarty_make_timestamp($string) 18 | { 19 | if (empty($string)) { 20 | // use "now": 21 | return time(); 22 | } elseif ($string instanceof DateTime) { 23 | return $string->getTimestamp(); 24 | } elseif (strlen($string) == 14 && ctype_digit($string)) { 25 | // it is mysql timestamp format of YYYYMMDDHHMMSS? 26 | return mktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2), 27 | substr($string, 4, 2),substr($string, 6, 2),substr($string, 0, 4)); 28 | } elseif (is_numeric($string)) { 29 | // it is a numeric string, we handle it as timestamp 30 | return (int) $string; 31 | } else { 32 | // strtotime should handle it 33 | $time = strtotime($string); 34 | if ($time == -1 || $time === false) { 35 | // strtotime() was not able to parse $string, use "now": 36 | return time(); 37 | } 38 | return $time; 39 | } 40 | } 41 | 42 | ?> 43 | -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifiercompiler.unescape.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: unescape
14 | * Purpose: unescape html entities 15 | * 16 | * @author Rodney Rehm 17 | * @param array $params parameters 18 | * @return string with compiled code 19 | */ 20 | function smarty_modifiercompiler_unescape($params, $compiler) 21 | { 22 | if (!isset($params[1])) { 23 | $params[1] = 'html'; 24 | } 25 | if (!isset($params[2])) { 26 | $params[2] = "SMARTY_RESOURCE_CHAR_SET"; 27 | } else { 28 | $params[2] = "'" . $params[2] . "'"; 29 | } 30 | 31 | switch (trim($params[1], '"\'')) { 32 | case 'entity': 33 | return 'mb_convert_encoding(' . $params[0] . ', ' . $params[2] . ', \'HTML-ENTITIES\')'; 34 | case 'htmlall': 35 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 36 | return 'mb_convert_encoding(' . $params[0] . ', ' . $params[2] . ', \'HTML-ENTITIES\')'; 37 | } 38 | return 'html_entity_decode(' . $params[0] . ', ENT_QUOTES, ' . $params[2] . ')'; 39 | 40 | case 'html': 41 | return 'htmlspecialchars_decode(' . $params[0] . ', ENT_QUOTES)'; 42 | 43 | default: 44 | return $params[0]; 45 | } 46 | } 47 | 48 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/shared.mb_unicode.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifier.regex_replace.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: regex_replace
14 | * Purpose: regular expression search/replace 15 | * 16 | * @link http://smarty.php.net/manual/en/language.modifier.regex.replace.php 17 | * regex_replace (Smarty online manual) 18 | * @author Monte Ohrt 19 | * @param string $string input string 20 | * @param string|array $search regular expression(s) to search for 21 | * @param string|array $replace string(s) that should be replaced 22 | * @return string 23 | */ 24 | function smarty_modifier_regex_replace($string, $search, $replace) 25 | { 26 | if(is_array($search)) { 27 | foreach($search as $idx => $s) { 28 | $search[$idx] = _smarty_regex_replace_check($s); 29 | } 30 | } else { 31 | $search = _smarty_regex_replace_check($search); 32 | } 33 | return preg_replace($search, $replace, $string); 34 | } 35 | 36 | /** 37 | * @param string $search string(s) that should be replaced 38 | * @return string 39 | * @ignore 40 | */ 41 | function _smarty_regex_replace_check($search) 42 | { 43 | // null-byte injection detection 44 | // anything behind the first null-byte is ignored 45 | if (($pos = strpos($search,"\0")) !== false) { 46 | $search = substr($search,0,$pos); 47 | } 48 | // remove eval-modifier from $search 49 | if (preg_match('!([a-zA-Z\s]+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) { 50 | $search = substr($search, 0, -strlen($match[1])) . preg_replace('![e\s]+!', '', $match[1]); 51 | } 52 | return $search; 53 | } 54 | 55 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_append.php: -------------------------------------------------------------------------------- 1 | required_attributes = array('var', 'value'); 32 | $this->shorttag_order = array('var', 'value'); 33 | $this->optional_attributes = array('scope', 'index'); 34 | // check and get attributes 35 | $_attr = $this->getAttributes($compiler, $args); 36 | // map to compile assign attributes 37 | if (isset($_attr['index'])) { 38 | $_params['smarty_internal_index'] = '[' . $_attr['index'] . ']'; 39 | unset($_attr['index']); 40 | } else { 41 | $_params['smarty_internal_index'] = '[]'; 42 | } 43 | $_new_attr = array(); 44 | foreach ($_attr as $key => $value) { 45 | $_new_attr[] = array($key => $value); 46 | } 47 | // call compile assign 48 | return parent::compile($_new_attr, $compiler, $_params); 49 | } 50 | 51 | } 52 | 53 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifiercompiler.wordwrap.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: wordwrap
14 | * Purpose: wrap a string of text at a given length 15 | * 16 | * @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php wordwrap (Smarty online manual) 17 | * @author Uwe Tews 18 | * @param array $params parameters 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_wordwrap($params, $compiler) 22 | { 23 | if (!isset($params[1])) { 24 | $params[1] = 80; 25 | } 26 | if (!isset($params[2])) { 27 | $params[2] = '"\n"'; 28 | } 29 | if (!isset($params[3])) { 30 | $params[3] = 'false'; 31 | } 32 | $function = 'wordwrap'; 33 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 34 | if ($compiler->tag_nocache | $compiler->nocache) { 35 | $compiler->template->required_plugins['nocache']['wordwrap']['modifier']['file'] = SMARTY_PLUGINS_DIR .'shared.mb_wordwrap.php'; 36 | $compiler->template->required_plugins['nocache']['wordwrap']['modifier']['function'] = 'smarty_mb_wordwrap'; 37 | } else { 38 | $compiler->template->required_plugins['compiled']['wordwrap']['modifier']['file'] = SMARTY_PLUGINS_DIR .'shared.mb_wordwrap.php'; 39 | $compiler->template->required_plugins['compiled']['wordwrap']['modifier']['function'] = 'smarty_mb_wordwrap'; 40 | } 41 | $function = 'smarty_mb_wordwrap'; 42 | } 43 | return $function . '(' . $params[0] . ',' . $params[1] . ',' . $params[2] . ',' . $params[3] . ')'; 44 | } 45 | 46 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/shared.escape_special_chars.php: -------------------------------------------------------------------------------- 1 | =')) { 10 | /** 11 | * escape_special_chars common function 12 | * 13 | * Function: smarty_function_escape_special_chars
14 | * Purpose: used by other smarty functions to escape 15 | * special chars except for already escaped ones 16 | * 17 | * @author Monte Ohrt 18 | * @param string $string text that should by escaped 19 | * @return string 20 | */ 21 | function smarty_function_escape_special_chars($string) 22 | { 23 | if (!is_array($string)) { 24 | $string = htmlspecialchars($string, ENT_COMPAT, SMARTY_RESOURCE_CHAR_SET, false); 25 | } 26 | return $string; 27 | } 28 | } else { 29 | /** 30 | * escape_special_chars common function 31 | * 32 | * Function: smarty_function_escape_special_chars
33 | * Purpose: used by other smarty functions to escape 34 | * special chars except for already escaped ones 35 | * 36 | * @author Monte Ohrt 37 | * @param string $string text that should by escaped 38 | * @return string 39 | */ 40 | function smarty_function_escape_special_chars($string) 41 | { 42 | if (!is_array($string)) { 43 | $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); 44 | $string = htmlspecialchars($string); 45 | $string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string); 46 | } 47 | return $string; 48 | } 49 | } 50 | 51 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_nocache_insert.php: -------------------------------------------------------------------------------- 1 | assign('{$_assign}' , {$_function} (" . var_export($_attr, true) . ",\$_smarty_tpl), true);?>"; 41 | } else { 42 | $_output .= "echo {$_function}(" . var_export($_attr, true) . ",\$_smarty_tpl);?>"; 43 | } 44 | $_tpl = $_template; 45 | while ($_tpl->parent instanceof Smarty_Internal_Template) { 46 | $_tpl = $_tpl->parent; 47 | } 48 | return "/*%%SmartyNocache:{$_tpl->properties['nocache_hash']}%%*/" . $_output . "/*/%%SmartyNocache:{$_tpl->properties['nocache_hash']}%%*/"; 49 | } 50 | 51 | } 52 | 53 | ?> 54 | -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/shared.mb_str_replace.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/util/diff/inline_diff/inline_function.php: -------------------------------------------------------------------------------- 1 | render($diff); 63 | } -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/function.counter.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: counter
13 | * Purpose: print out a counter value 14 | * 15 | * @author Monte Ohrt 16 | * @link http://www.smarty.net/manual/en/language.function.counter.php {counter} 17 | * (Smarty online manual) 18 | * @param array $params parameters 19 | * @param Smarty_Internal_Template $template template object 20 | * @return string|null 21 | */ 22 | function smarty_function_counter($params, $template) 23 | { 24 | static $counters = array(); 25 | 26 | $name = (isset($params['name'])) ? $params['name'] : 'default'; 27 | if (!isset($counters[$name])) { 28 | $counters[$name] = array( 29 | 'start'=>1, 30 | 'skip'=>1, 31 | 'direction'=>'up', 32 | 'count'=>1 33 | ); 34 | } 35 | $counter =& $counters[$name]; 36 | 37 | if (isset($params['start'])) { 38 | $counter['start'] = $counter['count'] = (int)$params['start']; 39 | } 40 | 41 | if (!empty($params['assign'])) { 42 | $counter['assign'] = $params['assign']; 43 | } 44 | 45 | if (isset($counter['assign'])) { 46 | $template->assign($counter['assign'], $counter['count']); 47 | } 48 | 49 | if (isset($params['print'])) { 50 | $print = (bool)$params['print']; 51 | } else { 52 | $print = empty($counter['assign']); 53 | } 54 | 55 | if ($print) { 56 | $retval = $counter['count']; 57 | } else { 58 | $retval = null; 59 | } 60 | 61 | if (isset($params['skip'])) { 62 | $counter['skip'] = $params['skip']; 63 | } 64 | 65 | if (isset($params['direction'])) { 66 | $counter['direction'] = $params['direction']; 67 | } 68 | 69 | if ($counter['direction'] == "down") 70 | $counter['count'] -= $counter['skip']; 71 | else 72 | $counter['count'] += $counter['skip']; 73 | 74 | return $retval; 75 | 76 | } 77 | 78 | ?> -------------------------------------------------------------------------------- /test/util/diff/config.php: -------------------------------------------------------------------------------- 1 | array( //产品线目录 12 | 'wenku'=>array( 13 | 'name'=>'wenku', 14 | 'newoutputdir' => WENKU_PATH.'output_new', //使用新版本编译后的产出 15 | 'oldoutputdir' => WENKU_PATH.'output_old', //使用旧版本编译后的产出 16 | "modules" =>"bookeditor", //待编译的模块 17 | 'result' => WENKU_PATH.'result/' 18 | ), 19 | 'batman'=>array( 20 | 'name'=>'batman', 21 | 'newoutputdir' => BATMAN_PATH.'output_new', //使用新版本编译后的产出 22 | 'oldoutputdir' => BATMAN_PATH.'output_old', //使用旧版本编译后的产出 23 | "modules" =>"transit,place,common,index,addr,feedback,drive,walk", //待编译的模块 24 | 'result' => BATMAN_PATH.'result/' 25 | ), 26 | 'tieba'=>array( 27 | 'name'=>'tieba', 28 | 'newoutputdir' => TIEBA_PATH.'output_new', //使用新版本编译后的产出 29 | 'oldoutputdir' => TIEBA_PATH.'output_old', //使用旧版本编译后的产出 30 | "modules" =>"xpb", //待编译的模块 31 | 'result' => TIEBA_PATH.'result/' 32 | ), 33 | 'place'=>array( 34 | 'name'=>'place', 35 | 'newoutputdir' => PLACE_PATH.'output_new', //使用新版本编译后的产出 36 | 'oldoutputdir' => PLACE_PATH.'output_old', //使用旧版本编译后的产出 37 | "modules" =>"admin,beauty,cater,common,detail,hotel,movie,scope", //待编译的模块 38 | 'result' => PLACE_PATH.'result/' 39 | ) 40 | ), 41 | 'smarty' => array( 42 | 'dir' => DIFF_ROOT_PATH.'../../libs/smarty-3.1.5', 43 | 'templatedir' =>DIFF_ROOT_PATH. 'result/' 44 | ), 45 | 'url' =>"http://10.48.30.87:8088/" 46 | ); -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_nocache.php: -------------------------------------------------------------------------------- 1 | getAttributes($compiler, $args); 32 | if ($_attr['nocache'] === true) { 33 | $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); 34 | } 35 | // enter nocache mode 36 | $compiler->nocache = true; 37 | // this tag does not return compiled code 38 | $compiler->has_code = false; 39 | return true; 40 | } 41 | 42 | } 43 | 44 | /** 45 | * Smarty Internal Plugin Compile Nocacheclose Class 46 | * 47 | * @package Smarty 48 | * @subpackage Compiler 49 | */ 50 | class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase { 51 | 52 | /** 53 | * Compiles code for the {/nocache} tag 54 | * 55 | * This tag does not generate compiled output. It only sets a compiler flag. 56 | * 57 | * @param array $args array with attributes from parser 58 | * @param object $compiler compiler object 59 | * @return bool 60 | */ 61 | public function compile($args, $compiler) 62 | { 63 | $_attr = $this->getAttributes($compiler, $args); 64 | // leave nocache mode 65 | $compiler->nocache = false; 66 | // this tag does not return compiled code 67 | $compiler->has_code = false; 68 | return true; 69 | } 70 | 71 | } 72 | 73 | ?> -------------------------------------------------------------------------------- /test/util/diff/inline_diff/inline_renderer.php: -------------------------------------------------------------------------------- 1 | '; 18 | var $ins_suffix = ''; 19 | var $del_prefix = '
'; 20 | var $del_suffix = '
'; 21 | 22 | function Text_Diff_Renderer_inline($context_lines = 10000, $ins_prefix = '
', $ins_suffix = '
', $del_prefix = '
', $del_suffix = '
') 23 | { 24 | $this->$ins_prefix = $ins_prefix; 25 | $this->$ins_suffix = $ins_suffix; 26 | $this->$del_prefix = $del_prefix; 27 | $this->$del_suffix = $del_suffix; 28 | 29 | $this->_leading_context_lines = $context_lines; 30 | $this->_trailing_context_lines = $context_lines; 31 | } 32 | 33 | function _lines($lines) 34 | { 35 | $value=""; 36 | foreach ($lines as $line) { 37 | $value.="$line "; 38 | // FIXME: don't output space if it's the last line. 39 | } 40 | return "".$value.""; 41 | } 42 | 43 | function _blockHeader($xbeg, $xlen, $ybeg, $ylen) 44 | { 45 | return ''; 46 | } 47 | 48 | function _startBlock($header) 49 | { 50 | return $header; 51 | } 52 | 53 | function _context($lines) 54 | { 55 | return $this->_lines($lines, ' '); 56 | } 57 | function _added($lines) 58 | { 59 | return $this->ins_prefix.$this->_lines($lines).$this->ins_suffix; 60 | } 61 | 62 | function _deleted($lines) 63 | { 64 | return $this->del_prefix.$this->_lines($lines).$this->del_suffix; 65 | } 66 | 67 | function _changed($orig, $final) 68 | { 69 | return "

".$this->_deleted($orig) ."

". $this->_added($final)."

"; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_write_file.php: -------------------------------------------------------------------------------- 1 | _file_perms !== null) { 31 | $old_umask = umask(0); 32 | } 33 | 34 | $_dirpath = dirname($_filepath); 35 | // if subdirs, create dir structure 36 | if ($_dirpath !== '.' && !file_exists($_dirpath)) { 37 | mkdir($_dirpath, $smarty->_dir_perms === null ? 0777 : $smarty->_dir_perms, true); 38 | } 39 | 40 | // write to tmp file, then move to overt file lock race condition 41 | $_tmp_file = $_dirpath . DS . uniqid('wrt'); 42 | if (!file_put_contents($_tmp_file, $_contents)) { 43 | error_reporting($_error_reporting); 44 | throw new SmartyException("unable to write file {$_tmp_file}"); 45 | return false; 46 | } 47 | 48 | // remove original file 49 | @unlink($_filepath); 50 | 51 | // rename tmp file 52 | $success = rename($_tmp_file, $_filepath); 53 | if (!$success) { 54 | error_reporting($_error_reporting); 55 | throw new SmartyException("unable to write file {$_filepath}"); 56 | return false; 57 | } 58 | 59 | if ($smarty->_file_perms !== null) { 60 | // set file permissions 61 | chmod($_filepath, $smarty->_file_perms); 62 | umask($old_umask); 63 | } 64 | error_reporting($_error_reporting); 65 | return true; 66 | } 67 | 68 | } 69 | 70 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_eval.php: -------------------------------------------------------------------------------- 1 | required_attributes = array('var'); 52 | $this->optional_attributes = array('assign'); 53 | // check and get attributes 54 | $_attr = $this->getAttributes($compiler, $args); 55 | if (isset($_attr['assign'])) { 56 | // output will be stored in a smarty variable instead of beind displayed 57 | $_assign = $_attr['assign']; 58 | } 59 | 60 | // create template object 61 | $_output = "\$_template = new {$compiler->smarty->template_class}('eval:'.".$_attr['var'].", \$_smarty_tpl->smarty, \$_smarty_tpl);"; 62 | //was there an assign attribute? 63 | if (isset($_assign)) { 64 | $_output .= "\$_smarty_tpl->assign($_assign,\$_template->fetch());"; 65 | } else { 66 | $_output .= "echo \$_template->fetch();"; 67 | } 68 | return ""; 69 | } 70 | 71 | } 72 | 73 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_setfilter.php: -------------------------------------------------------------------------------- 1 | variable_filter_stack[] = $compiler->template->variable_filters; 31 | $compiler->template->variable_filters = $parameter['modifier_list']; 32 | // this tag does not return compiled code 33 | $compiler->has_code = false; 34 | return true; 35 | } 36 | 37 | } 38 | 39 | /** 40 | * Smarty Internal Plugin Compile Setfilterclose Class 41 | * 42 | * @package Smarty 43 | * @subpackage Compiler 44 | */ 45 | class Smarty_Internal_Compile_Setfilterclose extends Smarty_Internal_CompileBase { 46 | 47 | /** 48 | * Compiles code for the {/setfilter} tag 49 | * 50 | * This tag does not generate compiled output. It resets variable filter. 51 | * 52 | * @param array $args array with attributes from parser 53 | * @param object $compiler compiler object 54 | * @return string compiled code 55 | */ 56 | public function compile($args, $compiler) 57 | { 58 | $_attr = $this->getAttributes($compiler, $args); 59 | // reset variable filter to previous state 60 | if (count($compiler->variable_filter_stack)) { 61 | $compiler->template->variable_filters = array_pop($compiler->variable_filter_stack); 62 | } else { 63 | $compiler->template->variable_filters = array(); 64 | } 65 | // this tag does not return compiled code 66 | $compiler->has_code = false; 67 | return true; 68 | } 69 | 70 | } 71 | 72 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_private_function_plugin.php: -------------------------------------------------------------------------------- 1 | has_output = true; 49 | 50 | // check and get attributes 51 | $_attr = $this->getAttributes($compiler, $args); 52 | if ($_attr['nocache'] === true) { 53 | $compiler->tag_nocache = true; 54 | } 55 | unset($_attr['nocache']); 56 | // convert attributes into parameter array string 57 | $_paramsArray = array(); 58 | foreach ($_attr as $_key => $_value) { 59 | if (is_int($_key)) { 60 | $_paramsArray[] = "$_key=>$_value"; 61 | } else { 62 | $_paramsArray[] = "'$_key'=>$_value"; 63 | } 64 | } 65 | $_params = 'array(' . implode(",", $_paramsArray) . ')'; 66 | // compile code 67 | $output = "\n"; 68 | return $output; 69 | } 70 | 71 | } 72 | 73 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifier.date_format.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: date_format
14 | * Purpose: format datestamps via strftime
15 | * Input:
16 | * - string: input date string 17 | * - format: strftime format for output 18 | * - default_date: default date if $string is empty 19 | * 20 | * @link http://www.smarty.net/manual/en/language.modifier.date.format.php date_format (Smarty online manual) 21 | * @author Monte Ohrt 22 | * @param string $string input date string 23 | * @param string $format strftime format for output 24 | * @param string $default_date default date if $string is empty 25 | * @param string $formatter either 'strftime' or 'auto' 26 | * @return string |void 27 | * @uses smarty_make_timestamp() 28 | */ 29 | function smarty_modifier_date_format($string, $format = SMARTY_RESOURCE_DATE_FORMAT, $default_date = '',$formatter='auto') 30 | { 31 | /** 32 | * Include the {@link shared.make_timestamp.php} plugin 33 | */ 34 | require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php'); 35 | if ($string != '') { 36 | $timestamp = smarty_make_timestamp($string); 37 | } elseif ($default_date != '') { 38 | $timestamp = smarty_make_timestamp($default_date); 39 | } else { 40 | return; 41 | } 42 | if($formatter=='strftime'||($formatter=='auto'&&strpos($format,'%')!==false)) { 43 | if (DS == '\\') { 44 | $_win_from = array('%D', '%h', '%n', '%r', '%R', '%t', '%T'); 45 | $_win_to = array('%m/%d/%y', '%b', "\n", '%I:%M:%S %p', '%H:%M', "\t", '%H:%M:%S'); 46 | if (strpos($format, '%e') !== false) { 47 | $_win_from[] = '%e'; 48 | $_win_to[] = sprintf('%\' 2d', date('j', $timestamp)); 49 | } 50 | if (strpos($format, '%l') !== false) { 51 | $_win_from[] = '%l'; 52 | $_win_to[] = sprintf('%\' 2d', date('h', $timestamp)); 53 | } 54 | $format = str_replace($_win_from, $_win_to, $format); 55 | } 56 | return strftime($format, $timestamp); 57 | } else { 58 | return date($format, $timestamp); 59 | } 60 | } 61 | 62 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifier.truncate.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: truncate
14 | * Purpose: Truncate a string to a certain length if necessary, 15 | * optionally splitting in the middle of a word, and 16 | * appending the $etc string or inserting $etc into the middle. 17 | * 18 | * @link http://smarty.php.net/manual/en/language.modifier.truncate.php truncate (Smarty online manual) 19 | * @author Monte Ohrt 20 | * @param string $string input string 21 | * @param integer $length length of truncated text 22 | * @param string $etc end string 23 | * @param boolean $break_words truncate at word boundary 24 | * @param boolean $middle truncate in the middle of text 25 | * @return string truncated string 26 | */ 27 | function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false) { 28 | if ($length == 0) 29 | return ''; 30 | 31 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 32 | if (mb_strlen($string, SMARTY_RESOURCE_CHAR_SET) > $length) { 33 | $length -= min($length, mb_strlen($etc, SMARTY_RESOURCE_CHAR_SET)); 34 | if (!$break_words && !$middle) { 35 | $string = preg_replace('/\s+?(\S+)?$/u', '', mb_substr($string, 0, $length + 1, SMARTY_RESOURCE_CHAR_SET)); 36 | } 37 | if (!$middle) { 38 | return mb_substr($string, 0, $length, SMARTY_RESOURCE_CHAR_SET) . $etc; 39 | } 40 | return mb_substr($string, 0, $length / 2, SMARTY_RESOURCE_CHAR_SET) . $etc . mb_substr($string, - $length / 2, $length, SMARTY_RESOURCE_CHAR_SET); 41 | } 42 | return $string; 43 | } 44 | 45 | // no MBString fallback 46 | if (isset($string[$length])) { 47 | $length -= min($length, strlen($etc)); 48 | if (!$break_words && !$middle) { 49 | $string = preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length + 1)); 50 | } 51 | if (!$middle) { 52 | return substr($string, 0, $length) . $etc; 53 | } 54 | return substr($string, 0, $length / 2) . $etc . substr($string, - $length / 2); 55 | } 56 | return $string; 57 | } 58 | 59 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_resource_stream.php: -------------------------------------------------------------------------------- 1 | filepath = str_replace(':', '://', $source->resource); 34 | $source->uid = false; 35 | $source->content = $this->getContent($source); 36 | $source->timestamp = false; 37 | $source->exists = !!$source->content; 38 | } 39 | 40 | /** 41 | * Load template's source from stream into current template object 42 | * 43 | * @param Smarty_Template_Source $source source object 44 | * @return string template source 45 | * @throws SmartyException if source cannot be loaded 46 | */ 47 | public function getContent(Smarty_Template_Source $source) 48 | { 49 | $t = ''; 50 | // the availability of the stream has already been checked in Smarty_Resource::fetch() 51 | $fp = fopen($source->filepath, 'r+'); 52 | if ($fp) { 53 | while (!feof($fp) && ($current_line = fgets($fp)) !== false) { 54 | $t .= $current_line; 55 | } 56 | fclose($fp); 57 | return $t; 58 | } else { 59 | return false; 60 | } 61 | } 62 | 63 | /** 64 | * modify resource_name according to resource handlers specifications 65 | * 66 | * @param Smarty $smarty Smarty instance 67 | * @param string $resource_name resource_name to make unique 68 | * @return string unique resource name 69 | */ 70 | protected function buildUniqueResourceName(Smarty $smarty, $resource_name) 71 | { 72 | return get_class($this) . '#' . $resource_name; 73 | } 74 | } 75 | 76 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_break.php: -------------------------------------------------------------------------------- 1 | true, 'foreach' => true, 'while' => true, 'section' => true); 45 | // check and get attributes 46 | $_attr = $this->getAttributes($compiler, $args); 47 | 48 | if ($_attr['nocache'] === true) { 49 | $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); 50 | } 51 | 52 | if (isset($_attr['levels'])) { 53 | if (!is_numeric($_attr['levels'])) { 54 | $compiler->trigger_template_error('level attribute must be a numeric constant', $compiler->lex->taglineno); 55 | } 56 | $_levels = $_attr['levels']; 57 | } else { 58 | $_levels = 1; 59 | } 60 | $level_count = $_levels; 61 | $stack_count = count($compiler->_tag_stack) - 1; 62 | while ($level_count > 0 && $stack_count >= 0) { 63 | if (isset($_is_loopy[$compiler->_tag_stack[$stack_count][0]])) { 64 | $level_count--; 65 | } 66 | $stack_count--; 67 | } 68 | if ($level_count != 0) { 69 | $compiler->trigger_template_error("cannot break {$_levels} level(s)", $compiler->lex->taglineno); 70 | } 71 | $compiler->has_code = true; 72 | return ""; 73 | } 74 | 75 | } 76 | 77 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_continue.php: -------------------------------------------------------------------------------- 1 | true, 'foreach' => true, 'while' => true, 'section' => true); 46 | // check and get attributes 47 | $_attr = $this->getAttributes($compiler, $args); 48 | 49 | if ($_attr['nocache'] === true) { 50 | $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); 51 | } 52 | 53 | if (isset($_attr['levels'])) { 54 | if (!is_numeric($_attr['levels'])) { 55 | $compiler->trigger_template_error('level attribute must be a numeric constant', $compiler->lex->taglineno); 56 | } 57 | $_levels = $_attr['levels']; 58 | } else { 59 | $_levels = 1; 60 | } 61 | $level_count = $_levels; 62 | $stack_count = count($compiler->_tag_stack) - 1; 63 | while ($level_count > 0 && $stack_count >= 0) { 64 | if (isset($_is_loopy[$compiler->_tag_stack[$stack_count][0]])) { 65 | $level_count--; 66 | } 67 | $stack_count--; 68 | } 69 | if ($level_count != 0) { 70 | $compiler->trigger_template_error("cannot continue {$_levels} level(s)", $compiler->lex->taglineno); 71 | } 72 | $compiler->has_code = true; 73 | return ""; 74 | } 75 | 76 | } 77 | 78 | ?> -------------------------------------------------------------------------------- /fis-pc.js: -------------------------------------------------------------------------------- 1 | var fis = module.exports = require('fis'); 2 | 3 | fis.cli.name = "fis-pc"; 4 | fis.cli.info = fis.util.readJSON(__dirname + '/package.json'); 5 | 6 | fis.config.merge({ 7 | modules : { 8 | parser : { 9 | less : 'less', 10 | tmpl: 'bdtmpl' 11 | }, 12 | preprocessor: { 13 | tpl: 'widget-inline, extlang' 14 | }, 15 | postprocessor: { 16 | tpl: 'require-async', 17 | js: 'jswrapper, require-async' 18 | }, 19 | optimizer : { 20 | tpl : 'smarty-xss,html-compress' 21 | } 22 | }, 23 | roadmap : { 24 | ext : { 25 | less : 'css', 26 | tmpl : 'js' 27 | }, 28 | path : [ 29 | { 30 | reg : /^\/widget\/(.*\.tpl)$/i, 31 | isMod : true, 32 | url : '${namespace}/widget/$1', 33 | release : '/template/${namespace}/widget/$1' 34 | }, 35 | { 36 | reg : /^\/widget\/(.*\.(js|css))$/i, 37 | isMod : true, 38 | release : '/static/${namespace}/widget/$1' 39 | }, 40 | { 41 | reg : /^\/page\/(.+\.tpl)$/i, 42 | isMod: true, 43 | release : '/template/${namespace}/page/$1', 44 | extras: { 45 | isPage: true 46 | } 47 | }, 48 | { 49 | reg : /\.tmpl$/i, 50 | release : false 51 | }, 52 | { 53 | reg: /^\/(static|config|test)\/(.*)/i, 54 | release: '/$1/${namespace}/$2' 55 | }, 56 | { 57 | reg : /^\/(plugin|server\.conf$|smarty\.conf$)|\.php$/i 58 | }, 59 | { 60 | reg: "domain.conf", 61 | release: '/config/$&' 62 | }, 63 | { 64 | reg: "build.sh", 65 | release: false 66 | }, 67 | { 68 | reg : '${namespace}-map.json', 69 | release : '/config/${namespace}-map.json' 70 | }, 71 | { 72 | reg: /^.+$/, 73 | release: '/static/${namespace}$&' 74 | } 75 | ] 76 | }, 77 | settings : { 78 | parser : { 79 | bdtmpl : { 80 | LEFT_DELIMITER : '<#', 81 | RIGHT_DELIMITER : '#>' 82 | } 83 | }, 84 | postprocessor : { 85 | jswrapper: { 86 | type: 'amd' 87 | } 88 | } 89 | } 90 | }); 91 | -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_function_call_handler.php: -------------------------------------------------------------------------------- 1 | tpl_vars; 38 | foreach (\$_smarty_tpl->smarty->template_functions['{$_name}']['parameter'] as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);}; 39 | foreach (\$params as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);}?>"; 40 | if ($_nocache) { 41 | $_code .= preg_replace(array("!<\?php echo \\'/\*%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/|/\*/%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/\\';\?>!", 42 | "!\\\'!"), array('', "'"), $_template->smarty->template_functions[$_name]['compiled']); 43 | $_template->smarty->template_functions[$_name]['called_nocache'] = true; 44 | } else { 45 | $_code .= preg_replace("/{$_template->smarty->template_functions[$_name]['nocache_hash']}/", $_template->properties['nocache_hash'], $_template->smarty->template_functions[$_name]['compiled']); 46 | } 47 | $_code .= "tpl_vars = \$saved_tpl_vars;}"; 48 | eval($_code); 49 | } 50 | $_function($_template, $_params); 51 | } 52 | 53 | } 54 | 55 | ?> 56 | -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_config_load.php: -------------------------------------------------------------------------------- 1 | true,'parent' => true,'root' => true,'global' => true); 52 | // check and get attributes 53 | $_attr = $this->getAttributes($compiler, $args); 54 | 55 | if ($_attr['nocache'] === true) { 56 | $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); 57 | } 58 | 59 | 60 | // save posible attributes 61 | $conf_file = $_attr['file']; 62 | if (isset($_attr['section'])) { 63 | $section = $_attr['section']; 64 | } else { 65 | $section = 'null'; 66 | } 67 | $scope = 'local'; 68 | // scope setup 69 | if (isset($_attr['scope'])) { 70 | $_attr['scope'] = trim($_attr['scope'], "'\""); 71 | if (isset($_is_legal_scope[$_attr['scope']])) { 72 | $scope = $_attr['scope']; 73 | } else { 74 | $compiler->trigger_template_error('illegal value for "scope" attribute', $compiler->lex->taglineno); 75 | } 76 | } 77 | // create config object 78 | $_output = "smarty, \$_smarty_tpl);"; 79 | $_output .= "\$_config->loadConfigVars($section, '$scope'); ?>"; 80 | return $_output; 81 | } 82 | 83 | } 84 | 85 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_private_object_function.php: -------------------------------------------------------------------------------- 1 | getAttributes($compiler, $args); 42 | if ($_attr['nocache'] === true) { 43 | $compiler->tag_nocache = true; 44 | } 45 | unset($_attr['nocache']); 46 | $_assign = null; 47 | if (isset($_attr['assign'])) { 48 | $_assign = $_attr['assign']; 49 | unset($_attr['assign']); 50 | } 51 | // convert attributes into parameter array string 52 | if ($compiler->smarty->registered_objects[$tag][2]) { 53 | $_paramsArray = array(); 54 | foreach ($_attr as $_key => $_value) { 55 | if (is_int($_key)) { 56 | $_paramsArray[] = "$_key=>$_value"; 57 | } else { 58 | $_paramsArray[] = "'$_key'=>$_value"; 59 | } 60 | } 61 | $_params = 'array(' . implode(",", $_paramsArray) . ')'; 62 | $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params},\$_smarty_tpl)"; 63 | } else { 64 | $_params = implode(",", $_attr); 65 | $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params})"; 66 | } 67 | if (empty($_assign)) { 68 | // This tag does create output 69 | $compiler->has_output = true; 70 | $output = "\n"; 71 | } else { 72 | $output = "assign({$_assign},{$return});?>\n"; 73 | } 74 | return $output; 75 | } 76 | 77 | } 78 | 79 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_filter_handler.php: -------------------------------------------------------------------------------- 1 | smarty->autoload_filters[$type])) { 38 | foreach ((array)$template->smarty->autoload_filters[$type] as $name) { 39 | $plugin_name = "Smarty_{$type}filter_{$name}"; 40 | if ($template->smarty->loadPlugin($plugin_name)) { 41 | if (function_exists($plugin_name)) { 42 | // use loaded Smarty2 style plugin 43 | $output = $plugin_name($output, $template); 44 | } elseif (class_exists($plugin_name, false)) { 45 | // loaded class of filter plugin 46 | $output = call_user_func(array($plugin_name, 'execute'), $output, $template); 47 | } 48 | } else { 49 | // nothing found, throw exception 50 | throw new SmartyException("Unable to load filter {$plugin_name}"); 51 | } 52 | } 53 | } 54 | // loop over registerd filters of specified type 55 | if (!empty($template->smarty->registered_filters[$type])) { 56 | foreach ($template->smarty->registered_filters[$type] as $key => $name) { 57 | if (is_array($template->smarty->registered_filters[$type][$key])) { 58 | $output = call_user_func($template->smarty->registered_filters[$type][$key], $output, $template); 59 | } else { 60 | $output = $template->smarty->registered_filters[$type][$key]($output, $template); 61 | } 62 | } 63 | } 64 | // return filtered output 65 | return $output; 66 | } 67 | 68 | } 69 | 70 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifier.capitalize.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: capitalize
14 | * Purpose: capitalize words in the string 15 | * 16 | * {@internal {$string|capitalize:true:true} is the fastest option for MBString enabled systems }} 17 | * 18 | * @param string $string string to capitalize 19 | * @param boolean $uc_digits also capitalize "x123" to "X123" 20 | * @param boolean $lc_rest capitalize first letters, lowercase all following letters "aAa" to "Aaa" 21 | * @return string capitalized string 22 | * @author Monte Ohrt 23 | * @author Rodney Rehm 24 | */ 25 | function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = false) 26 | { 27 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 28 | if ($lc_rest) { 29 | // uppercase (including hyphenated words) 30 | $upper_string = mb_convert_case( $string, MB_CASE_TITLE, SMARTY_RESOURCE_CHAR_SET ); 31 | } else { 32 | // uppercase word breaks 33 | $upper_string = preg_replace("!(^|[^\p{L}'])([\p{Ll}])!ueS", "stripslashes('\\1').mb_convert_case(stripslashes('\\2'),MB_CASE_UPPER, SMARTY_RESOURCE_CHAR_SET)", $string); 34 | } 35 | // check uc_digits case 36 | if (!$uc_digits) { 37 | if (preg_match_all("!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!u", $string, $matches, PREG_OFFSET_CAPTURE)) { 38 | foreach($matches[1] as $match) { 39 | $upper_string = substr_replace($upper_string, mb_strtolower($match[0], SMARTY_RESOURCE_CHAR_SET), $match[1], strlen($match[0])); 40 | } 41 | } 42 | } 43 | $upper_string = preg_replace("!((^|\s)['\"])(\w)!ue", "stripslashes('\\1').mb_convert_case(stripslashes('\\3'),MB_CASE_UPPER, SMARTY_RESOURCE_CHAR_SET)", $upper_string); 44 | return $upper_string; 45 | } 46 | 47 | // lowercase first 48 | if ($lc_rest) { 49 | $string = strtolower($string); 50 | } 51 | // uppercase (including hyphenated words) 52 | $upper_string = preg_replace("!(^|[^\p{L}'])([\p{Ll}])!ueS", "stripslashes('\\1').ucfirst(stripslashes('\\2'))", $string); 53 | // check uc_digits case 54 | if (!$uc_digits) { 55 | if (preg_match_all("!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!u", $string, $matches, PREG_OFFSET_CAPTURE)) { 56 | foreach($matches[1] as $match) { 57 | $upper_string = substr_replace($upper_string, strtolower($match[0]), $match[1], strlen($match[0])); 58 | } 59 | } 60 | } 61 | $upper_string = preg_replace("!((^|\s)['\"])(\w)!ue", "stripslashes('\\1').strtoupper(stripslashes('\\3'))", $upper_string); 62 | return $upper_string; 63 | } 64 | 65 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_resource_eval.php: -------------------------------------------------------------------------------- 1 | uid = $source->filepath = sha1($source->name); 33 | $source->timestamp = false; 34 | $source->exists = true; 35 | } 36 | 37 | /** 38 | * Load template's source from $resource_name into current template object 39 | * 40 | * @uses decode() to decode base64 and urlencoded template_resources 41 | * @param Smarty_Template_Source $source source object 42 | * @return string template source 43 | */ 44 | public function getContent(Smarty_Template_Source $source) 45 | { 46 | return $this->decode($source->name); 47 | } 48 | 49 | /** 50 | * decode base64 and urlencode 51 | * 52 | * @param string $string template_resource to decode 53 | * @return string decoded template_resource 54 | */ 55 | protected function decode($string) 56 | { 57 | // decode if specified 58 | if (($pos = strpos($string, ':')) !== false) { 59 | if (!strncmp($string, 'base64', 6)) { 60 | return base64_decode(substr($string, 7)); 61 | } elseif (!strncmp($string, 'urlencode', 9)) { 62 | return urldecode(substr($string, 10)); 63 | } 64 | } 65 | 66 | return $string; 67 | } 68 | 69 | /** 70 | * modify resource_name according to resource handlers specifications 71 | * 72 | * @param Smarty $smarty Smarty instance 73 | * @param string $resource_name resource_name to make unique 74 | * @return string unique resource name 75 | */ 76 | protected function buildUniqueResourceName(Smarty $smarty, $resource_name) 77 | { 78 | return get_class($this) . '#' .$this->decode($resource_name); 79 | } 80 | 81 | /** 82 | * Determine basename for compiled filename 83 | * 84 | * @param Smarty_Template_Source $source source object 85 | * @return string resource's basename 86 | */ 87 | protected function getBasename(Smarty_Template_Source $source) 88 | { 89 | return ''; 90 | } 91 | 92 | } 93 | 94 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_resource_string.php: -------------------------------------------------------------------------------- 1 | uid = $source->filepath = sha1($source->name); 33 | $source->timestamp = 0; 34 | $source->exists = true; 35 | } 36 | 37 | /** 38 | * Load template's source from $resource_name into current template object 39 | * 40 | * @uses decode() to decode base64 and urlencoded template_resources 41 | * @param Smarty_Template_Source $source source object 42 | * @return string template source 43 | */ 44 | public function getContent(Smarty_Template_Source $source) 45 | { 46 | return $this->decode($source->name); 47 | } 48 | 49 | /** 50 | * decode base64 and urlencode 51 | * 52 | * @param string $string template_resource to decode 53 | * @return string decoded template_resource 54 | */ 55 | protected function decode($string) 56 | { 57 | // decode if specified 58 | if (($pos = strpos($string, ':')) !== false) { 59 | if (!strncmp($string, 'base64', 6)) { 60 | return base64_decode(substr($string, 7)); 61 | } elseif (!strncmp($string, 'urlencode', 9)) { 62 | return urldecode(substr($string, 10)); 63 | } 64 | } 65 | 66 | return $string; 67 | } 68 | 69 | /** 70 | * modify resource_name according to resource handlers specifications 71 | * 72 | * @param Smarty $smarty Smarty instance 73 | * @param string $resource_name resource_name to make unique 74 | * @return string unique resource name 75 | */ 76 | protected function buildUniqueResourceName(Smarty $smarty, $resource_name) 77 | { 78 | return get_class($this) . '#' .$this->decode($resource_name); 79 | } 80 | 81 | /** 82 | * Determine basename for compiled filename 83 | * 84 | * Always returns an empty string. 85 | * 86 | * @param Smarty_Template_Source $source source object 87 | * @return string resource's basename 88 | */ 89 | protected function getBasename(Smarty_Template_Source $source) 90 | { 91 | return ''; 92 | } 93 | 94 | } 95 | 96 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/shared.mb_wordwrap.php: -------------------------------------------------------------------------------- 1 | $width) { 34 | // remove last space 35 | $t = mb_substr($t, 0, -1, SMARTY_RESOURCE_CHAR_SET); 36 | $_previous = false; 37 | $length = 0; 38 | 39 | if ($cut) { 40 | $_tokens = preg_split('!(.{' . $width . '})!uS', $_token, -1, PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE); 41 | // broken words go on a new line 42 | $t .= $break; 43 | } 44 | } 45 | 46 | foreach ($_tokens as $token) { 47 | $_space = !!preg_match('!^\s$!uS', $token); 48 | $token_length = mb_strlen($token, SMARTY_RESOURCE_CHAR_SET); 49 | $length += $token_length; 50 | 51 | if ($length > $width) { 52 | // remove space before inserted break 53 | if ($_previous && $token_length < $width) { 54 | $t = mb_substr($t, 0, -1, SMARTY_RESOURCE_CHAR_SET); 55 | } 56 | 57 | // add the break before the token 58 | $t .= $break; 59 | $length = $token_length; 60 | 61 | // skip space after inserting a break 62 | if ($_space) { 63 | $length = 0; 64 | continue; 65 | } 66 | } else if ($token == "\n") { 67 | // hard break must reset counters 68 | $_previous = 0; 69 | $length = 0; 70 | } else { 71 | // remember if we had a space or not 72 | $_previous = $_space; 73 | } 74 | // add the token 75 | $t .= $token; 76 | } 77 | } 78 | 79 | return $t; 80 | } 81 | 82 | } 83 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_resource_file.php: -------------------------------------------------------------------------------- 1 | filepath = $this->buildFilepath($source, $_template); 30 | 31 | if ($source->filepath !== false) { 32 | if (is_object($source->smarty->security_policy)) { 33 | $source->smarty->security_policy->isTrustedResourceDir($source->filepath); 34 | } 35 | 36 | $source->uid = sha1($source->filepath); 37 | if ($source->smarty->compile_check && !isset($source->timestamp)) { 38 | $source->timestamp = @filemtime($source->filepath); 39 | $source->exists = !!$source->timestamp; 40 | } 41 | } 42 | } 43 | 44 | /** 45 | * populate Source Object with timestamp and exists from Resource 46 | * 47 | * @param Smarty_Template_Source $source source object 48 | */ 49 | public function populateTimestamp(Smarty_Template_Source $source) 50 | { 51 | $source->timestamp = @filemtime($source->filepath); 52 | $source->exists = !!$source->timestamp; 53 | } 54 | 55 | /** 56 | * Load template's source from file into current template object 57 | * 58 | * @param Smarty_Template_Source $source source object 59 | * @return string template source 60 | * @throws SmartyException if source cannot be loaded 61 | */ 62 | public function getContent(Smarty_Template_Source $source) 63 | { 64 | if ($source->timestamp) { 65 | return file_get_contents($source->filepath); 66 | } 67 | if ($source instanceof Smarty_Config_Source) { 68 | throw new SmartyException("Unable to read config {$source->type} '{$source->name}'"); 69 | } 70 | throw new SmartyException("Unable to read template {$source->type} '{$source->name}'"); 71 | } 72 | 73 | /** 74 | * Determine basename for compiled filename 75 | * 76 | * @param Smarty_Template_Source $source source object 77 | * @return string resource's basename 78 | */ 79 | public function getBasename(Smarty_Template_Source $source) 80 | { 81 | $_file = $source->name; 82 | if (($_pos = strpos($_file, ']')) !== false) { 83 | $_file = substr($_file, $_pos + 1); 84 | } 85 | return basename($_file); 86 | } 87 | 88 | } 89 | 90 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/function.math.php: -------------------------------------------------------------------------------- 1 | 14 | * Name: math
15 | * Purpose: handle math computations in template 16 | * 17 | * @link http://www.smarty.net/manual/en/language.function.math.php {math} 18 | * (Smarty online manual) 19 | * @author Monte Ohrt 20 | * @param array $params parameters 21 | * @param Smarty_Internal_Template $template template object 22 | * @return string|null 23 | */ 24 | function smarty_function_math($params, $template) 25 | { 26 | static $_allowed_funcs = array( 27 | 'int' => true, 'abs' => true, 'ceil' => true, 'cos' => true, 'exp' => true, 'floor' => true, 28 | 'log' => true, 'log10' => true, 'max' => true, 'min' => true, 'pi' => true, 'pow' => true, 29 | 'rand' => true, 'round' => true, 'sin' => true, 'sqrt' => true, 'srand' => true ,'tan' => true 30 | ); 31 | // be sure equation parameter is present 32 | if (empty($params['equation'])) { 33 | trigger_error("math: missing equation parameter",E_USER_WARNING); 34 | return; 35 | } 36 | 37 | $equation = $params['equation']; 38 | 39 | // make sure parenthesis are balanced 40 | if (substr_count($equation,"(") != substr_count($equation,")")) { 41 | trigger_error("math: unbalanced parenthesis",E_USER_WARNING); 42 | return; 43 | } 44 | 45 | // match all vars in equation, make sure all are passed 46 | preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]*)!",$equation, $match); 47 | 48 | foreach($match[1] as $curr_var) { 49 | if ($curr_var && !isset($params[$curr_var]) && !isset($_allowed_funcs[$curr_var])) { 50 | trigger_error("math: function call $curr_var not allowed",E_USER_WARNING); 51 | return; 52 | } 53 | } 54 | 55 | foreach($params as $key => $val) { 56 | if ($key != "equation" && $key != "format" && $key != "assign") { 57 | // make sure value is not empty 58 | if (strlen($val)==0) { 59 | trigger_error("math: parameter $key is empty",E_USER_WARNING); 60 | return; 61 | } 62 | if (!is_numeric($val)) { 63 | trigger_error("math: parameter $key: is not numeric",E_USER_WARNING); 64 | return; 65 | } 66 | $equation = preg_replace("/\b$key\b/", " \$params['$key'] ", $equation); 67 | } 68 | } 69 | $smarty_math_result = null; 70 | eval("\$smarty_math_result = ".$equation.";"); 71 | 72 | if (empty($params['format'])) { 73 | if (empty($params['assign'])) { 74 | return $smarty_math_result; 75 | } else { 76 | $template->assign($params['assign'],$smarty_math_result); 77 | } 78 | } else { 79 | if (empty($params['assign'])){ 80 | printf($params['format'],$smarty_math_result); 81 | } else { 82 | $template->assign($params['assign'],sprintf($params['format'],$smarty_math_result)); 83 | } 84 | } 85 | } 86 | 87 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_private_registered_function.php: -------------------------------------------------------------------------------- 1 | has_output = true; 41 | // check and get attributes 42 | $_attr = $this->getAttributes($compiler, $args); 43 | if ($_attr['nocache']) { 44 | $compiler->tag_nocache = true; 45 | } 46 | unset($_attr['nocache']); 47 | if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION][$tag])) { 48 | $tag_info = $compiler->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION][$tag]; 49 | } else { 50 | $tag_info = $compiler->default_handler_plugins[Smarty::PLUGIN_FUNCTION][$tag]; 51 | } 52 | // not cachable? 53 | $compiler->tag_nocache = $compiler->tag_nocache || !$tag_info[1]; 54 | // convert attributes into parameter array string 55 | $_paramsArray = array(); 56 | foreach ($_attr as $_key => $_value) { 57 | if (is_int($_key)) { 58 | $_paramsArray[] = "$_key=>$_value"; 59 | } elseif ($compiler->template->caching && in_array($_key,$tag_info[2])) { 60 | $_value = str_replace("'","^#^",$_value); 61 | $_paramsArray[] = "'$_key'=>^#^.var_export($_value,true).^#^"; 62 | } else { 63 | $_paramsArray[] = "'$_key'=>$_value"; 64 | } 65 | } 66 | $_params = 'array(' . implode(",", $_paramsArray) . ')'; 67 | $function = $tag_info[0]; 68 | // compile code 69 | if (!is_array($function)) { 70 | $output = "\n"; 71 | } else if (is_object($function[0])) { 72 | $output = "smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['{$tag}'][0][0]->{$function[1]}({$_params},\$_smarty_tpl);?>\n"; 73 | } else { 74 | $output = "\n"; 75 | } 76 | return $output; 77 | } 78 | 79 | } 80 | 81 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_resource_custom.php: -------------------------------------------------------------------------------- 1 | filepath = strtolower($source->type . ':' . $source->name); 52 | $source->uid = sha1($source->type . ':' . $source->name); 53 | 54 | $mtime = $this->fetchTimestamp($source->name); 55 | if ($mtime !== null) { 56 | $source->timestamp = $mtime; 57 | } else { 58 | $this->fetch($source->name, $content, $timestamp); 59 | $source->timestamp = isset($timestamp) ? $timestamp : false; 60 | if( isset($content) ) 61 | $source->content = $content; 62 | } 63 | $source->exists = !!$source->timestamp; 64 | } 65 | 66 | /** 67 | * Load template's source into current template object 68 | * 69 | * @param Smarty_Template_Source $source source object 70 | * @return string template source 71 | * @throws SmartyException if source cannot be loaded 72 | */ 73 | public function getContent(Smarty_Template_Source $source) 74 | { 75 | $this->fetch($source->name, $content, $timestamp); 76 | if (isset($content)) { 77 | return $content; 78 | } 79 | 80 | throw new SmartyException("Unable to read template {$source->type} '{$source->name}'"); 81 | } 82 | 83 | /** 84 | * Determine basename for compiled filename 85 | * 86 | * @param Smarty_Template_Source $source source object 87 | * @return string resource's basename 88 | */ 89 | protected function getBasename(Smarty_Template_Source $source) 90 | { 91 | return basename($source->name); 92 | } 93 | 94 | } 95 | 96 | ?> -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.4.6 2 | 3 | > 升级fis至[v1.4.19](https://github.com/fis-dev/fis/blob/master/CHANGELOG.md#1419--thu-oct-10-2013) 4 | ## 0.4.5 5 | 6 | > 升级fis-optimizer-smarty-xss到v0.0.8,修复对script插件内JS代码XSS修复BUG 7 | ## 0.4.4 8 | 9 | > 升级fis-preprocessor-widget-inline到v0.0.6,支持exclude 10 | 11 | ## 0.4.3 12 | 13 | > 升级fis至[v1.4.12](https://github.com/fis-dev/fis/blob/master/CHANGELOG.md#1412) 14 | 15 | ## 0.4.2 16 | 17 | > 升级fis至[v1.4.4](https://github.com/fis-dev/fis/blob/master/CHANGELOG.md#144) 18 | 19 | > 升级fis-preprocessor-extlang至v0.0.6,添加{%style%}函数的支持 20 | 21 | ## 0.4.1 22 | 23 | > 增加widget inline功能 24 | 25 | > 添加对fis-preprocessor-widget-inline@0.0.3的依赖 26 | 27 | ## 0.4.0 28 | 29 | > 升级fis至 [v1.3.6](https://github.com/fis-dev/fis/blob/master/CHANGELOG.md#136) 30 | 31 | ## 0.3.9 32 | 33 | > 升级fis至 [v1.3.1](https://github.com/fis-dev/fis/blob/master/CHANGELOG.md#131) 34 | 35 | ## 0.3.8 36 | 37 | > 升级fis至 [v1.2.9](https://github.com/fis-dev/fis/blob/master/CHANGELOG.md#129) 38 | 39 | ## 0.3.7 40 | 41 | > 升级fis至 [v1.2.7](https://github.com/fis-dev/fis/blob/master/CHANGELOG.md#127) 42 | 43 | ## 0.3.6 44 | 45 | > 升级fis至 [v1.2.6](https://github.com/fis-dev/fis/blob/master/CHANGELOG.md#126) 46 | 47 | ## 0.3.5 48 | 49 | > 升级fis至 [v1.2.5](https://github.com/fis-dev/fis/blob/master/CHANGELOG.md#125) 50 | 51 | * 默认支持csssprite 52 | 53 | ## 0.3.4 54 | 55 | > 升级fis至 [v1.2.4](https://github.com/fis-dev/fis/blob/master/CHANGELOG.md#124) 56 | 57 | ## 0.3.3 58 | 59 | > 升级fis至 [v1.2.3](https://github.com/fis-dev/fis/blob/master/CHANGELOG.md#123) 60 | 61 | ## 0.3.2 62 | 63 | > 升级fis至 [v1.2.2](https://github.com/fis-dev/fis/blob/master/CHANGELOG.md#122) 64 | > 65 | > 升级fis-optimizer-htmll-compress至0.0.7 66 | 67 | * 修改tpl压缩对script插件中的JS不进行压缩 68 | 69 | ## 0.3.1 70 | 71 | > 升级fis至 [v1.2.1](https://github.com/fis-dev/fis/blob/master/CHANGELOG.md#121) 72 | 73 | ## 0.3.0 74 | 75 | > 升级fis-optimizer-smarty-xss至0.0.7 76 | > 77 | > 升级fis-parser-bdtmpl至0.0.3 78 | 79 | * 修复XSS修复BUG,有重复变量名时可能出现漏修复的情况 80 | * 增加对前端模板的处理方式,以JS类型进行处理 81 | * 修复baiduTemplate在linux下的文件加载失败bug,以及一些语法错误 82 | 83 | ##0.2.9 84 | 85 | > 升级fis至v1.1.9 86 | 87 | * 修复小于1k的png图片压缩bug 88 | 89 | ## 0.2.8 90 | 91 | * 再次修复页面插入静态资源require的BUG 92 | 93 | ## 0.2.7 94 | 95 | * 修复页面插入静态资源require的BUG 96 | 97 | ## 0.2.6 98 | 99 | > 升级fis至v1.1.9 100 | 101 | ## 0.2.5 102 | 103 | > 升级fis至v1.1.7 104 | 105 | * 增加对smarty.conf文件的路径配置 106 | 107 | ## 0.2.4 108 | 109 | > 升级fis至v1.1.6 110 | 111 | ## 0.2.3 112 | 113 | > 升级fis至v1.1.5 114 | 115 | ## 0.2.2 116 | 117 | > 升级fis至v1.1.5 118 | 119 | ## 0.2.1 120 | 121 | > 升级fis至v1.0.8 122 | 123 | ## 0.2.0 124 | 125 | * build.sh不产出 126 | 127 | ## 0.1.9 128 | 129 | * fisp -v版本显示读取package.json中的版本 130 | 131 | ## 0.1.8 132 | 133 | > 升级fis-optimizer-html-compress至0.0.5 134 | > 135 | > 升级fis-optimizer-smarty-xss至0.0.6 136 | 137 | ## 0.1.7 138 | 139 | > 升级fis至v1.0.6 140 | > 升级fis-optimizer-html-compress至0.0.4 141 | > 142 | > 升级fis-optimizer-smarty-xss至0.0.5 143 | 144 | ## 0.1.6 145 | 146 | > 升级fis-preprocessor-extlang至v0.0.5 147 | > 148 | > 升级fis-postprocessor-require-async至v0.0.4 149 | 150 | ## 0.1.5 151 | 152 | > 升级fis至v1.0.5 153 | > 154 | > 升级fis-parser-bdtmpl至v0.0.2 155 | 156 | * 修复ap.path,对widget、page目录下的非tpl、js、css资源产出位置错误bug 157 | -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_config_source.php: -------------------------------------------------------------------------------- 1 | handler = $handler; // Note: prone to circular references 37 | 38 | // Note: these may be ->config_compiler_class etc in the future 39 | //$this->config_compiler_class = $handler->config_compiler_class; 40 | //$this->config_lexer_class = $handler->config_lexer_class; 41 | //$this->config_parser_class = $handler->config_parser_class; 42 | 43 | $this->smarty = $smarty; 44 | $this->resource = $resource; 45 | $this->type = $type; 46 | $this->name = $name; 47 | $this->unique_resource = $unique_resource; 48 | } 49 | 50 | /** 51 | * <> Generic setter. 52 | * 53 | * @param string $property_name valid: content, timestamp, exists 54 | * @param mixed $value newly assigned value (not check for correct type) 55 | * @throws SmartyException when the given property name is not valid 56 | */ 57 | public function __set($property_name, $value) 58 | { 59 | switch ($property_name) { 60 | case 'content': 61 | case 'timestamp': 62 | case 'exists': 63 | $this->$property_name = $value; 64 | break; 65 | 66 | default: 67 | throw new SmartyException("invalid config property '$property_name'."); 68 | } 69 | } 70 | 71 | /** 72 | * <> Generic getter. 73 | * 74 | * @param string $property_name valid: content, timestamp, exists 75 | * @throws SmartyException when the given property name is not valid 76 | */ 77 | public function __get($property_name) 78 | { 79 | switch ($property_name) { 80 | case 'timestamp': 81 | case 'exists': 82 | $this->handler->populateTimestamp($this); 83 | return $this->$property_name; 84 | 85 | case 'content': 86 | return $this->content = $this->handler->getContent($this); 87 | 88 | default: 89 | throw new SmartyException("config property '$property_name' does not exist."); 90 | } 91 | } 92 | 93 | } 94 | 95 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_resource_registered.php: -------------------------------------------------------------------------------- 1 | filepath = $source->type . ':' . $source->name; 32 | $source->uid = sha1($source->filepath); 33 | if ($source->smarty->compile_check) { 34 | $source->timestamp = $this->getTemplateTimestamp($source); 35 | $source->exists = !!$source->timestamp; 36 | } 37 | } 38 | 39 | /** 40 | * populate Source Object with timestamp and exists from Resource 41 | * 42 | * @param Smarty_Template_Source $source source object 43 | * @return void 44 | */ 45 | public function populateTimestamp(Smarty_Template_Source $source) 46 | { 47 | $source->timestamp = $this->getTemplateTimestamp($source); 48 | $source->exists = !!$source->timestamp; 49 | } 50 | 51 | /** 52 | * Get timestamp (epoch) the template source was modified 53 | * 54 | * @param Smarty_Template_Source $source source object 55 | * @return integer|boolean timestamp (epoch) the template was modified, false if resources has no timestamp 56 | */ 57 | public function getTemplateTimestamp(Smarty_Template_Source $source) 58 | { 59 | // return timestamp 60 | $time_stamp = false; 61 | call_user_func_array($source->smarty->registered_resources[$source->type][0][1], array($source->name, &$time_stamp, $source->smarty)); 62 | return is_numeric($time_stamp) ? (int) $time_stamp : $time_stamp; 63 | } 64 | 65 | /** 66 | * Load template's source by invoking the registered callback into current template object 67 | * 68 | * @param Smarty_Template_Source $source source object 69 | * @return string template source 70 | * @throws SmartyException if source cannot be loaded 71 | */ 72 | public function getContent(Smarty_Template_Source $source) 73 | { 74 | // return template string 75 | $t = call_user_func_array($source->smarty->registered_resources[$source->type][0][0], array($source->name, &$source->content, $source->smarty)); 76 | if (is_bool($t) && !$t) { 77 | throw new SmartyException("Unable to read template {$source->type} '{$source->name}'"); 78 | } 79 | return $source->content; 80 | } 81 | 82 | /** 83 | * Determine basename for compiled filename 84 | * 85 | * @param Smarty_Template_Source $source source object 86 | * @return string resource's basename 87 | */ 88 | protected function getBasename(Smarty_Template_Source $source) 89 | { 90 | return basename($source->name); 91 | } 92 | 93 | } 94 | 95 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_assign.php: -------------------------------------------------------------------------------- 1 | required_attributes = array('var', 'value'); 32 | $this->shorttag_order = array('var', 'value'); 33 | $this->optional_attributes = array('scope'); 34 | $_nocache = 'null'; 35 | $_scope = Smarty::SCOPE_LOCAL; 36 | // check and get attributes 37 | $_attr = $this->getAttributes($compiler, $args); 38 | // nocache ? 39 | if ($compiler->tag_nocache || $compiler->nocache) { 40 | $_nocache = 'true'; 41 | // create nocache var to make it know for further compiling 42 | $compiler->template->tpl_vars[trim($_attr['var'], "'")] = new Smarty_variable(null, true); 43 | } 44 | // scope setup 45 | if (isset($_attr['scope'])) { 46 | $_attr['scope'] = trim($_attr['scope'], "'\""); 47 | if ($_attr['scope'] == 'parent') { 48 | $_scope = Smarty::SCOPE_PARENT; 49 | } elseif ($_attr['scope'] == 'root') { 50 | $_scope = Smarty::SCOPE_ROOT; 51 | } elseif ($_attr['scope'] == 'global') { 52 | $_scope = Smarty::SCOPE_GLOBAL; 53 | } else { 54 | $compiler->trigger_template_error('illegal value for "scope" attribute', $compiler->lex->taglineno); 55 | } 56 | } 57 | // compiled output 58 | if (isset($parameter['smarty_internal_index'])) { 59 | $output = "createLocalArrayVariable($_attr[var], $_nocache, $_scope);\n\$_smarty_tpl->tpl_vars[$_attr[var]]->value$parameter[smarty_internal_index] = $_attr[value];"; 60 | } else { 61 | $output = "tpl_vars[$_attr[var]] = new Smarty_variable($_attr[value], $_nocache, $_scope);"; 62 | } 63 | if ($_scope == Smarty::SCOPE_PARENT) { 64 | $output .= "\nif (\$_smarty_tpl->parent != null) \$_smarty_tpl->parent->tpl_vars[$_attr[var]] = clone \$_smarty_tpl->tpl_vars[$_attr[var]];"; 65 | } elseif ($_scope == Smarty::SCOPE_ROOT || $_scope == Smarty::SCOPE_GLOBAL) { 66 | $output .= "\n\$_ptr = \$_smarty_tpl->parent; while (\$_ptr != null) {\$_ptr->tpl_vars[$_attr[var]] = clone \$_smarty_tpl->tpl_vars[$_attr[var]]; \$_ptr = \$_ptr->parent; }"; 67 | } 68 | if ( $_scope == Smarty::SCOPE_GLOBAL) { 69 | $output .= "\nSmarty::\$global_tpl_vars[$_attr[var]] = clone \$_smarty_tpl->tpl_vars[$_attr[var]];"; 70 | } 71 | $output .= '?>'; 72 | return $output; 73 | } 74 | 75 | } 76 | 77 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_capture.php: -------------------------------------------------------------------------------- 1 | getAttributes($compiler, $args); 46 | 47 | $buffer = isset($_attr['name']) ? $_attr['name'] : "'default'"; 48 | $assign = isset($_attr['assign']) ? $_attr['assign'] : 'null'; 49 | $append = isset($_attr['append']) ? $_attr['append'] : 'null'; 50 | 51 | $compiler->_capture_stack[] = array($buffer, $assign, $append, $compiler->nocache); 52 | // maybe nocache because of nocache variables 53 | $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; 54 | $_output = "_capture_stack[] = array($buffer, $assign, $append); ob_start(); ?>"; 55 | 56 | return $_output; 57 | } 58 | 59 | } 60 | 61 | /** 62 | * Smarty Internal Plugin Compile Captureclose Class 63 | * 64 | * @package Smarty 65 | * @subpackage Compiler 66 | */ 67 | class Smarty_Internal_Compile_CaptureClose extends Smarty_Internal_CompileBase { 68 | 69 | /** 70 | * Compiles code for the {/capture} tag 71 | * 72 | * @param array $args array with attributes from parser 73 | * @param object $compiler compiler object 74 | * @return string compiled code 75 | */ 76 | public function compile($args, $compiler) 77 | { 78 | // check and get attributes 79 | $_attr = $this->getAttributes($compiler, $args); 80 | // must endblock be nocache? 81 | if ($compiler->nocache) { 82 | $compiler->tag_nocache = true; 83 | } 84 | 85 | list($buffer, $assign, $append, $compiler->nocache) = array_pop($compiler->_capture_stack); 86 | 87 | $_output = "_capture_stack);\n"; 88 | $_output .= "if (!empty(\$_capture_buffer)) {\n"; 89 | $_output .= " if (isset(\$_capture_assign)) \$_smarty_tpl->assign(\$_capture_assign, ob_get_contents());\n"; 90 | $_output .= " if (isset( \$_capture_append)) \$_smarty_tpl->append( \$_capture_append, ob_get_contents());\n"; 91 | $_output .= " Smarty::\$_smarty_vars['capture'][\$_capture_buffer]=ob_get_clean();\n"; 92 | $_output .= "} else \$_smarty_tpl->capture_error();?>"; 93 | return $_output; 94 | } 95 | 96 | } 97 | 98 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/debug.tpl: -------------------------------------------------------------------------------- 1 | {capture name='_smarty_debug' assign=debug_output} 2 | 3 | 4 | 5 | Smarty Debug Console 6 | 86 | 87 | 88 | 89 |

Smarty Debug Console - {if isset($template_name)}{$template_name|debug_print_var nofilter}{else}Total Time {$execution_time|string_format:"%.5f"}{/if}

90 | 91 | {if !empty($template_data)} 92 |

included templates & config files (load time in seconds)

93 | 94 |
95 | {foreach $template_data as $template} 96 | {$template.name} 97 | 98 | (compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"}) 99 | 100 |
101 | {/foreach} 102 |
103 | {/if} 104 | 105 |

assigned template variables

106 | 107 | 108 | {foreach $assigned_vars as $vars} 109 | 110 | 111 | 112 | {/foreach} 113 |
${$vars@key|escape:'html'}{$vars|debug_print_var nofilter}
114 | 115 |

assigned config file variables (outer template scope)

116 | 117 | 118 | {foreach $config_vars as $vars} 119 | 120 | 121 | 122 | {/foreach} 123 | 124 |
{$vars@key|escape:'html'}{$vars|debug_print_var nofilter}
125 | 126 | 127 | {/capture} 128 | 134 | -------------------------------------------------------------------------------- /test/util/diff/release.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | TEST_PATH=/home/work/repos/fis2.0_pc/test/util/diff 4 | FISP_PATH=/home/work/repos/fis2.0_pc/ 5 | cd ${TEST_PATH} 6 | WENKU_CODE_PATH=${TEST_PATH}/product_code/wenku 7 | WENKU_OUTPUT_PATH=${TEST_PATH}/product_output/wenku 8 | 9 | TIEBA_CODE_PATH=${TEST_PATH}/product_code/tieba 10 | TIEBA_OUTPUT_PATH=${TEST_PATH}/product_output/tieba 11 | 12 | BATMAN_CODE_PATH=${TEST_PATH}/product_code/batman 13 | BATMAN_OUTPUT_PATH=${TEST_PATH}/product_output/batman 14 | BATMAN_MODULES=(transit place common index addr feedback drive walk) 15 | 16 | PLACE_CODE_PATH=${TEST_PATH}/product_code/place 17 | PLACE_OUTPUT_PATH=${TEST_PATH}/product_output/place 18 | PLACE_MODULES=(admin beauty cater common detail hotel movie scope) 19 | 20 | #获取fis version 21 | if [ $1 = 'new' ] 22 | then 23 | version=$(node ${FISP_PATH}/bin/fis-pc -v --no-color) 24 | else 25 | version=$(fisp -v --no-color) 26 | fi 27 | 28 | OLD_IFS="$IFS" 29 | IFS=" " 30 | arr=($version) 31 | IFS="$OLD_IFS" 32 | v=${arr[1]} 33 | 34 | # 执行release 35 | if [ $1 = 'new' ] 36 | then 37 | #wenku 38 | rm -rf ${WENKU_OUTPUT_PATH}/output_new 39 | cd ${WENKU_CODE_PATH} 40 | node ${FISP_PATH}/bin/fis-pc release -md ${WENKU_OUTPUT_PATH}/output_new --no-color 41 | echo $v > ${WENKU_OUTPUT_PATH}/output_new/fis_version.txt 42 | chmod 777 ${WENKU_OUTPUT_PATH} 43 | 44 | #tieba 45 | rm -rf ${TIEBA_OUTPUT_PATH}/output_new 46 | cd ${TIEBA_CODE_PATH} 47 | node ${FISP_PATH}/bin/fis-pc release -md ${TIEBA_OUTPUT_PATH}/output_new --no-color 48 | echo $v > ${TIEBA_OUTPUT_PATH}/output_new/fis_version.txt 49 | chmod 777 ${TIEBA_OUTPUT_PATH} 50 | 51 | #batman 52 | rm -rf ${BATMAN_OUTPUT_PATH}/output_new 53 | for module in ${BATMAN_MODULES[@]} 54 | do 55 | cd ${BATMAN_CODE_PATH}/$module 56 | node ${FISP_PATH}/bin/fis-pc release -md ${BATMAN_OUTPUT_PATH}/output_new --no-color 57 | done 58 | echo $v > ${BATMAN_OUTPUT_PATH}/output_new/fis_version.txt 59 | chmod 777 ${BATMAN_OUTPUT_PATH} 60 | 61 | #place 62 | rm -rf ${PLACE_OUTPUT_PATH}/output_new 63 | for module in ${PLACE_MODULES[@]} 64 | do 65 | cd ${PLACE_CODE_PATH}/$module 66 | node ${FISP_PATH}/bin/fis-pc release -md ${PLACE_OUTPUT_PATH}/output_new --no-color 67 | done 68 | echo $v > ${PLACE_OUTPUT_PATH}/output_new/fis_version.txt 69 | chmod 777 ${PLACE_OUTPUT_PATH} 70 | else 71 | #wenku 72 | rm -rf ${WENKU_OUTPUT_PATH}/output_old 73 | cd ${WENKU_CODE_PATH} 74 | fisp release -md ${WENKU_OUTPUT_PATH}/output_old --no-color 75 | echo $v > ${WENKU_OUTPUT_PATH}/output_old/fis_version.txt 76 | chmod 777 -R ${WENKU_OUTPUT_PATH}/output_old 77 | 78 | #tieba 79 | rm -rf ${TIEBA_OUTPUT_PATH}/output_old 80 | cd ${TIEBA_CODE_PATH} 81 | fisp release -md ${TIEBA_OUTPUT_PATH}/output_old 82 | echo $v > ${TIEBA_OUTPUT_PATH}/output_old/fis_version.txt 83 | chmod 777 -R ${TIEBA_OUTPUT_PATH}/output_old 84 | 85 | #batman 86 | rm -rf ${BATMAN_OUTPUT_PATH}/output_old 87 | for module in ${BATMAN_MODULES[@]} 88 | do 89 | cd ${BATMAN_CODE_PATH}/$module 90 | fisp release -md ${BATMAN_OUTPUT_PATH}/output_old --no-color 91 | done 92 | echo $v > ${BATMAN_OUTPUT_PATH}/output_old/fis_version.txt 93 | chmod 777 -R ${BATMAN_OUTPUT_PATH}/output_old 94 | 95 | #place 96 | rm -rf ${PLACE_OUTPUT_PATH}/output_old 97 | for module in ${PLACE_MODULES[@]} 98 | do 99 | cd ${PLACE_CODE_PATH}/$module 100 | fisp release -md ${PLACE_OUTPUT_PATH}/output_old --no-color 101 | done 102 | echo $v > ${PLACE_OUTPUT_PATH}/output_old/fis_version.txt 103 | chmod 777 -R ${PLACE_OUTPUT_PATH}/output_old 104 | fi 105 | -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/outputfilter.trimwhitespace.php: -------------------------------------------------------------------------------- 1 | .*?#is', $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { 30 | foreach ($matches as $match) { 31 | $store[] = $match[0][0]; 32 | $_length = strlen($match[0][0]); 33 | $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@'; 34 | $source = substr_replace($source, $replace, $match[0][1] - $_offset, $_length); 35 | 36 | $_offset += $_length - strlen($replace); 37 | $_store++; 38 | } 39 | } 40 | 41 | // Strip all HTML-Comments 42 | $source = preg_replace( '##ms', '', $source ); 43 | 44 | // capture html elements not to be messed with 45 | $_offset = 0; 46 | if (preg_match_all('#<(script|pre|textarea)[^>]*>.*?#is', $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { 47 | foreach ($matches as $match) { 48 | $store[] = $match[0][0]; 49 | $_length = strlen($match[0][0]); 50 | $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@'; 51 | $source = substr_replace($source, $replace, $match[0][1] - $_offset, $_length); 52 | 53 | $_offset += $_length - strlen($replace); 54 | $_store++; 55 | } 56 | } 57 | 58 | $expressions = array( 59 | // replace multiple spaces between tags by a single space 60 | // can't remove them entirely, becaue that might break poorly implemented CSS display:inline-block elements 61 | '#(:SMARTY@!@|>)\s+(?=@!@SMARTY:|<)#s' => '\1 \2', 62 | // remove spaces between attributes (but not in attribute values!) 63 | '#(([a-z0-9]\s*=\s*(["\'])[^\3]*?\3)|<[a-z0-9_]+)\s+([a-z/>])#is' => '\1 \4', 64 | // note: for some very weird reason trim() seems to remove spaces inside attributes. 65 | // maybe a \0 byte or something is interfering? 66 | '#^\s+<#Ss' => '<', 67 | '#>\s+$#Ss' => '>', 68 | ); 69 | 70 | $source = preg_replace( array_keys($expressions), array_values($expressions), $source ); 71 | // note: for some very weird reason trim() seems to remove spaces inside attributes. 72 | // maybe a \0 byte or something is interfering? 73 | // $source = trim( $source ); 74 | 75 | // capture html elements not to be messed with 76 | $_offset = 0; 77 | if (preg_match_all('#@!@SMARTY:([0-9]+):SMARTY@!@#is', $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { 78 | foreach ($matches as $match) { 79 | $store[] = $match[0][0]; 80 | $_length = strlen($match[0][0]); 81 | $replace = array_shift($store); 82 | $source = substr_replace($source, $replace, $match[0][1] + $_offset, $_length); 83 | 84 | $_offset += strlen($replace) - $_length; 85 | $_store++; 86 | } 87 | } 88 | 89 | return $source; 90 | } 91 | 92 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_private_block_plugin.php: -------------------------------------------------------------------------------- 1 | getAttributes($compiler, $args); 44 | if ($_attr['nocache'] === true) { 45 | $compiler->tag_nocache = true; 46 | } 47 | unset($_attr['nocache']); 48 | // convert attributes into parameter array string 49 | $_paramsArray = array(); 50 | foreach ($_attr as $_key => $_value) { 51 | if (is_int($_key)) { 52 | $_paramsArray[] = "$_key=>$_value"; 53 | } else { 54 | $_paramsArray[] = "'$_key'=>$_value"; 55 | } 56 | } 57 | $_params = 'array(' . implode(",", $_paramsArray) . ')'; 58 | 59 | $this->openTag($compiler, $tag, array($_params, $compiler->nocache)); 60 | // maybe nocache because of nocache variables or nocache plugin 61 | $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; 62 | // compile code 63 | $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; 64 | } else { 65 | // must endblock be nocache? 66 | if ($compiler->nocache) { 67 | $compiler->tag_nocache = true; 68 | } 69 | // closing tag of block plugin, restore nocache 70 | list($_params, $compiler->nocache) = $this->closeTag($compiler, substr($tag, 0, -5)); 71 | // This tag does create output 72 | $compiler->has_output = true; 73 | // compile code 74 | if (!isset($parameter['modifier_list'])) { 75 | $mod_pre = $mod_post =''; 76 | } else { 77 | $mod_pre = ' ob_start(); '; 78 | $mod_post = 'echo '.$compiler->compileTag('private_modifier',array(),array('modifierlist'=>$parameter['modifier_list'],'value'=>'ob_get_clean()')).';'; 79 | } 80 | $output = "smarty->_tag_stack);?>"; 81 | } 82 | return $output . "\n"; 83 | } 84 | 85 | } 86 | 87 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifiercompiler.escape.php: -------------------------------------------------------------------------------- 1 | 18 | * Name: escape
19 | * Purpose: escape string for output 20 | * 21 | * @link http://www.smarty.net/docsv2/en/language.modifier.escape count_characters (Smarty online manual) 22 | * @author Rodney Rehm 23 | * @param array $params parameters 24 | * @return string with compiled code 25 | */ 26 | function smarty_modifiercompiler_escape($params, $compiler) 27 | { 28 | try { 29 | $esc_type = smarty_literal_compiler_param($params, 1, 'html'); 30 | $char_set = smarty_literal_compiler_param($params, 2, SMARTY_RESOURCE_CHAR_SET); 31 | $double_encode = smarty_literal_compiler_param($params, 3, true); 32 | 33 | if (!$char_set) { 34 | $char_set = SMARTY_RESOURCE_CHAR_SET; 35 | } 36 | 37 | switch ($esc_type) { 38 | case 'html': 39 | return 'htmlspecialchars(' 40 | . $params[0] .', ENT_QUOTES, ' 41 | . var_export($char_set, true) . ', ' 42 | . var_export($double_encode, true) . ')'; 43 | 44 | case 'htmlall': 45 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 46 | return 'mb_convert_encoding(htmlspecialchars(' 47 | . $params[0] .', ENT_QUOTES, ' 48 | . var_export($char_set, true) . ', ' 49 | . var_export($double_encode, true) 50 | . '), "HTML-ENTITIES", ' 51 | . var_export($char_set, true) . ')'; 52 | } 53 | 54 | // no MBString fallback 55 | return 'htmlentities(' 56 | . $params[0] .', ENT_QUOTES, ' 57 | . var_export($char_set, true) . ', ' 58 | . var_export($double_encode, true) . ')'; 59 | 60 | case 'url': 61 | return 'rawurlencode(' . $params[0] . ')'; 62 | 63 | case 'urlpathinfo': 64 | return 'str_replace("%2F", "/", rawurlencode(' . $params[0] . '))'; 65 | 66 | case 'quotes': 67 | // escape unescaped single quotes 68 | return 'preg_replace("%(? "\\\\\\\\", "\'" => "\\\\\'", "\"" => "\\\\\"", "\\r" => "\\\\r", "\\n" => "\\\n", " "<\/" ))'; 73 | 74 | } 75 | } catch(SmartyException $e) { 76 | // pass through to regular plugin fallback 77 | } 78 | 79 | // could not optimize |escape call, so fallback to regular plugin 80 | if ($compiler->tag_nocache | $compiler->nocache) { 81 | $compiler->template->required_plugins['nocache']['escape']['modifier']['file'] = SMARTY_PLUGINS_DIR .'modifier.escape.php'; 82 | $compiler->template->required_plugins['nocache']['escape']['modifier']['function'] = 'smarty_modifier_escape'; 83 | } else { 84 | $compiler->template->required_plugins['compiled']['escape']['modifier']['file'] = SMARTY_PLUGINS_DIR .'modifier.escape.php'; 85 | $compiler->template->required_plugins['compiled']['escape']['modifier']['function'] = 'smarty_modifier_escape'; 86 | } 87 | return 'smarty_modifier_escape(' . join( ', ', $params ) . ')'; 88 | } 89 | 90 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/function.cycle.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: cycle
14 | * Date: May 3, 2002
15 | * Purpose: cycle through given values
16 | * Params: 17 | *
 18 |  * - name      - name of cycle (optional)
 19 |  * - values    - comma separated list of values to cycle, or an array of values to cycle
 20 |  *               (this can be left out for subsequent calls)
 21 |  * - reset     - boolean - resets given var to true
 22 |  * - print     - boolean - print var or not. default is true
 23 |  * - advance   - boolean - whether or not to advance the cycle
 24 |  * - delimiter - the value delimiter, default is ","
 25 |  * - assign    - boolean, assigns to template var instead of printed.
 26 |  * 
27 | * Examples:
28 | *
 29 |  * {cycle values="#eeeeee,#d0d0d0d"}
 30 |  * {cycle name=row values="one,two,three" reset=true}
 31 |  * {cycle name=row}
 32 |  * 
33 | * 34 | * @link http://www.smarty.net/manual/en/language.function.cycle.php {cycle} 35 | * (Smarty online manual) 36 | * @author Monte Ohrt 37 | * @author credit to Mark Priatel 38 | * @author credit to Gerard 39 | * @author credit to Jason Sweat 40 | * @version 1.3 41 | * @param array $params parameters 42 | * @param Smarty_Internal_Template $template template object 43 | * @return string|null 44 | */ 45 | 46 | function smarty_function_cycle($params, $template) 47 | { 48 | static $cycle_vars; 49 | 50 | $name = (empty($params['name'])) ? 'default' : $params['name']; 51 | $print = (isset($params['print'])) ? (bool)$params['print'] : true; 52 | $advance = (isset($params['advance'])) ? (bool)$params['advance'] : true; 53 | $reset = (isset($params['reset'])) ? (bool)$params['reset'] : false; 54 | 55 | if (!isset($params['values'])) { 56 | if(!isset($cycle_vars[$name]['values'])) { 57 | trigger_error("cycle: missing 'values' parameter"); 58 | return; 59 | } 60 | } else { 61 | if(isset($cycle_vars[$name]['values']) 62 | && $cycle_vars[$name]['values'] != $params['values'] ) { 63 | $cycle_vars[$name]['index'] = 0; 64 | } 65 | $cycle_vars[$name]['values'] = $params['values']; 66 | } 67 | 68 | if (isset($params['delimiter'])) { 69 | $cycle_vars[$name]['delimiter'] = $params['delimiter']; 70 | } elseif (!isset($cycle_vars[$name]['delimiter'])) { 71 | $cycle_vars[$name]['delimiter'] = ','; 72 | } 73 | 74 | if(is_array($cycle_vars[$name]['values'])) { 75 | $cycle_array = $cycle_vars[$name]['values']; 76 | } else { 77 | $cycle_array = explode($cycle_vars[$name]['delimiter'],$cycle_vars[$name]['values']); 78 | } 79 | 80 | if(!isset($cycle_vars[$name]['index']) || $reset ) { 81 | $cycle_vars[$name]['index'] = 0; 82 | } 83 | 84 | if (isset($params['assign'])) { 85 | $print = false; 86 | $template->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]); 87 | } 88 | 89 | if($print) { 90 | $retval = $cycle_array[$cycle_vars[$name]['index']]; 91 | } else { 92 | $retval = null; 93 | } 94 | 95 | if($advance) { 96 | if ( $cycle_vars[$name]['index'] >= count($cycle_array) -1 ) { 97 | $cycle_vars[$name]['index'] = 0; 98 | } else { 99 | $cycle_vars[$name]['index']++; 100 | } 101 | } 102 | 103 | return $retval; 104 | } 105 | 106 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_include_php.php: -------------------------------------------------------------------------------- 1 | smarty instanceof SmartyBC)) { 52 | throw new SmartyException("{include_php} is deprecated, use SmartyBC class to enable"); 53 | } 54 | // check and get attributes 55 | $_attr = $this->getAttributes($compiler, $args); 56 | 57 | $_output = 'template; 60 | $_filepath = false; 61 | eval('$_file = ' . $_attr['file'] . ';'); 62 | if (!isset($compiler->smarty->security_policy) && file_exists($_file)) { 63 | $_filepath = $_file; 64 | } else { 65 | if (isset($compiler->smarty->security_policy)) { 66 | $_dir = $compiler->smarty->security_policy->trusted_dir; 67 | } else { 68 | $_dir = $compiler->smarty->trusted_dir; 69 | } 70 | if (!empty($_dir)) { 71 | foreach((array)$_dir as $_script_dir) { 72 | $_script_dir = rtrim($_script_dir, '/\\') . DS; 73 | if (file_exists($_script_dir . $_file)) { 74 | $_filepath = $_script_dir . $_file; 75 | break; 76 | } 77 | } 78 | } 79 | } 80 | if ($_filepath == false) { 81 | $compiler->trigger_template_error("{include_php} file '{$_file}' is not readable", $compiler->lex->taglineno); 82 | } 83 | 84 | if (isset($compiler->smarty->security_policy)) { 85 | $compiler->smarty->security_policy->isTrustedPHPDir($_filepath); 86 | } 87 | 88 | if (isset($_attr['assign'])) { 89 | // output will be stored in a smarty variable instead of being displayed 90 | $_assign = $_attr['assign']; 91 | } 92 | $_once = '_once'; 93 | if (isset($_attr['once'])) { 94 | if ($_attr['once'] == 'false') { 95 | $_once = ''; 96 | } 97 | } 98 | 99 | if (isset($_assign)) { 100 | return "assign({$_assign},ob_get_contents()); ob_end_clean();?>"; 101 | } else { 102 | return "\n"; 103 | } 104 | } 105 | 106 | } 107 | 108 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/block.textformat.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: textformat
14 | * Purpose: format text a certain way with preset styles 15 | * or custom wrap/indent settings
16 | * Params: 17 | *
 18 |  * - style         - string (email)
 19 |  * - indent        - integer (0)
 20 |  * - wrap          - integer (80)
 21 |  * - wrap_char     - string ("\n")
 22 |  * - indent_char   - string (" ")
 23 |  * - wrap_boundary - boolean (true)
 24 |  * 
25 | * 26 | * @link http://www.smarty.net/manual/en/language.function.textformat.php {textformat} 27 | * (Smarty online manual) 28 | * @param array $params parameters 29 | * @param string $content contents of the block 30 | * @param Smarty_Internal_Template $template template object 31 | * @param boolean &$repeat repeat flag 32 | * @return string content re-formatted 33 | * @author Monte Ohrt 34 | */ 35 | function smarty_block_textformat($params, $content, $template, &$repeat) 36 | { 37 | if (is_null($content)) { 38 | return; 39 | } 40 | 41 | $style = null; 42 | $indent = 0; 43 | $indent_first = 0; 44 | $indent_char = ' '; 45 | $wrap = 80; 46 | $wrap_char = "\n"; 47 | $wrap_cut = false; 48 | $assign = null; 49 | 50 | foreach ($params as $_key => $_val) { 51 | switch ($_key) { 52 | case 'style': 53 | case 'indent_char': 54 | case 'wrap_char': 55 | case 'assign': 56 | $$_key = (string)$_val; 57 | break; 58 | 59 | case 'indent': 60 | case 'indent_first': 61 | case 'wrap': 62 | $$_key = (int)$_val; 63 | break; 64 | 65 | case 'wrap_cut': 66 | $$_key = (bool)$_val; 67 | break; 68 | 69 | default: 70 | trigger_error("textformat: unknown attribute '$_key'"); 71 | } 72 | } 73 | 74 | if ($style == 'email') { 75 | $wrap = 72; 76 | } 77 | // split into paragraphs 78 | $_paragraphs = preg_split('![\r\n]{2}!', $content); 79 | $_output = ''; 80 | 81 | 82 | foreach ($_paragraphs as &$_paragraph) { 83 | if (!$_paragraph) { 84 | continue; 85 | } 86 | // convert mult. spaces & special chars to single space 87 | $_paragraph = preg_replace(array('!\s+!u', '!(^\s+)|(\s+$)!u'), array(' ', ''), $_paragraph); 88 | // indent first line 89 | if ($indent_first > 0) { 90 | $_paragraph = str_repeat($indent_char, $indent_first) . $_paragraph; 91 | } 92 | // wordwrap sentences 93 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 94 | require_once(SMARTY_PLUGINS_DIR . 'shared.mb_wordwrap.php'); 95 | $_paragraph = smarty_mb_wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut); 96 | } else { 97 | $_paragraph = wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut); 98 | } 99 | // indent lines 100 | if ($indent > 0) { 101 | $_paragraph = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraph); 102 | } 103 | } 104 | $_output = implode($wrap_char . $wrap_char, $_paragraphs); 105 | 106 | if ($assign) { 107 | $template->assign($assign, $_output); 108 | } else { 109 | return $_output; 110 | } 111 | } 112 | 113 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_private_modifier.php: -------------------------------------------------------------------------------- 1 | getAttributes($compiler, $args); 33 | $output = $parameter['value']; 34 | // loop over list of modifiers 35 | foreach ($parameter['modifierlist'] as $single_modifier) { 36 | $modifier = $single_modifier[0]; 37 | $single_modifier[0] = $output; 38 | $params = implode(',', $single_modifier); 39 | // check for registered modifier 40 | if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][$modifier])) { 41 | $function = $compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][$modifier][0]; 42 | if (!is_array($function)) { 43 | $output = "{$function}({$params})"; 44 | } else { 45 | if (is_object($function[0])) { 46 | $output = '$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][\'' . $modifier . '\'][0][0]->' . $function[1] . '(' . $params . ')'; 47 | } else { 48 | $output = $function[0] . '::' . $function[1] . '(' . $params . ')'; 49 | } 50 | } 51 | } else if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIERCOMPILER][$modifier][0])) { 52 | $output = call_user_func($compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIERCOMPILER][$modifier][0], $single_modifier, $compiler->smarty); 53 | // check for plugin modifiercompiler 54 | } else if ($compiler->smarty->loadPlugin('smarty_modifiercompiler_' . $modifier)) { 55 | // check if modifier allowed 56 | if (!is_object($compiler->smarty->security_policy) || $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)) { 57 | $plugin = 'smarty_modifiercompiler_' . $modifier; 58 | $output = $plugin($single_modifier, $compiler); 59 | } 60 | // check for plugin modifier 61 | } else if ($function = $compiler->getPlugin($modifier, Smarty::PLUGIN_MODIFIER)) { 62 | // check if modifier allowed 63 | if (!is_object($compiler->smarty->security_policy) || $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)) { 64 | $output = "{$function}({$params})"; 65 | } 66 | // check if trusted PHP function 67 | } else if (is_callable($modifier)) { 68 | // check if modifier allowed 69 | if (!is_object($compiler->smarty->security_policy) || $compiler->smarty->security_policy->isTrustedPhpModifier($modifier, $compiler)) { 70 | $output = "{$modifier}({$params})"; 71 | } 72 | } else { 73 | $compiler->trigger_template_error("unknown modifier \"" . $modifier . "\"", $compiler->lex->taglineno); 74 | } 75 | } 76 | return $output; 77 | } 78 | 79 | } 80 | 81 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_smartytemplatecompiler.php: -------------------------------------------------------------------------------- 1 | smarty = $smarty; 77 | parent::__construct(); 78 | // get required plugins 79 | $this->lexer_class = $lexer_class; 80 | $this->parser_class = $parser_class; 81 | } 82 | 83 | /** 84 | * Methode to compile a Smarty template 85 | * 86 | * @param mixed $_content template source 87 | * @return bool true if compiling succeeded, false if it failed 88 | */ 89 | protected function doCompile($_content) 90 | { 91 | /* here is where the compiling takes place. Smarty 92 | tags in the templates are replaces with PHP code, 93 | then written to compiled files. */ 94 | // init the lexer/parser to compile the template 95 | $this->lex = new $this->lexer_class($_content, $this); 96 | $this->parser = new $this->parser_class($this->lex, $this); 97 | if ($this->smarty->_parserdebug) 98 | $this->parser->PrintTrace(); 99 | // get tokens from lexer and parse them 100 | while ($this->lex->yylex() && !$this->abort_and_recompile) { 101 | if ($this->smarty->_parserdebug) { 102 | echo "
Line {$this->lex->line} Parsing  {$this->parser->yyTokenName[$this->lex->token]} Token " .
103 |                     htmlentities($this->lex->value) . "
"; 104 | } 105 | $this->parser->doParse($this->lex->token, $this->lex->value); 106 | } 107 | 108 | if ($this->abort_and_recompile) { 109 | // exit here on abort 110 | return false; 111 | } 112 | // finish parsing process 113 | $this->parser->doParse(0, 0); 114 | // check for unclosed tags 115 | if (count($this->_tag_stack) > 0) { 116 | // get stacked info 117 | list($openTag, $_data) = array_pop($this->_tag_stack); 118 | $this->trigger_template_error("unclosed {" . $openTag . "} tag"); 119 | } 120 | // return compiled code 121 | // return str_replace(array("? >\nparser->retvalue); 122 | return $this->parser->retvalue; 123 | } 124 | 125 | } 126 | 127 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_while.php: -------------------------------------------------------------------------------- 1 | getAttributes($compiler, $args); 32 | $this->openTag($compiler, 'while', $compiler->nocache); 33 | 34 | if (!array_key_exists("if condition",$parameter)) { 35 | $compiler->trigger_template_error("missing while condition", $compiler->lex->taglineno); 36 | } 37 | 38 | // maybe nocache because of nocache variables 39 | $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; 40 | if (is_array($parameter['if condition'])) { 41 | if ($compiler->nocache) { 42 | $_nocache = ',true'; 43 | // create nocache var to make it know for further compiling 44 | if (is_array($parameter['if condition']['var'])) { 45 | $compiler->template->tpl_vars[trim($parameter['if condition']['var']['var'], "'")] = new Smarty_variable(null, true); 46 | } else { 47 | $compiler->template->tpl_vars[trim($parameter['if condition']['var'], "'")] = new Smarty_variable(null, true); 48 | } 49 | } else { 50 | $_nocache = ''; 51 | } 52 | if (is_array($parameter['if condition']['var'])) { 53 | $_output = "tpl_vars[" . $parameter['if condition']['var']['var'] . "]) || !is_array(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value)) \$_smarty_tpl->createLocalArrayVariable(" . $parameter['if condition']['var']['var'] . "$_nocache);\n"; 54 | $_output .= "while (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . $parameter['if condition']['var']['smarty_internal_index'] . " = " . $parameter['if condition']['value'] . "){?>"; 55 | } else { 56 | $_output = "tpl_vars[" . $parameter['if condition']['var'] . "])) \$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "] = new Smarty_Variable(null{$_nocache});"; 57 | $_output .= "while (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . $parameter['if condition']['value'] . "){?>"; 58 | } 59 | return $_output; 60 | } else { 61 | return ""; 62 | } 63 | } 64 | 65 | } 66 | 67 | /** 68 | * Smarty Internal Plugin Compile Whileclose Class 69 | * 70 | * @package Smarty 71 | * @subpackage Compiler 72 | */ 73 | class Smarty_Internal_Compile_Whileclose extends Smarty_Internal_CompileBase { 74 | 75 | /** 76 | * Compiles code for the {/while} tag 77 | * 78 | * @param array $args array with attributes from parser 79 | * @param object $compiler compiler object 80 | * @return string compiled code 81 | */ 82 | public function compile($args, $compiler) 83 | { 84 | // must endblock be nocache? 85 | if ($compiler->nocache) { 86 | $compiler->tag_nocache = true; 87 | } 88 | $compiler->nocache = $this->closeTag($compiler, array('while')); 89 | return ""; 90 | } 91 | 92 | } 93 | 94 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_private_object_block_function.php: -------------------------------------------------------------------------------- 1 | getAttributes($compiler, $args); 44 | if ($_attr['nocache'] === true) { 45 | $compiler->tag_nocache = true; 46 | } 47 | unset($_attr['nocache']); 48 | // convert attributes into parameter array string 49 | $_paramsArray = array(); 50 | foreach ($_attr as $_key => $_value) { 51 | if (is_int($_key)) { 52 | $_paramsArray[] = "$_key=>$_value"; 53 | } else { 54 | $_paramsArray[] = "'$_key'=>$_value"; 55 | } 56 | } 57 | $_params = 'array(' . implode(",", $_paramsArray) . ')'; 58 | 59 | $this->openTag($compiler, $tag . '->' . $method, array($_params, $compiler->nocache)); 60 | // maybe nocache because of nocache variables or nocache plugin 61 | $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; 62 | // compile code 63 | $output = "smarty->_tag_stack[] = array('{$tag}->{$method}', {$_params}); \$_block_repeat=true; echo \$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; 64 | } else { 65 | $base_tag = substr($tag, 0, -5); 66 | // must endblock be nocache? 67 | if ($compiler->nocache) { 68 | $compiler->tag_nocache = true; 69 | } 70 | // closing tag of block plugin, restore nocache 71 | list($_params, $compiler->nocache) = $this->closeTag($compiler, $base_tag . '->' . $method); 72 | // This tag does create output 73 | $compiler->has_output = true; 74 | // compile code 75 | if (!isset($parameter['modifier_list'])) { 76 | $mod_pre = $mod_post = ''; 77 | } else { 78 | $mod_pre = ' ob_start(); '; 79 | $mod_post = 'echo ' . $compiler->compileTag('private_modifier', array(), array('modifierlist' => $parameter['modifier_list'], 'value' => 'ob_get_clean()')) . ';'; 80 | } 81 | $output = "smarty->registered_objects['{$base_tag}'][0]->{$method}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); " . $mod_post . " } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; 82 | } 83 | return $output . "\n"; 84 | } 85 | 86 | } 87 | 88 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_private_special_variable.php: -------------------------------------------------------------------------------- 1 | getVariable('smarty')->value$parameter"; 35 | case 'section': 36 | return "\$_smarty_tpl->getVariable('smarty')->value$parameter"; 37 | case 'capture': 38 | return "Smarty::\$_smarty_vars$parameter"; 39 | case 'now': 40 | return 'time()'; 41 | case 'cookies': 42 | if (isset($compiler->smarty->security_policy) && !$compiler->smarty->security_policy->allow_super_globals) { 43 | $compiler->trigger_template_error("(secure mode) super globals not permitted"); 44 | break; 45 | } 46 | $compiled_ref = '$_COOKIE'; 47 | break; 48 | 49 | case 'get': 50 | case 'post': 51 | case 'env': 52 | case 'server': 53 | case 'session': 54 | case 'request': 55 | if (isset($compiler->smarty->security_policy) && !$compiler->smarty->security_policy->allow_super_globals) { 56 | $compiler->trigger_template_error("(secure mode) super globals not permitted"); 57 | break; 58 | } 59 | $compiled_ref = '$_'.strtoupper($variable); 60 | break; 61 | 62 | case 'template': 63 | return 'basename($_smarty_tpl->source->filepath)'; 64 | 65 | case 'current_dir': 66 | return 'dirname($_smarty_tpl->source->filepath)'; 67 | 68 | case 'version': 69 | $_version = Smarty::SMARTY_VERSION; 70 | return "'$_version'"; 71 | 72 | case 'const': 73 | if (isset($compiler->smarty->security_policy) && !$compiler->smarty->security_policy->allow_constants) { 74 | $compiler->trigger_template_error("(secure mode) constants not permitted"); 75 | break; 76 | } 77 | return '@' . trim($_index[1], "'"); 78 | 79 | case 'config': 80 | return "\$_smarty_tpl->getConfigVariable($_index[1])"; 81 | case 'ldelim': 82 | $_ldelim = $compiler->smarty->left_delimiter; 83 | return "'$_ldelim'"; 84 | 85 | case 'rdelim': 86 | $_rdelim = $compiler->smarty->right_delimiter; 87 | return "'$_rdelim'"; 88 | 89 | default: 90 | $compiler->trigger_template_error('$smarty.' . trim($_index[0], "'") . ' is invalid'); 91 | break; 92 | } 93 | if (isset($_index[1])) { 94 | array_shift($_index); 95 | foreach ($_index as $_ind) { 96 | $compiled_ref = $compiled_ref . "[$_ind]"; 97 | } 98 | } 99 | return $compiled_ref; 100 | } 101 | 102 | } 103 | 104 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/modifier.debug_print_var.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: debug_print_var
14 | * Purpose: formats variable contents for display in the console 15 | * 16 | * @author Monte Ohrt 17 | * @param array|object $var variable to be formatted 18 | * @param integer $depth maximum recursion depth if $var is an array 19 | * @param integer $length maximum string length if $var is a string 20 | * @return string 21 | */ 22 | function smarty_modifier_debug_print_var ($var, $depth = 0, $length = 40) 23 | { 24 | $_replace = array("\n" => '\n', 25 | "\r" => '\r', 26 | "\t" => '\t' 27 | ); 28 | 29 | switch (gettype($var)) { 30 | case 'array' : 31 | $results = 'Array (' . count($var) . ')'; 32 | foreach ($var as $curr_key => $curr_val) { 33 | $results .= '
' . str_repeat(' ', $depth * 2) 34 | . '' . strtr($curr_key, $_replace) . ' => ' 35 | . smarty_modifier_debug_print_var($curr_val, ++$depth, $length); 36 | $depth--; 37 | } 38 | break; 39 | 40 | case 'object' : 41 | $object_vars = get_object_vars($var); 42 | $results = '' . get_class($var) . ' Object (' . count($object_vars) . ')'; 43 | foreach ($object_vars as $curr_key => $curr_val) { 44 | $results .= '
' . str_repeat(' ', $depth * 2) 45 | . ' ->' . strtr($curr_key, $_replace) . ' = ' 46 | . smarty_modifier_debug_print_var($curr_val, ++$depth, $length); 47 | $depth--; 48 | } 49 | break; 50 | 51 | case 'boolean' : 52 | case 'NULL' : 53 | case 'resource' : 54 | if (true === $var) { 55 | $results = 'true'; 56 | } elseif (false === $var) { 57 | $results = 'false'; 58 | } elseif (null === $var) { 59 | $results = 'null'; 60 | } else { 61 | $results = htmlspecialchars((string) $var); 62 | } 63 | $results = '' . $results . ''; 64 | break; 65 | 66 | case 'integer' : 67 | case 'float' : 68 | $results = htmlspecialchars((string) $var); 69 | break; 70 | 71 | case 'string' : 72 | $results = strtr($var, $_replace); 73 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 74 | if (mb_strlen($var, SMARTY_RESOURCE_CHAR_SET) > $length) { 75 | $results = mb_substr($var, 0, $length - 3, SMARTY_RESOURCE_CHAR_SET) . '...'; 76 | } 77 | } else { 78 | if (isset($var[$length])) { 79 | $results = substr($var, 0, $length - 3) . '...'; 80 | } 81 | } 82 | 83 | $results = htmlspecialchars('"' . $results . '"'); 84 | break; 85 | 86 | case 'unknown type' : 87 | default : 88 | $results = strtr((string) $var, $_replace); 89 | if (SMARTY_MBSTRING /* ^phpunit */&&empty($_SERVER['SMARTY_PHPUNIT_DISABLE_MBSTRING'])/* phpunit$ */) { 90 | if (mb_strlen($results, SMARTY_RESOURCE_CHAR_SET) > $length) { 91 | $results = mb_substr($results, 0, $length - 3, SMARTY_RESOURCE_CHAR_SET) . '...'; 92 | } 93 | } else { 94 | if (strlen($results) > $length) { 95 | $results = substr($results, 0, $length - 3) . '...'; 96 | } 97 | } 98 | 99 | $results = htmlspecialchars($results); 100 | } 101 | 102 | return $results; 103 | } 104 | 105 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_resource_php.php: -------------------------------------------------------------------------------- 1 | short_open_tag = ini_get( 'short_open_tag' ); 27 | } 28 | 29 | /** 30 | * populate Source Object with meta data from Resource 31 | * 32 | * @param Smarty_Template_Source $source source object 33 | * @param Smarty_Internal_Template $_template template object 34 | * @return void 35 | */ 36 | public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) 37 | { 38 | $source->filepath = $this->buildFilepath($source, $_template); 39 | 40 | if ($source->filepath !== false) { 41 | if (is_object($source->smarty->security_policy)) { 42 | $source->smarty->security_policy->isTrustedResourceDir($source->filepath); 43 | } 44 | 45 | $source->uid = sha1($source->filepath); 46 | if ($source->smarty->compile_check) { 47 | $source->timestamp = @filemtime($source->filepath); 48 | $source->exists = !!$source->timestamp; 49 | } 50 | } 51 | } 52 | 53 | /** 54 | * populate Source Object with timestamp and exists from Resource 55 | * 56 | * @param Smarty_Template_Source $source source object 57 | * @return void 58 | */ 59 | public function populateTimestamp(Smarty_Template_Source $source) 60 | { 61 | $source->timestamp = @filemtime($source->filepath); 62 | $source->exists = !!$source->timestamp; 63 | } 64 | 65 | /** 66 | * Load template's source from file into current template object 67 | * 68 | * @param Smarty_Template_Source $source source object 69 | * @return string template source 70 | * @throws SmartyException if source cannot be loaded 71 | */ 72 | public function getContent(Smarty_Template_Source $source) 73 | { 74 | if ($source->timestamp) { 75 | return ''; 76 | } 77 | throw new SmartyException("Unable to read template {$source->type} '{$source->name}'"); 78 | } 79 | 80 | /** 81 | * Render and output the template (without using the compiler) 82 | * 83 | * @param Smarty_Template_Source $source source object 84 | * @param Smarty_Internal_Template $_template template object 85 | * @return void 86 | * @throws SmartyException if template cannot be loaded or allow_php_templates is disabled 87 | */ 88 | public function renderUncompiled(Smarty_Template_Source $source, Smarty_Internal_Template $_template) 89 | { 90 | $_smarty_template = $_template; 91 | 92 | if (!$source->smarty->allow_php_templates) { 93 | throw new SmartyException("PHP templates are disabled"); 94 | } 95 | if (!$source->exists) { 96 | if ($_template->parent instanceof Smarty_Internal_Template) { 97 | $parent_resource = " in '{$_template->parent->template_resource}'"; 98 | } else { 99 | $parent_resource = ''; 100 | } 101 | throw new SmartyException("Unable to load template {$source->type} '{$source->name}'{$parent_resource}"); 102 | } 103 | 104 | // prepare variables 105 | extract($_template->getTemplateVars()); 106 | 107 | // include PHP template with short open tags enabled 108 | ini_set( 'short_open_tag', '1' ); 109 | include($source->filepath); 110 | ini_set( 'short_open_tag', $this->short_open_tag ); 111 | } 112 | } 113 | 114 | ?> -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ##FIS-PC 2 | [![NPM version](https://badge.fury.io/js/fis-pc.png)](http://badge.fury.io/js/fis-pc) 3 | 4 | > FIS-PC提供了一套贯穿开发流程的开发体系和集成开发环境,为产品线提供前端开发底层架构,帮助工程师提高开发效率,沟通协作效率,快速实现需求并达到代码的最优化。 5 | 6 | ## 快速上手 7 | 8 | * [安装](https://github.com/xiangshouding/fis-pc/wiki/快速上手#) 9 | * npm install **-g** fis-pc 10 | * [三条命令,满足你的所有开发需求](https://github.com/xiangshouding/fis-pc/wiki/%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B#%E4%B8%89%E6%9D%A1%E5%91%BD%E4%BB%A4%E6%BB%A1%E8%B6%B3%E4%BD%A0%E7%9A%84%E6%89%80%E6%9C%89%E9%9C%80%E6%B1%82) 11 | * fis-pc install <name> 12 | * fis-pc release [options] 13 | * fis-pc server <command> [options] 14 | 15 | ## 示例演示 16 | 17 | * [示例安装](https://github.com/xiangshouding/fis-pc/wiki/%E7%A4%BA%E4%BE%8B#%E7%A4%BA%E4%BE%8B%E5%AE%89%E8%A3%85) 18 | * [示例预览](https://github.com/xiangshouding/fis-pc/wiki/%E7%A4%BA%E4%BE%8B#%E7%A4%BA%E4%BE%8B%E9%A2%84%E8%A7%88) 19 | 20 | ## 解决方案规范 21 | 22 | * [站点目录结构](https://github.com/xiangshouding/fis-pc/wiki/%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%E8%A7%84%E8%8C%83#) 23 | * [组件化](https://github.com/xiangshouding/fis-pc/wiki/%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%E8%A7%84%E8%8C%83#-1) 24 | 25 | ## 编译开发 26 | 27 | * 基础开发 28 | * [模板](https://github.com/xiangshouding/fis-pc/wiki/模板) 29 | * [页面](https://github.com/xiangshouding/fis-pc/wiki/%E6%A8%A1%E6%9D%BF#%E9%A1%B5%E9%9D%A2) 30 | * [widget](https://github.com/xiangshouding/fis-pc/wiki/%E6%A8%A1%E6%9D%BF#widget) 31 | * [语言能力](https://github.com/xiangshouding/fis-pc/wiki/%E6%A8%A1%E6%9D%BF#widget) 32 | * [JS](https://github.com/xiangshouding/fis-pc/wiki/js) 33 | * [widget](https://github.com/xiangshouding/fis-pc/wiki/js#widget) 34 | * [其他](https://github.com/xiangshouding/fis-pc/wiki/js#%E5%85%B6%E4%BB%96) 35 | * [语言能力](https://github.com/xiangshouding/fis-pc/wiki/js#%E8%AF%AD%E8%A8%80%E8%83%BD%E5%8A%9B) 36 | * [CSS](https://github.com/xiangshouding/fis-pc/wiki/css) 37 | * [widget](https://github.com/xiangshouding/fis-pc/wiki/css#widget) 38 | * [其他](https://github.com/xiangshouding/fis-pc/wiki/css#%E5%85%B6%E4%BB%96) 39 | * [语言能力](https://github.com/xiangshouding/fis-pc/wiki/css#%E8%AF%AD%E8%A8%80%E8%83%BD%E5%8A%9B) 40 | * 自动化工具 41 | * [模板XSS修复工具](https://github.com/xiangshouding/fis-pc/wiki/%E8%87%AA%E5%8A%A8%E5%8C%96%E5%B7%A5%E5%85%B7#xss) 42 | * [图片合并工具](https://github.com/xiangshouding/fis-pc/wiki/%E8%87%AA%E5%8A%A8%E5%8C%96%E5%B7%A5%E5%85%B7#%E5%9B%BE%E7%89%87%E5%90%88%E5%B9%B6%E5%B7%A5%E5%85%B7) 43 | * [模板压缩工具](https://github.com/xiangshouding/fis-pc/wiki/%E8%87%AA%E5%8A%A8%E5%8C%96%E5%B7%A5%E5%85%B7#%E6%A8%A1%E6%9D%BF%E5%8E%8B%E7%BC%A9%E5%B7%A5%E5%85%B7) 44 | * [JS压缩工具](https://github.com/xiangshouding/fis-pc/wiki/%E8%87%AA%E5%8A%A8%E5%8C%96%E5%B7%A5%E5%85%B7#js%E5%8E%8B%E7%BC%A9%E5%B7%A5%E5%85%B7) 45 | * [CSS压缩工具](https://github.com/xiangshouding/fis-pc/wiki/%E8%87%AA%E5%8A%A8%E5%8C%96%E5%B7%A5%E5%85%B7#css%E5%8E%8B%E7%BC%A9%E5%B7%A5%E5%85%B7) 46 | * 插件使用 47 | * [html](https://github.com/xiangshouding/fis-pc/wiki/%E6%8F%92%E4%BB%B6%E4%BD%BF%E7%94%A8#html) 48 | * [head](https://github.com/xiangshouding/fis-pc/wiki/%E6%8F%92%E4%BB%B6%E4%BD%BF%E7%94%A8#head) 49 | * [body](https://github.com/xiangshouding/fis-pc/wiki/%E6%8F%92%E4%BB%B6%E4%BD%BF%E7%94%A8#body) 50 | * [script](https://github.com/xiangshouding/fis-pc/wiki/%E6%8F%92%E4%BB%B6%E4%BD%BF%E7%94%A8#script) 51 | * [require](https://github.com/xiangshouding/fis-pc/wiki/%E6%8F%92%E4%BB%B6%E4%BD%BF%E7%94%A8#require) 52 | * [widget](https://github.com/xiangshouding/fis-pc/wiki/%E6%8F%92%E4%BB%B6%E4%BD%BF%E7%94%A8#widget) 53 | * 开发配置 54 | * [基础配置](https://github.com/xiangshouding/fis-pc/wiki/%E5%9F%BA%E7%A1%80%E9%85%8D%E7%BD%AE) 55 | * [打包配置](https://github.com/xiangshouding/fis-pc/wiki/%E6%89%93%E5%8C%85%E9%85%8D%E7%BD%AE) 56 | * [插件配置](https://github.com/xiangshouding/fis-pc/wiki/%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE) 57 | * [产出配置](https://github.com/xiangshouding/fis-pc/wiki/%E4%BA%A7%E5%87%BA%E9%85%8D%E7%BD%AE) 58 | 59 | ## 联调自测 60 | 61 | * [本地模拟请求转发功能](https://github.com/xiangshouding/fis-pc/wiki/%E6%9C%AC%E5%9C%B0%E6%A8%A1%E6%8B%9F%E8%AF%B7%E6%B1%82%E8%BD%AC%E5%8F%91%E5%8A%9F%E8%83%BD) 62 | * [本地调试数据功能](https://github.com/xiangshouding/fis-pc/wiki/%E6%9C%AC%E5%9C%B0%E8%B0%83%E8%AF%95%E6%95%B0%E6%8D%AE%E5%8A%9F%E8%83%BD) 63 | * [线上调试测试](https://github.com/xiangshouding/fis-pc/wiki/%E7%BA%BF%E4%B8%8A%E8%B0%83%E8%AF%95%E6%B5%8B%E8%AF%95) 64 | 65 | ## 上传部署 66 | 67 | * [产出目录](https://github.com/xiangshouding/fis-pc/wiki/%E4%B8%8A%E4%BC%A0%E9%83%A8%E7%BD%B2#%E4%BA%A7%E5%87%BA%E7%9B%AE%E5%BD%95) 68 | * [上传配置](https://github.com/xiangshouding/fis-pc/wiki/%E4%B8%8A%E4%BC%A0%E9%83%A8%E7%BD%B2#%E4%B8%8A%E4%BC%A0%E9%85%8D%E7%BD%AE) 69 | 70 | ## 编译提测 71 | 72 | * [编译脚本](https://github.com/xiangshouding/fis-pc/wiki/%E7%BC%96%E8%AF%91%E6%8F%90%E6%B5%8B#%E7%BC%96%E8%AF%91%E8%84%9A%E6%9C%AC) 73 | * [icafe编译](https://github.com/xiangshouding/fis-pc/wiki/%E7%BC%96%E8%AF%91%E6%8F%90%E6%B5%8B#icafe%E7%BC%96%E8%AF%91) 74 | -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_config_file_compiler.php: -------------------------------------------------------------------------------- 1 | smarty = $smarty; 64 | $this->config_data['sections'] = array(); 65 | $this->config_data['vars'] = array(); 66 | } 67 | 68 | /** 69 | * Method to compile a Smarty template. 70 | * 71 | * @param Smarty_Internal_Config $config config object 72 | * @return bool true if compiling succeeded, false if it failed 73 | */ 74 | public function compileSource(Smarty_Internal_Config $config) 75 | { 76 | /* here is where the compiling takes place. Smarty 77 | tags in the templates are replaces with PHP code, 78 | then written to compiled files. */ 79 | $this->config = $config; 80 | // get config file source 81 | $_content = $config->source->content . "\n"; 82 | // on empty template just return 83 | if ($_content == '') { 84 | return true; 85 | } 86 | // init the lexer/parser to compile the config file 87 | $lex = new Smarty_Internal_Configfilelexer($_content, $this->smarty); 88 | $parser = new Smarty_Internal_Configfileparser($lex, $this); 89 | if ($this->smarty->_parserdebug) $parser->PrintTrace(); 90 | // get tokens from lexer and parse them 91 | while ($lex->yylex()) { 92 | if ($this->smarty->_parserdebug) echo "
Parsing {$parser->yyTokenName[$lex->token]} Token {$lex->value} Line {$lex->line} \n"; 93 | $parser->doParse($lex->token, $lex->value); 94 | } 95 | // finish parsing process 96 | $parser->doParse(0, 0); 97 | $config->compiled_config = 'config_data, true) . '; ?>'; 98 | } 99 | 100 | /** 101 | * display compiler error messages without dying 102 | * 103 | * If parameter $args is empty it is a parser detected syntax error. 104 | * In this case the parser is called to obtain information about exspected tokens. 105 | * 106 | * If parameter $args contains a string this is used as error message 107 | * 108 | * @param string $args individual error message or null 109 | */ 110 | public function trigger_config_file_error($args = null) 111 | { 112 | $this->lex = Smarty_Internal_Configfilelexer::instance(); 113 | $this->parser = Smarty_Internal_Configfileparser::instance(); 114 | // get template source line which has error 115 | $line = $this->lex->line; 116 | if (isset($args)) { 117 | // $line--; 118 | } 119 | $match = preg_split("/\n/", $this->lex->data); 120 | $error_text = "Syntax error in config file '{$this->config->source->filepath}' on line {$line} '{$match[$line-1]}' "; 121 | if (isset($args)) { 122 | // individual error message 123 | $error_text .= $args; 124 | } else { 125 | // exspected token from parser 126 | foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) { 127 | $exp_token = $this->parser->yyTokenName[$token]; 128 | if (isset($this->lex->smarty_token_names[$exp_token])) { 129 | // token type from lexer 130 | $expect[] = '"' . $this->lex->smarty_token_names[$exp_token] . '"'; 131 | } else { 132 | // otherwise internal token name 133 | $expect[] = $this->parser->yyTokenName[$token]; 134 | } 135 | } 136 | // output parser error message 137 | $error_text .= ' - Unexpected "' . $this->lex->value . '", expected one of: ' . implode(' , ', $expect); 138 | } 139 | throw new SmartyCompilerException($error_text); 140 | } 141 | 142 | } 143 | 144 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/plugins/function.html_image.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: html_image
14 | * Date: Feb 24, 2003
15 | * Purpose: format HTML tags for the image
16 | * Examples: {html_image file="/images/masthead.gif"}
17 | * Output:
18 | * Params: 19 | *
 20 |  * - file        - (required) - file (and path) of image
 21 |  * - height      - (optional) - image height (default actual height)
 22 |  * - width       - (optional) - image width (default actual width)
 23 |  * - basedir     - (optional) - base directory for absolute paths, default is environment variable DOCUMENT_ROOT
 24 |  * - path_prefix - prefix for path output (optional, default empty)
 25 |  * 
26 | * 27 | * @link http://www.smarty.net/manual/en/language.function.html.image.php {html_image} 28 | * (Smarty online manual) 29 | * @author Monte Ohrt 30 | * @author credits to Duda 31 | * @version 1.0 32 | * @param array $params parameters 33 | * @param Smarty_Internal_Template $template template object 34 | * @return string 35 | * @uses smarty_function_escape_special_chars() 36 | */ 37 | function smarty_function_html_image($params, $template) 38 | { 39 | require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'); 40 | 41 | $alt = ''; 42 | $file = ''; 43 | $height = ''; 44 | $width = ''; 45 | $extra = ''; 46 | $prefix = ''; 47 | $suffix = ''; 48 | $path_prefix = ''; 49 | $server_vars = $_SERVER; 50 | $basedir = isset($server_vars['DOCUMENT_ROOT']) ? $server_vars['DOCUMENT_ROOT'] : ''; 51 | foreach($params as $_key => $_val) { 52 | switch ($_key) { 53 | case 'file': 54 | case 'height': 55 | case 'width': 56 | case 'dpi': 57 | case 'path_prefix': 58 | case 'basedir': 59 | $$_key = $_val; 60 | break; 61 | 62 | case 'alt': 63 | if (!is_array($_val)) { 64 | $$_key = smarty_function_escape_special_chars($_val); 65 | } else { 66 | throw new SmartyException ("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE); 67 | } 68 | break; 69 | 70 | case 'link': 71 | case 'href': 72 | $prefix = ''; 73 | $suffix = ''; 74 | break; 75 | 76 | default: 77 | if (!is_array($_val)) { 78 | $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"'; 79 | } else { 80 | throw new SmartyException ("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE); 81 | } 82 | break; 83 | } 84 | } 85 | 86 | if (empty($file)) { 87 | trigger_error("html_image: missing 'file' parameter", E_USER_NOTICE); 88 | return; 89 | } 90 | 91 | if (substr($file, 0, 1) == '/') { 92 | $_image_path = $basedir . $file; 93 | } else { 94 | $_image_path = $file; 95 | } 96 | 97 | if (!isset($params['width']) || !isset($params['height'])) { 98 | if (!$_image_data = @getimagesize($_image_path)) { 99 | if (!file_exists($_image_path)) { 100 | trigger_error("html_image: unable to find '$_image_path'", E_USER_NOTICE); 101 | return; 102 | } else if (!is_readable($_image_path)) { 103 | trigger_error("html_image: unable to read '$_image_path'", E_USER_NOTICE); 104 | return; 105 | } else { 106 | trigger_error("html_image: '$_image_path' is not a valid image file", E_USER_NOTICE); 107 | return; 108 | } 109 | } 110 | if (isset($template->smarty->security_policy)) { 111 | if (!$template->smarty->security_policy->isTrustedResourceDir($_image_path)) { 112 | return; 113 | } 114 | } 115 | 116 | if (!isset($params['width'])) { 117 | $width = $_image_data[0]; 118 | } 119 | if (!isset($params['height'])) { 120 | $height = $_image_data[1]; 121 | } 122 | } 123 | 124 | if (isset($params['dpi'])) { 125 | if (strstr($server_vars['HTTP_USER_AGENT'], 'Mac')) { 126 | $dpi_default = 72; 127 | } else { 128 | $dpi_default = 96; 129 | } 130 | $_resize = $dpi_default / $params['dpi']; 131 | $width = round($width * $_resize); 132 | $height = round($height * $_resize); 133 | } 134 | 135 | return $prefix . '' . $alt . '' . $suffix; 136 | } 137 | 138 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_call.php: -------------------------------------------------------------------------------- 1 | getAttributes($compiler, $args); 54 | // save possible attributes 55 | if (isset($_attr['assign'])) { 56 | // output will be stored in a smarty variable instead of beind displayed 57 | $_assign = $_attr['assign']; 58 | } 59 | $_name = $_attr['name']; 60 | if ($compiler->compiles_template_function) { 61 | $compiler->called_functions[] = trim($_name, "'\""); 62 | } 63 | unset($_attr['name'], $_attr['assign'], $_attr['nocache']); 64 | // set flag (compiled code of {function} must be included in cache file 65 | if ($compiler->nocache || $compiler->tag_nocache) { 66 | $_nocache = 'true'; 67 | } else { 68 | $_nocache = 'false'; 69 | } 70 | $_paramsArray = array(); 71 | foreach ($_attr as $_key => $_value) { 72 | if (is_int($_key)) { 73 | $_paramsArray[] = "$_key=>$_value"; 74 | } else { 75 | $_paramsArray[] = "'$_key'=>$_value"; 76 | } 77 | } 78 | if (isset($compiler->template->properties['function'][$_name]['parameter'])) { 79 | foreach ($compiler->template->properties['function'][$_name]['parameter'] as $_key => $_value) { 80 | if (!isset($_attr[$_key])) { 81 | if (is_int($_key)) { 82 | $_paramsArray[] = "$_key=>$_value"; 83 | } else { 84 | $_paramsArray[] = "'$_key'=>$_value"; 85 | } 86 | } 87 | } 88 | } elseif (isset($compiler->smarty->template_functions[$_name]['parameter'])) { 89 | foreach ($compiler->smarty->template_functions[$_name]['parameter'] as $_key => $_value) { 90 | if (!isset($_attr[$_key])) { 91 | if (is_int($_key)) { 92 | $_paramsArray[] = "$_key=>$_value"; 93 | } else { 94 | $_paramsArray[] = "'$_key'=>$_value"; 95 | } 96 | } 97 | } 98 | } 99 | //varibale name? 100 | if (!(strpos($_name, '$') === false)) { 101 | $call_cache = $_name; 102 | $call_function = '$tmp = "smarty_template_function_".' . $_name . '; $tmp'; 103 | } else { 104 | $_name = trim($_name, "'\""); 105 | $call_cache = "'{$_name}'"; 106 | $call_function = 'smarty_template_function_' . $_name; 107 | } 108 | 109 | $_params = 'array(' . implode(",", $_paramsArray) . ')'; 110 | $_hash = str_replace('-', '_', $compiler->template->properties['nocache_hash']); 111 | // was there an assign attribute 112 | if (isset($_assign)) { 113 | if ($compiler->template->caching) { 114 | $_output = "assign({$_assign}, ob_get_clean());?>\n"; 115 | } else { 116 | $_output = "assign({$_assign}, ob_get_clean());?>\n"; 117 | } 118 | } else { 119 | if ($compiler->template->caching) { 120 | $_output = "\n"; 121 | } else { 122 | $_output = "\n"; 123 | } 124 | } 125 | return $_output; 126 | } 127 | 128 | } 129 | 130 | ?> -------------------------------------------------------------------------------- /test/libs/smarty-3.1.5/sysplugins/smarty_internal_compile_extends.php: -------------------------------------------------------------------------------- 1 | true, 'eval' => true); 46 | $this->_rdl = preg_quote($compiler->smarty->right_delimiter); 47 | $this->_ldl = preg_quote($compiler->smarty->left_delimiter); 48 | $filepath = $compiler->template->source->filepath; 49 | // check and get attributes 50 | $_attr = $this->getAttributes($compiler, $args); 51 | if ($_attr['nocache'] === true) { 52 | $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); 53 | } 54 | 55 | $_smarty_tpl = $compiler->template; 56 | $include_file = null; 57 | if (strpos($_attr['file'], '$_tmp') !== false) { 58 | $compiler->trigger_template_error('illegal value for file attribute', $compiler->lex->taglineno); 59 | } 60 | eval('$include_file = ' . $_attr['file'] . ';'); 61 | // create template object 62 | $_template = new $compiler->smarty->template_class($include_file, $compiler->smarty, $compiler->template); 63 | // save file dependency 64 | if (isset($_is_stringy[$_template->source->type])) { 65 | $template_sha1 = sha1($include_file); 66 | } else { 67 | $template_sha1 = sha1($_template->source->filepath); 68 | } 69 | if (isset($compiler->template->properties['file_dependency'][$template_sha1])) { 70 | $compiler->trigger_template_error("illegal recursive call of \"{$include_file}\"", $compiler->lex->line - 1); 71 | } 72 | $compiler->template->properties['file_dependency'][$template_sha1] = array($_template->source->filepath, $_template->source->timestamp, $_template->source->type); 73 | $_content = substr($compiler->template->source->content, $compiler->lex->counter - 1); 74 | if (preg_match_all("!({$this->_ldl}block\s(.+?){$this->_rdl})!", $_content, $s) != 75 | preg_match_all("!({$this->_ldl}/block{$this->_rdl})!", $_content, $c)) { 76 | $compiler->trigger_template_error('unmatched {block} {/block} pairs'); 77 | } 78 | preg_match_all("!{$this->_ldl}block\s(.+?){$this->_rdl}|{$this->_ldl}/block{$this->_rdl}|{$this->_ldl}\*([\S\s]*?)\*{$this->_rdl}!", $_content, $_result, PREG_OFFSET_CAPTURE); 79 | $_result_count = count($_result[0]); 80 | $_start = 0; 81 | while ($_start+1 < $_result_count) { 82 | $_end = 0; 83 | $_level = 1; 84 | if (substr($_result[0][$_start][0],0,strlen($compiler->smarty->left_delimiter)+1) == $compiler->smarty->left_delimiter.'*') { 85 | $_start++; 86 | continue; 87 | } 88 | while ($_level != 0) { 89 | $_end++; 90 | if (substr($_result[0][$_start + $_end][0],0,strlen($compiler->smarty->left_delimiter)+1) == $compiler->smarty->left_delimiter.'*') { 91 | continue; 92 | } 93 | if (!strpos($_result[0][$_start + $_end][0], '/')) { 94 | $_level++; 95 | } else { 96 | $_level--; 97 | } 98 | } 99 | $_block_content = str_replace($compiler->smarty->left_delimiter . '$smarty.block.parent' . $compiler->smarty->right_delimiter, '%%%%SMARTY_PARENT%%%%', 100 | substr($_content, $_result[0][$_start][1] + strlen($_result[0][$_start][0]), $_result[0][$_start + $_end][1] - $_result[0][$_start][1] - + strlen($_result[0][$_start][0]))); 101 | Smarty_Internal_Compile_Block::saveBlockData($_block_content, $_result[0][$_start][0], $compiler->template, $filepath); 102 | $_start = $_start + $_end + 1; 103 | } 104 | if ($_template->source->type == 'extends') { 105 | $_template->block_data = $compiler->template->block_data; 106 | } 107 | $compiler->template->source->content = $_template->source->content; 108 | if ($_template->source->type == 'extends') { 109 | $compiler->template->block_data = $_template->block_data; 110 | foreach ($_template->source->components as $key => $component) { 111 | $compiler->template->properties['file_dependency'][$key] = array($component->filepath, $component->timestamp, $component->type); 112 | } 113 | } 114 | $compiler->template->source->filepath = $_template->source->filepath; 115 | $compiler->abort_and_recompile = true; 116 | return ''; 117 | } 118 | 119 | } 120 | 121 | ?> --------------------------------------------------------------------------------