fis3-smarty
BSD 2-Clause "Simplified" License
68
22
24

安装命令:

brew install php55 --with-cgi

回显:

Updating Homebrew...
Error: No available formula with the name "php55" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
==> Searching local taps...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

HTTP ERROR 500
Problem accessing /pr/page/index. Reason:

Server Error

Caused by:
java.lang.RuntimeException: PHP Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/home/users/zongzhili/.fis3-tmp/www/template/pr/page/layout.tpl" on line 1 "{%html framework="pr:static/lib/mod.js"%}" unknown tag "html"' in /home/users/zongzhili/.fis3-tmp/www/smarty/sysplugins/smarty_internal_templatecompilerbase.php:665
Stack trace:
#0 /home/users/zongzhili/.fis3-tmp/www/smarty/sysplugins/smarty_internal_templatecompilerbase.php(451): Smarty_Internal_TemplateCompilerBase->trigger_template_error('unknown tag "ht...', 1)
#1 /home/users/zongzhili/.fis3-tmp/www/smarty/sysplugins/smarty_internal_templateparser.php(2388): Smarty_Internal_TemplateCompilerBase->compileTag('html', Array)
#2 /home/users/zongzhili/.fis3-tmp/www/smarty/sysplugins/smarty_internal_templateparser.php(3101): Smarty_Internal_Templateparser->yy_r36()
#3 /home/users/zongzhili/.fis3-tmp/www/smarty/sysplugins/smarty_internal_templateparser.php(3201): Smarty_Internal_Templateparser->yy_reduce(36 in /home/users/zongzhili/.fis3-tmp/www/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 665

at php.java.servlet.fastcgi.FastCGIServlet.parseBody(FastCGIServlet.java:409)
at php.java.servlet.fastcgi.FastCGIServlet.execute(FastCGIServlet.java:433)
at php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:481)
at php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:521)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
at com.baidu.fis.HttpServer$FISWebAppContext.doScope(HttpServer.java:138)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:370)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:619)

警告提示:fis.set('system.localNPMFolder') is deprecated, please set fis.require.paths instead.

操作系统:
cenOS 6.3
Node版本:
6.2.2
FIS版本:
fis3 v3.4.39
问题:
checking php-cgi support : v5.4.33
checking java support : v1.6.0
starting fis-server ..... fail
2018-01-30 15:56:28.985:INFO:oejs.Server:jetty-8.y.z-SNAPSHOT
Usage: php [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p ] [-g ] [-c ] [-d foo[=bar]] [-y ] [-D] [-F]
-c | Look for php.ini file in this directory
-n No php.ini file will be used
-d foo[=bar] Define INI entry foo with value 'bar'
-e Generate extended information for debugger/profiler
-h This help
-i PHP information
-m Show compiled in modules
-v Version number
-p, --prefix
Specify alternative prefix path to FastCGI process manager (default: /home/scmpf/compiler_src/zhaoxiwu_1463821_linux64/0/inf/odp/php/.tmp/install/php).
-g, --pid
Specify the PID file location.
-y, --fpm-config
Specify alternative path to FastCGI process manager config file.
-t, --test Test FPM configuration and exit
-D, --daemonize force to run in background, and ignore daemonize option from config file
-F, --nodaemonize
force to stay in foreground, and ignore daemonize option from config file
-R, --allow-to-run-as-root
Allow pool to run as root (disabled by default)
Timeout waiting for PHP FastCGI daemon
php.java.bridge.http.FCGIConnectException: Could not connect to server
/home/work/aslabs/node/lib/node_modules/fis3/lib/log.js:201
throw err
^

Error: fis-server fails to start at port [8080], error: Could not connect to server

偶尔会出现cannot find moudle ,在fis-conf 随便敲个回车,重新构建一遍又好了,怎么回事呢?

$ fis3 release -r common
/usr/local/lib/node_modules/fis3/lib/log.js:201
throw err
^

Error: Load /Users/cjc/dev/common/fis-conf.js error: Cannot find module 'fis3-smarty'
Error: Cannot find module 'fis3-smarty'

[fis3-fis3-smarty] or [fis-fis3-smarty] 我使用fis3 请我我应该用那个组件

; 快速启动一个项目
mkdir demo
cd demo
fis3 init php-smarty

然后 fis3 server start
fis3 release -wL

之后为什么看不到it works????

需要配置server.conf吗?

最近公司在用fis3的smarty解决方案重公司的一个电商项目,目前遇到的问题是在像顶部导航,用户信息侧边栏,底部导航这些组件中的某些变量是通用的变量。现在fis3Smarty解决方案中有关于在前端使用php全局变量的方法吗,简单的说就是一个变量可以用在其他所有的页面,而不是每个页面都需要重新引入一次这个变量。还望高人指教。。。多谢了

我们的项目用smarty来做的,我想问一下fis3 中如何去解析相应的PHP文件,然后映射到写好tpl文件中,有没有可以参考的文章之类的

Fatal error: Uncaught SmartyException: Unable to load template file 'C:\Users\qyd\AppData\Local.fis3-tmp\www\template/A/index.tpl' in C:\Users\qyd\AppData\Local.fis3-tmp\www\smarty\sysplugins\smarty_internal_templatebase.php:127 Stack trace: #0 C:\Users\qyd\AppData\Local.fis3-tmp\www\smarty\sysplugins\smarty_internal_templatebase.php(374): Smarty_Internal_TemplateBase->fetch('C:\Users\qyd\Ap...', NULL, NULL, Object(Smarty), true) #1 C:\Users\qyd\AppData\Local.fis3-tmp\www\fisdata\TestData.class.php(100): Smarty_Internal_TemplateBase->display('C:\Users\qyd\Ap...') #2 C:\Users\qyd\AppData\Local.fis3-tmp\www\index.php(53): TestData::renderHelper(Object(Smarty), 'C:\Users\qyd\Ap...') #3 C:\Users\qyd\AppData\Local.fis3-tmp\www\index.php(146): fis_debug_render_smarty() #4 {main} thrown in C:\Users\qyd\AppData\Local.fis3-tmp\www\smarty\sysplugins\smarty_internal_templatebase.php on line 127

