简体   繁体   English

在PHP.exe上传递多个文件

[英]Passing Multiple files on PHP.exe

I am working on some project using Apache Ant where I am also using PHP.exe to validate PHP syntax in PHP file. 我正在使用Apache Ant进行某些项目,其中还使用PHP.exe来验证PHP文件中的PHP语法。

I am validating the PHP file by using the command as below 我正在通过使用以下命令来验证PHP文件

php -l index-1.php

And it's working fine, showing me error when there is some PHP syntax error but the problem is php.exe is not supporting multiple files, it accept only 1 file 并且它工作正常,当出现一些PHP语法错误时显示错误,但问题是php.exe不支持多个文件,它仅接受1个文件

I need to pass multiple files. 我需要传递多个文件。 Do you have any solutions for this problem? 您对此问题有解决方案吗?

The short answer is that php doesn't allow you to supply multiple source codes in one invocation. 简短的答案是php不允许您在一次调用中提供多个源代码。

Reading between the lines a little, looking at your previous question , it seems you want a single report showing all the lint messages for all your php files. 仔细阅读两行,看您先前的问题 ,似乎您想要一个报告,其中显示所有php文件的所有皮棉消息。

The <apply> task output attribute can be used to specify the output file for your command, but by default, if the command is run multiple times you only see the output for the last run. <apply>任务output属性可用于指定命令的输出文件,但是默认情况下,如果命令多次运行,则只会看到最后一次运行的输出。 If you also add append="true" to your apply task, then the output from all runs will be gathered into the output file. 如果您还向您的apply任务添加append="true" ,那么所有运行的输出将被收集到输出文件中。 If you also set parallel="false" Ant will run each php file through lint separately. 如果还设置parallel="false" Ant将通过lint分别运行每个php文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM