【发布时间】:2014-12-06 19:29:34
【问题描述】:
我的服务器上有一个 php 脚本(我们称之为 /test.php)。在 Grunt 自动解析了我的 SCSS 和 JS 之后,我想运行这个 test.php 脚本(它会重置我的内存缓存)。我似乎找不到办法做到这一点。有人知道吗?
【问题讨论】:
标签: php gruntjs grunt-contrib-watch
我的服务器上有一个 php 脚本(我们称之为 /test.php)。在 Grunt 自动解析了我的 SCSS 和 JS 之后,我想运行这个 test.php 脚本(它会重置我的内存缓存)。我似乎找不到办法做到这一点。有人知道吗?
【问题讨论】:
标签: php gruntjs grunt-contrib-watch
您可以使用grunt-shell 通过php -f your-script.php 在cli 上运行您的php 脚本
grunt.initConfig({
shell: {
php: {
command: 'php -f your-script.php'
}
}
}
grunt.registerTask('runTestPhp', ['shell:php']);
如果您不想通过 cli 运行 php 脚本,请查看 grunt-php。
【讨论】: