Authored by hf

do fixes bug to render partials ext

... ... @@ -21,9 +21,23 @@
);
return '
return ''.'<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('title')), ENT_QUOTES, 'UTF-8').'</title>
<meta name="keywords" content="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('keywords')), ENT_QUOTES, 'UTF-8').'">
<meta name="description" content="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('description')), ENT_QUOTES, 'UTF-8').'">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="cleartype" content="on">
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta content="telephone=no" name="format-detection" />
<meta content="email=no" name="format-detection" />
</head>
<body>'.'
This is a test '.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('test')), ENT_QUOTES, 'UTF-8').'
';
'.'</body>
</html>'.'';
}
?>
\ No newline at end of file
... ...
... ... @@ -97,13 +97,12 @@ class TemplateLayout implements View_Interface
}
// 第一次渲染该模板的流程:取得模板内容 => 预编译成PHP函数 => 写入服务器生成PHP文件
else {
echo $config->template->partials;
$template = file_get_contents($viewName, false, null);
$phpStr = LightnCandy::compile($template, array(
// DEBUG: LightnCandy::FLAG_RENDER_DEBUG | LightnCandy::FLAG_ERROR_EXCEPTION
'flags' => LightnCandy::FLAG_MUSTACHE | LightnCandy::FLAG_HANDLEBARS, // 使用MUSTACHE和HANDLEBARS的模板格式
'basedir' => array($config->template->partials), // 模板里使用 {{> partial_name}} 时查找的目录
'fileext' => array($tplExt), // 允许查找文件的后缀
'fileext' => array('.' . $tplExt), // 允许查找文件的后缀
'lcrun' => 'Plugin\LCRun3', // 指定编译模板的runtime
));
// 文件流方式读取PHP方法
... ...
server {
listen 80;
server_name ezine.dev.yoho.cn apiezine.dev.yoho.cn;
index index.html index-dev.php;
root D:/workspace/yohoezine/ezine.yoho.cn;
location / {
index index-dev.php;
}
location ~* .*\.(php|php5)?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index-dev.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location = /favicon.ico{
return 204;
}
location ^~ /preview/ {
root D:/ezine;
}
access_log E:/nginx/logs/ezine.new.log combined;
error_log E:/nginx/logs/ezine.error.log warn;
}
server {
listen 80;
server_name ezine.hf.com apiezine.hf.com;
index index.html index-dev.php;
root D:/workspace/yohoezine/ezine.myoho.net;
location / {
index index-dev.php;
}
location ~* .*\.(php|php5)?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index-test.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location = /favicon.ico{
return 204;
}
access_log E:/nginx/logs/ezine.old.log combined;
error_log E:/nginx/logs/ezine.error.log warn;
}
server
{
listen 80;
server_name localhost;
#access_log /nginx/logs/access_test_yoho_cn.log combined;
error_log /nginx/logs/error_test_yoho_cn.log warn;
root D:/opensource;
location / {
index index.php index.html;
}
location ~ .*\.php?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ .*/.svn/ {
deny all;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 1h;
}
}
\ No newline at end of file
server {
listen 80;
server_name open.test.lan;
access_log logs/nginx.access.log;
location / {
index index.html index.php;
root /nginx/html/shindig;
rewrite ^/$ /index.php last;
rewrite ^/(?!index\.php)(.*)$ /index.php/$1 last;
}
location ~ \.php {
root /nginx/html/shindig;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#pathinfo
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME E:/nginx/html/shindig$fastcgi_script_name;
include fastcgi_params;
}
}
\ No newline at end of file
server
{
listen 80;
server_name dev.yoho.cn;
#access_log /nginx/logs/access_test_yoho_cn.log combined;
error_log /nginx/logs/error_test_yoho_cn.log warn;
root D:/workspace/v3.svn.dev.yoho.cn/yoho.cn/www.yoho.cn/public;
# https
#ssl on;
#ssl_certificate //nginx/data/server.pem;
#ssl_certificate_key /nginx/data/server.key;
#ssl_session_timeout 10m;
location / {
index index.php index.html;
if (!-f $request_filename){
rewrite ^/(.+)$ /index.php?$1& last;
}
}
location ~ .*\.html$ {
root E:/yoho.cn/i.svn.dev.yoho.cn/yoho.cn/www.yoho.cn/cache;
if (!-f $request_filename) {
rewrite ^/(.+)$ /index.php?$1& last;
}
}
location ~ .*\.php?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ .*/.svn/ {
deny all;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 1d;
}
#location ~ .*\.(js|css)?$ {
# expires 1h;
#}
}
server
{
listen 80;
server_name res.yoho.cn res.dev.yoho.cn res.test.yoho.cn;
index index.php;
root D:/workspace/i.svn.dev.yoho.cn/yoho4.0/static;
#access_log /Data/logs/nginx/access_yohoinc.log combined;
#error_log /Data/logs/nginx/error_yohoinc.log warn;
location ~ .*/.svn/ {
deny all;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
#location ~ .*\.(js|css)?$ {
# expires 1h;
#}
location /min/ {
rewrite ^/min/([a-z]=.*) /minify/min/index.php?$1 last;
}
location /minify/min/index.php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
\ No newline at end of file
server
{
listen 80;
server_name bill.dev.yohobuy.com;
#access_log /nginx/logs/access_test_yoho_cn.log combined;
error_log /nginx/logs/error_test_yoho_cn.log warn;
root D:/workspace/yhbbill.git.dev.yoho.cn/yohobuy/bill.m.yohobuy.com/public;
# https
#ssl on;
#ssl_certificate //nginx/data/server.pem;
#ssl_certificate_key /nginx/data/server.key;
#ssl_session_timeout 10m;
location / {
index index-dev.php;
if (!-f $request_filename){
rewrite ^/(.+)$ /index-dev.php?$1& last;
}
}
location ~ .*\.php?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index-dev.php;
#fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
server
{
listen 80;
server_name bill.hood.yohobuy.com;
#access_log /nginx/logs/access_test_yoho_cn.log combined;
error_log /nginx/logs/error_test_yoho_cn.log warn;
root D:/workspace/yhbbill.git.dev.yoho.cn/yohobuy/hood.bill.m.yohobuy.com/public;
# https
#ssl on;
#ssl_certificate //nginx/data/server.pem;
#ssl_certificate_key /nginx/data/server.key;
#ssl_session_timeout 10m;
location / {
index index-dev.php;
if (!-f $request_filename){
rewrite ^/(.+)$ /index-dev.php?$1& last;
}
}
location ~ .*\.php?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index-dev.php;
#fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
\ No newline at end of file
server
{
listen 80;
server_name boys.dev.yoho.cn;
#access_log /nginx/logs/access_test_yoho_cn.log combined;
error_log /nginx/logs/error_test_yoho_cn.log warn;
root D:/workspace/yohoboy.git.dev.yoho.cn/yohocms/www.yohoboys.com/public;
# https
#ssl on;
#ssl_certificate //nginx/data/server.pem;
#ssl_certificate_key /nginx/data/server.key;
#ssl_session_timeout 10m;
location / {
index index.html index-dev.php;
if (!-f $request_filename){
rewrite ^/(.+)$ /index-dev.php?$1& last;
}
}
location ~ .*\.php?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index-dev.php;
#fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ .*/.svn/ {
deny all;
}
#location ~ .*\.(html|xml)?$ {
# expires 1h;
#}
}
server
{
listen 80;
server_name newboys.dev.yoho.cn hkboys.dev.yoho.cn apiboys.dev.yoho.cn;
#access_log /nginx/logs/access_test_yoho_cn.log combined;
error_log /nginx/logs/error_test_yoho_cn.log warn;
root D:/workspace/yohoboy.git.dev.yoho.cn/yohocms/new.yohoboys.com/public;
location / {
index index.html index-dev.php;
if (!-f $request_filename){
rewrite ^/(.+)$ /index-dev.php?$1& last;
}
}
location ~ .*\.php?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index-dev.php;
#fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ .*/.svn/ {
deny all;
}
}
server
{
listen 80;
server_name cmsres.dev.yoho.cn;
index index.php;
#root D:/workspace/yohocms.svn.dev.yoho.cn/yohocms/trunk/static;
root D:/workspace/yohostore.git.dev.yoho.cn/static/boygirls;
#access_log /Data/logs/nginx/access_yohoinc.log combined;
#error_log /Data/logs/nginx/error_yohoinc.log warn;
location ~ .*/.svn/ {
deny all;
}
#location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
# expires 30d;
#}
#location ~ .*\.(js|css)?$ {
# expires 1h;
#}
}
server
{
listen 80;
server_name girls.dev.yoho.cn hkgirls.dev.yoho.cn newgirls.dev.yoho.cn;
#access_log /nginx/logs/access_test_yoho_cn.log combined;
error_log /nginx/logs/error_test_yoho_cn.log warn;
root D:/workspace/yohogirl.git.dev.yoho.cn/yohocms/new.yohogirls.com/public;
# https
#ssl on;
#ssl_certificate //nginx/data/server.pem;
#ssl_certificate_key /nginx/data/server.key;
#ssl_session_timeout 10m;
location / {
index index-dev.php;
if (!-f $request_filename){
rewrite ^/(.+)$ /index-dev.php?$1& last;
}
}
location ~ .*\.php?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index-dev.php;
#fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ .*/.svn/ {
deny all;
}
#location ~ .*\.(html|xml)?$ {
# expires 1h;
#}
}
server
{
listen 80;
server_name cmsres.test.yoho.cn;
index index.php;
root D:/workspace/yohostore/develop/static/boygirls;
#access_log /Data/logs/nginx/access_cmsres.log combined;
#error_log /Data/logs/nginx/error_cmsres.log warn;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 1d;
}
location ~ .*\.(js|css)?$ {
expires 1h;
}
}
server
{
listen 80;
server_name res.previewboys.yoho.cn;
index index.php;
root D:/workspace/yohostore/develop/static/boygirls;
#access_log /Data/logs/nginx/access_yohoinc.log combined;
#error_log /Data/logs/nginx/error_yohoinc.log warn;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 1d;
}
location ~ .*\.(js|css)?$ {
expires 1h;
}
}
server
{
listen 80;
server_name res.yohoboys.com rescdn.yohoboys.com;
index index.php;
root D:/workspace/yohostore/master/static/boygirls;
#access_log /Data/logs/nginx/access_yohoinc.log combined;
#error_log /Data/logs/nginx/error_yohoinc.log warn;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 1d;
}
location ~ .*\.(js|css)?$ {
expires 1h;
}
}
\ No newline at end of file