【问题标题】:Run php script with grunt使用 grunt 运行 php 脚本
【发布时间】:2014-12-06 19:29:34
【问题描述】:

我的服务器上有一个 php 脚本(我们称之为 /test.php)。在 Grunt 自动解析了我的 SCSS 和 JS 之后,我想运行这个 test.php 脚本(它会重置我的内存缓存)。我似乎找不到办法做到这一点。有人知道吗?

【问题讨论】:

    标签: php gruntjs grunt-contrib-watch


    【解决方案1】:

    您可以使用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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-03-26
      • 2016-02-29
      • 1970-01-01
      • 2013-01-26
      • 2016-10-03
      • 2011-07-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多