Hi, 本地测试如何使用json格式数据啊

按照文档的使用介绍没能成功,还需要配置什么吧

page目录下有t2.tpl

{%$site.name%}

test/page目录下有t2.json

{ "site": { "name":"abc" } }

clone了官方的demo
https://github.com/fex-team/fis3-smarty/tree/master/doc/demo
本地编译,开启服务器(fis3 server start),可以跑起来。

编写配置如下:

fis.media('local')
.match('_', {
  deploy: fis.plugin('http-push', {
    receiver: 'http://localhost/mi_video/receive.php',
    to: '/Applications/XAMPP/htdocs/mi_video/' // 注意这个是指的是测试机器的路径,而非本地机器
  })
})
.match('/plugin/__', {
    release: '/Applications/XAMPP/htdocs/mi_video/smarty/plugins/'
})
.match('__.tpl', {
    release: 'smarty/templates/$0'
})
.match('__.js', {
    release: 'public/static/js'
})
.match(/._(css|less|scss)/, {
    release:'public/static/css'
});

发布到服务端环境,fis3 release local,访问页面总是报错
Fatal error: Uncaught --> Smarty: Unable to read template file 'common/page/layout.tpl' <-- thrown in /Applications/XAMPP/xamppfiles/htdocs/mi_video/smarty/sysplugins/smarty_internal_resource_file.php on line 212

smarty_internal_resource_file.php 抛异常了。。。
求指点,是什么地方配置有问题?

一直用fis来构建我们的项目,之前是java然后我们选择了fis的jello,用的一直挺好。

因业务需求加入php,作为fis的铁杆必然还是选择fis,可按照 https://github.com/fex-team/fis3-smarty/blob/master/doc/README.md 一步一步的安装启动项目总失败。

我通过安装说明按照以下步骤操作的:

首先下载 demo,然后解压,进入这个目录,执行以下命令对所有模块进行构建发布。

fis3 release -r common
fis3 release -r subsiteA
fis3 release -r subsiteB

然后fis3 server start --type smarty 启动窗口但页面一直显示一个index。

我在url访问common目录 http://127.0.0.1:8080/common

页面报错信息:

HTTP ERROR 500

Problem accessing /common. Reason:

    Server Error
Caused by:

java.lang.RuntimeException: PHP Fatal error:  Uncaught exception 'SmartyException' with message 'Unable to load template file '/Users/eMule/.fis3-tmp/www/template/common/index.tpl'' in /Users/eMule/.fis3-tmp/www/smarty/sysplugins/smarty_internal_templatebase.php:127
Stack trace:
#0 /Users/eMule/.fis3-tmp/www/smarty/sysplugins/smarty_internal_templatebase.php(374): Smarty_Internal_TemplateBase->fetch('/Users/eMule/.f...', NULL, NULL, NULL, true)
#1 /Users/eMule/.fis3-tmp/www/fisdata/TestData.class.php(100): Smarty_Internal_TemplateBase->display('/Users/eMule/.f...')
#2 /Users/eMule/.fis3-tmp/www/index.php(53): TestData::renderHelper(Object(Smarty), '/Users/eMule/.f...')
#3 /Users/eMule/.fis3-tmp/www/index.php(146): fis_debug_render_smarty()
#4 {main}
  thrown in /Users/eMule/.fis3-tmp/www/smarty/sysplugins/smarty_internal_templatebase.php on line 127

	at php.java.servlet.fastcgi.FastCGIServlet.parseBody(FastCGIServlet.java:409)
	at php.java.servlet.fastcgi.FastCGIServlet.execute(FastCGIServlet.java:433)
	at php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:481)
	at php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:521)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
	at com.baidu.fis.HttpServer$FISWebAppContext.doScope(HttpServer.java:138)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
	at org.eclipse.jetty.server.Server.handle(Server.java:370)
	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
	at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
	at java.lang.Thread.run(Thread.java:745)
Powered by Jetty://

困扰好久了,朋友们帮忙看下是什么问题。。
系统 mac版本 10.11.6
nodejs版本 v4.4.4
fis3版本 v3.4.32
php-cgi版本 PHP 5.5.38 (cgi-fcgi) (built: Mar 31 2017 13:41:14)

我看了下 没有编译出那个 livereload.js,是需要另外配置的?

在生产环境下,编译的时候我设置了moduleId
如下:

fis.media('pre').match('*.{js,jsx}', {
    moduleId: function (m, path) {
        return fis.util.md5(path)
    }
}).match('*', {
    domain : null
})

然后smarty里面的script插件,并没有替换script里面的require的Id,这是产生的代码

<script type="text/javascript">!function(){ require('common/widget/header/header')("1",0);
}();</script>

但我的js代码是这样的:

;/*!common/module/storage.js*/
define("c5127ca",......
;/*!common/widget/header/header.js*/
define("9f4a2b6",......

然后看了一下你们smarty源码,应该是获取的时候,没有对require进行处理。

{%script type="text/javascript"%}
    require('common/widget/header/header');
{%/script%}

然后我试了一下普通的js代码

<script type="text/javascript">
    require('common/widget/header/header');
</script>

最终页面会正常编译,如下

<script type="text/javascript">
    require('9f4a2b6');
</script>

但这样就没法自动加载到body的最后了

建议使用fis-parse-template 100%兼容bdtemplate