Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用gruntjs监视PHP文件中的更改?_Php_Gruntjs_Yeoman - Fatal编程技术网

如何使用gruntjs监视PHP文件中的更改?

如何使用gruntjs监视PHP文件中的更改?,php,gruntjs,yeoman,Php,Gruntjs,Yeoman,我用webapp生成器启动了一个yeoman项目,现在我想在我的项目中添加一些PHP 我应该怎么做?它们是: 在grunt构建期间复制的 如果在grunt服务器期间发生修改,则监视/更新到dist/目录中 我对其进行了以下修改: 在grunt.initConfig({…})中,我向watch的任务配置项添加了一个条目: copyPhp: { files: [ '<%= yeoman.app %>/*.php' ],

我用webapp生成器启动了一个
yeoman
项目,现在我想在我的项目中添加一些PHP

我应该怎么做?它们是:

  • 在grunt构建期间复制的
    
    
  • 如果在
    grunt服务器
    期间发生修改,则监视/更新到
    dist/
    目录中

  • 我对其进行了以下修改:

    在grunt.initConfig({…})中,我向
    watch
    的任务配置项添加了一个条目:

        copyPhp: {
            files: [
                '<%= yeoman.app %>/*.php'
            ],
            tasks: ['copy:php']
         }
    
    您还可以看到,在
    dist
    中,我添加了一行代码来将PHP文件复制到dist目录:

         '*.{php,phpc}',
    
    额外的 我还在
    livereload
    配置中添加了一行。然而,由于我使用Apache而不是内部服务器,这是毫无意义的,需要更多的工作

    '<%= yeoman.app %>/*.php',
    
    '/*.php',
    
    我对它进行了以下修改:

    在grunt.initConfig({…})中,我向
    watch
    的任务配置项添加了一个条目:

        copyPhp: {
            files: [
                '<%= yeoman.app %>/*.php'
            ],
            tasks: ['copy:php']
         }
    
    您还可以看到,在
    dist
    中,我添加了一行代码来将PHP文件复制到dist目录:

         '*.{php,phpc}',
    
    额外的 我还在
    livereload
    配置中添加了一行。然而,由于我使用Apache而不是内部服务器,这是毫无意义的,需要更多的工作

    '<%= yeoman.app %>/*.php',
    
    '/*.php',