Authored by hf

do fixes bug to render partials ext

@@ -21,9 +21,23 @@ @@ -21,9 +21,23 @@
21 21
22 ); 22 );
23 23
24 - return ' 24 + return ''.'<!DOCTYPE html>
  25 +<html>
  26 +<head>
  27 + <meta charset="utf-8">
  28 + <title>'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('title')), ENT_QUOTES, 'UTF-8').'</title>
  29 + <meta name="keywords" content="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('keywords')), ENT_QUOTES, 'UTF-8').'">
  30 + <meta name="description" content="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('description')), ENT_QUOTES, 'UTF-8').'">
  31 + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
  32 + <meta http-equiv="cleartype" content="on">
  33 + <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  34 + <meta content="telephone=no" name="format-detection" />
  35 + <meta content="email=no" name="format-detection" />
  36 +</head>
  37 +<body>'.'
25 This is a test '.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('test')), ENT_QUOTES, 'UTF-8').' 38 This is a test '.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('test')), ENT_QUOTES, 'UTF-8').'
26 39
27 -'; 40 +'.'</body>
  41 +</html>'.'';
28 } 42 }
29 ?> 43 ?>
@@ -97,13 +97,12 @@ class TemplateLayout implements View_Interface @@ -97,13 +97,12 @@ class TemplateLayout implements View_Interface
97 } 97 }
98 // 第一次渲染该模板的流程:取得模板内容 => 预编译成PHP函数 => 写入服务器生成PHP文件 98 // 第一次渲染该模板的流程:取得模板内容 => 预编译成PHP函数 => 写入服务器生成PHP文件
99 else { 99 else {
100 - echo $config->template->partials;  
101 $template = file_get_contents($viewName, false, null); 100 $template = file_get_contents($viewName, false, null);
102 $phpStr = LightnCandy::compile($template, array( 101 $phpStr = LightnCandy::compile($template, array(
103 // DEBUG: LightnCandy::FLAG_RENDER_DEBUG | LightnCandy::FLAG_ERROR_EXCEPTION 102 // DEBUG: LightnCandy::FLAG_RENDER_DEBUG | LightnCandy::FLAG_ERROR_EXCEPTION
104 'flags' => LightnCandy::FLAG_MUSTACHE | LightnCandy::FLAG_HANDLEBARS, // 使用MUSTACHE和HANDLEBARS的模板格式 103 'flags' => LightnCandy::FLAG_MUSTACHE | LightnCandy::FLAG_HANDLEBARS, // 使用MUSTACHE和HANDLEBARS的模板格式
105 'basedir' => array($config->template->partials), // 模板里使用 {{> partial_name}} 时查找的目录 104 'basedir' => array($config->template->partials), // 模板里使用 {{> partial_name}} 时查找的目录
106 - 'fileext' => array($tplExt), // 允许查找文件的后缀 105 + 'fileext' => array('.' . $tplExt), // 允许查找文件的后缀
107 'lcrun' => 'Plugin\LCRun3', // 指定编译模板的runtime 106 'lcrun' => 'Plugin\LCRun3', // 指定编译模板的runtime
108 )); 107 ));
109 // 文件流方式读取PHP方法 108 // 文件流方式读取PHP方法
1 -server {  
2 - listen 80;  
3 - server_name ezine.dev.yoho.cn apiezine.dev.yoho.cn;  
4 - index index.html index-dev.php;  
5 - root D:/workspace/yohoezine/ezine.yoho.cn;  
6 -  
7 - location / {  
8 - index index-dev.php;  
9 - }  
10 -  
11 - location ~* .*\.(php|php5)?$ {  
12 - fastcgi_pass 127.0.0.1:9000;  
13 - fastcgi_index index-dev.php;  
14 - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;  
15 - include fastcgi_params;  
16 - }  
17 -  
18 - location = /favicon.ico{  
19 - return 204;  
20 - }  
21 -  
22 - location ^~ /preview/ {  
23 - root D:/ezine;  
24 - }  
25 -  
26 - access_log E:/nginx/logs/ezine.new.log combined;  
27 - error_log E:/nginx/logs/ezine.error.log warn;  
28 -}  
29 -  
30 -  
31 -server {  
32 - listen 80;  
33 - server_name ezine.hf.com apiezine.hf.com;  
34 - index index.html index-dev.php;  
35 - root D:/workspace/yohoezine/ezine.myoho.net;  
36 -  
37 - location / {  
38 - index index-dev.php;  
39 - }  
40 -  
41 - location ~* .*\.(php|php5)?$ {  
42 - fastcgi_pass 127.0.0.1:9000;  
43 - fastcgi_index index-test.php;  
44 - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;  
45 - include fastcgi_params;  
46 - }  
47 -  
48 - location = /favicon.ico{  
49 - return 204;  
50 - }  
51 -  
52 - access_log E:/nginx/logs/ezine.old.log combined;  
53 - error_log E:/nginx/logs/ezine.error.log warn;  
54 -}  
1 -server  
2 -{  
3 - listen 80;  
4 - server_name localhost;  
5 -  
6 - #access_log /nginx/logs/access_test_yoho_cn.log combined;  
7 - error_log /nginx/logs/error_test_yoho_cn.log warn;  
8 -  
9 - root D:/opensource;  
10 -  
11 - location / {  
12 - index index.php index.html;  
13 - }  
14 -  
15 - location ~ .*\.php?$ {  
16 - fastcgi_pass 127.0.0.1:9000;  
17 - fastcgi_index index.php;  
18 - #fastcgi_param PATH_INFO $fastcgi_script_name;  
19 - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;  
20 - include fastcgi_params;  
21 - }  
22 -  
23 - location ~ .*/.svn/ {  
24 - deny all;  
25 - }  
26 -  
27 - location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {  
28 - expires 1h;  
29 - }  
30 -}  
1 -server {  
2 - listen 80;  
3 - server_name open.test.lan;  
4 - access_log logs/nginx.access.log;  
5 - location / {  
6 - index index.html index.php;  
7 - root /nginx/html/shindig;  
8 - rewrite ^/$ /index.php last;  
9 - rewrite ^/(?!index\.php)(.*)$ /index.php/$1 last;  
10 -  
11 - }  
12 -  
13 - location ~ \.php {  
14 - root /nginx/html/shindig;  
15 - fastcgi_pass 127.0.0.1:9000;  
16 - fastcgi_index index.php;  
17 - #pathinfo  
18 - fastcgi_param PATH_INFO $fastcgi_script_name;  
19 - fastcgi_param SCRIPT_FILENAME E:/nginx/html/shindig$fastcgi_script_name;  
20 - include fastcgi_params;  
21 - }  
22 -  
23 -}  
1 -server  
2 -{  
3 - listen 80;  
4 - server_name dev.yoho.cn;  
5 -  
6 - #access_log /nginx/logs/access_test_yoho_cn.log combined;  
7 - error_log /nginx/logs/error_test_yoho_cn.log warn;  
8 -  
9 - root D:/workspace/v3.svn.dev.yoho.cn/yoho.cn/www.yoho.cn/public;  
10 -  
11 - # https  
12 - #ssl on;  
13 - #ssl_certificate //nginx/data/server.pem;  
14 - #ssl_certificate_key /nginx/data/server.key;  
15 - #ssl_session_timeout 10m;  
16 -  
17 - location / {  
18 - index index.php index.html;  
19 - if (!-f $request_filename){  
20 - rewrite ^/(.+)$ /index.php?$1& last;  
21 - }  
22 - }  
23 -  
24 - location ~ .*\.html$ {  
25 - root E:/yoho.cn/i.svn.dev.yoho.cn/yoho.cn/www.yoho.cn/cache;  
26 - if (!-f $request_filename) {  
27 - rewrite ^/(.+)$ /index.php?$1& last;  
28 - }  
29 - }  
30 -  
31 - location ~ .*\.php?$ {  
32 - fastcgi_pass 127.0.0.1:9000;  
33 - fastcgi_index index.php;  
34 - #fastcgi_param PATH_INFO $fastcgi_script_name;  
35 - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;  
36 - include fastcgi_params;  
37 - }  
38 -  
39 - location ~ .*/.svn/ {  
40 - deny all;  
41 - }  
42 -  
43 - location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {  
44 - expires 1d;  
45 - }  
46 -  
47 - #location ~ .*\.(js|css)?$ {  
48 - # expires 1h;  
49 - #}  
50 -}  
51 -  
52 -server  
53 -{  
54 - listen 80;  
55 - server_name res.yoho.cn res.dev.yoho.cn res.test.yoho.cn;  
56 - index index.php;  
57 - root D:/workspace/i.svn.dev.yoho.cn/yoho4.0/static;  
58 - #access_log /Data/logs/nginx/access_yohoinc.log combined;  
59 - #error_log /Data/logs/nginx/error_yohoinc.log warn;  
60 -  
61 - location ~ .*/.svn/ {  
62 - deny all;  
63 - }  
64 -  
65 - location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {  
66 - expires 30d;  
67 - }  
68 -  
69 - #location ~ .*\.(js|css)?$ {  
70 - # expires 1h;  
71 - #}  
72 -  
73 - location /min/ {  
74 - rewrite ^/min/([a-z]=.*) /minify/min/index.php?$1 last;  
75 - }  
76 -  
77 - location /minify/min/index.php {  
78 - fastcgi_pass 127.0.0.1:9000;  
79 - fastcgi_index index.php;  
80 - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;  
81 - include fastcgi_params;  
82 - }  
83 -  
84 -}  
1 -server  
2 -{  
3 - listen 80;  
4 - server_name bill.dev.yohobuy.com;  
5 -  
6 - #access_log /nginx/logs/access_test_yoho_cn.log combined;  
7 - error_log /nginx/logs/error_test_yoho_cn.log warn;  
8 -  
9 - root D:/workspace/yhbbill.git.dev.yoho.cn/yohobuy/bill.m.yohobuy.com/public;  
10 -  
11 - # https  
12 - #ssl on;  
13 - #ssl_certificate //nginx/data/server.pem;  
14 - #ssl_certificate_key /nginx/data/server.key;  
15 - #ssl_session_timeout 10m;  
16 -  
17 - location / {  
18 - index index-dev.php;  
19 - if (!-f $request_filename){  
20 - rewrite ^/(.+)$ /index-dev.php?$1& last;  
21 - }  
22 - }  
23 -  
24 - location ~ .*\.php?$ {  
25 - fastcgi_pass 127.0.0.1:9000;  
26 - fastcgi_index index-dev.php;  
27 - #fastcgi_param PATH_INFO $fastcgi_script_name;  
28 - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;  
29 - include fastcgi_params;  
30 - }  
31 -  
32 -}  
33 -  
34 -  
35 -server  
36 -{  
37 - listen 80;  
38 - server_name bill.hood.yohobuy.com;  
39 -  
40 - #access_log /nginx/logs/access_test_yoho_cn.log combined;  
41 - error_log /nginx/logs/error_test_yoho_cn.log warn;  
42 -  
43 - root D:/workspace/yhbbill.git.dev.yoho.cn/yohobuy/hood.bill.m.yohobuy.com/public;  
44 -  
45 - # https  
46 - #ssl on;  
47 - #ssl_certificate //nginx/data/server.pem;  
48 - #ssl_certificate_key /nginx/data/server.key;  
49 - #ssl_session_timeout 10m;  
50 -  
51 - location / {  
52 - index index-dev.php;  
53 - if (!-f $request_filename){  
54 - rewrite ^/(.+)$ /index-dev.php?$1& last;  
55 - }  
56 - }  
57 -  
58 - location ~ .*\.php?$ {  
59 - fastcgi_pass 127.0.0.1:9000;  
60 - fastcgi_index index-dev.php;  
61 - #fastcgi_param PATH_INFO $fastcgi_script_name;  
62 - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;  
63 - include fastcgi_params;  
64 - }  
65 -  
66 -}  
1 -server  
2 -{  
3 - listen 80;  
4 - server_name boys.dev.yoho.cn;  
5 -  
6 - #access_log /nginx/logs/access_test_yoho_cn.log combined;  
7 - error_log /nginx/logs/error_test_yoho_cn.log warn;  
8 -  
9 - root D:/workspace/yohoboy.git.dev.yoho.cn/yohocms/www.yohoboys.com/public;  
10 -  
11 - # https  
12 - #ssl on;  
13 - #ssl_certificate //nginx/data/server.pem;  
14 - #ssl_certificate_key /nginx/data/server.key;  
15 - #ssl_session_timeout 10m;  
16 -  
17 -  
18 - location / {  
19 - index index.html index-dev.php;  
20 - if (!-f $request_filename){  
21 - rewrite ^/(.+)$ /index-dev.php?$1& last;  
22 - }  
23 - }  
24 -  
25 - location ~ .*\.php?$ {  
26 - fastcgi_pass 127.0.0.1:9000;  
27 - fastcgi_index index-dev.php;  
28 - #fastcgi_param PATH_INFO $fastcgi_script_name;  
29 - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;  
30 - include fastcgi_params;  
31 - }  
32 -  
33 - location ~ .*/.svn/ {  
34 - deny all;  
35 - }  
36 -  
37 - #location ~ .*\.(html|xml)?$ {  
38 - # expires 1h;  
39 - #}  
40 -}  
41 -  
42 -server  
43 -{  
44 - listen 80;  
45 - server_name newboys.dev.yoho.cn hkboys.dev.yoho.cn apiboys.dev.yoho.cn;  
46 -  
47 - #access_log /nginx/logs/access_test_yoho_cn.log combined;  
48 - error_log /nginx/logs/error_test_yoho_cn.log warn;  
49 -  
50 - root D:/workspace/yohoboy.git.dev.yoho.cn/yohocms/new.yohoboys.com/public;  
51 -  
52 - location / {  
53 - index index.html index-dev.php;  
54 - if (!-f $request_filename){  
55 - rewrite ^/(.+)$ /index-dev.php?$1& last;  
56 - }  
57 - }  
58 -  
59 - location ~ .*\.php?$ {  
60 - fastcgi_pass 127.0.0.1:9000;  
61 - fastcgi_index index-dev.php;  
62 - #fastcgi_param PATH_INFO $fastcgi_script_name;  
63 - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;  
64 - include fastcgi_params;  
65 - }  
66 -  
67 - location ~ .*/.svn/ {  
68 - deny all;  
69 - }  
70 -  
71 -}  
72 -  
73 -server  
74 -{  
75 - listen 80;  
76 - server_name cmsres.dev.yoho.cn;  
77 - index index.php;  
78 - #root D:/workspace/yohocms.svn.dev.yoho.cn/yohocms/trunk/static;  
79 - root D:/workspace/yohostore.git.dev.yoho.cn/static/boygirls;  
80 - #access_log /Data/logs/nginx/access_yohoinc.log combined;  
81 - #error_log /Data/logs/nginx/error_yohoinc.log warn;  
82 -  
83 - location ~ .*/.svn/ {  
84 - deny all;  
85 - }  
86 -  
87 - #location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {  
88 - # expires 30d;  
89 - #}  
90 -  
91 - #location ~ .*\.(js|css)?$ {  
92 - # expires 1h;  
93 - #}  
94 -  
95 -}  
1 -server  
2 -{  
3 - listen 80;  
4 - server_name girls.dev.yoho.cn hkgirls.dev.yoho.cn newgirls.dev.yoho.cn;  
5 -  
6 - #access_log /nginx/logs/access_test_yoho_cn.log combined;  
7 - error_log /nginx/logs/error_test_yoho_cn.log warn;  
8 -  
9 - root D:/workspace/yohogirl.git.dev.yoho.cn/yohocms/new.yohogirls.com/public;  
10 -  
11 - # https  
12 - #ssl on;  
13 - #ssl_certificate //nginx/data/server.pem;  
14 - #ssl_certificate_key /nginx/data/server.key;  
15 - #ssl_session_timeout 10m;  
16 -  
17 - location / {  
18 - index index-dev.php;  
19 - if (!-f $request_filename){  
20 - rewrite ^/(.+)$ /index-dev.php?$1& last;  
21 - }  
22 - }  
23 -  
24 - location ~ .*\.php?$ {  
25 - fastcgi_pass 127.0.0.1:9000;  
26 - fastcgi_index index-dev.php;  
27 - #fastcgi_param PATH_INFO $fastcgi_script_name;  
28 - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;  
29 - include fastcgi_params;  
30 - }  
31 -  
32 - location ~ .*/.svn/ {  
33 - deny all;  
34 - }  
35 -  
36 - #location ~ .*\.(html|xml)?$ {  
37 - # expires 1h;  
38 - #}  
39 -}  
40 -  
1 -server  
2 -{  
3 - listen 80;  
4 - server_name cmsres.test.yoho.cn;  
5 - index index.php;  
6 - root D:/workspace/yohostore/develop/static/boygirls;  
7 - #access_log /Data/logs/nginx/access_cmsres.log combined;  
8 - #error_log /Data/logs/nginx/error_cmsres.log warn;  
9 -  
10 - location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {  
11 - expires 1d;  
12 - }  
13 -  
14 - location ~ .*\.(js|css)?$ {  
15 - expires 1h;  
16 - }  
17 -  
18 -}  
19 -  
20 -server  
21 -{  
22 - listen 80;  
23 - server_name res.previewboys.yoho.cn;  
24 - index index.php;  
25 - root D:/workspace/yohostore/develop/static/boygirls;  
26 - #access_log /Data/logs/nginx/access_yohoinc.log combined;  
27 - #error_log /Data/logs/nginx/error_yohoinc.log warn;  
28 -  
29 - location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {  
30 - expires 1d;  
31 - }  
32 -  
33 - location ~ .*\.(js|css)?$ {  
34 - expires 1h;  
35 - }  
36 -  
37 -}  
38 -  
39 -server  
40 -{  
41 - listen 80;  
42 - server_name res.yohoboys.com rescdn.yohoboys.com;  
43 - index index.php;  
44 - root D:/workspace/yohostore/master/static/boygirls;  
45 - #access_log /Data/logs/nginx/access_yohoinc.log combined;  
46 - #error_log /Data/logs/nginx/error_yohoinc.log warn;  
47 -  
48 - location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {  
49 - expires 1d;  
50 - }  
51 -  
52 - location ~ .*\.(js|css)?$ {  
53 - expires 1h;  
54 - }  
55 -  
56 -}