dongqiao8417 2011-06-16 06:02
浏览 41

如何使用PHP管道rake输出?

I'm building a RAKEFILE and I want to display the output on a php generated page as it gets executed.

I tried using system() since the PHP docs mention this:

The system() call also tries to automatically flush the web server's output buffer after each line of output if PHP is running as a server module.

This seems to work with multiple shell comands but when I execute rake I only get the first line:

(in /Users/path/to/proj)

Any ideas?

Cheers!

  • 写回答

3条回答 默认 最新

  • dongtan1845 2011-06-16 06:22
    关注

    The system() call also tries to automatically flush the web server's output buffer after > each line of output if PHP is running as a server module.

    This means you would only get the last line of output from the return value. The example in the system() manual page shows that and it suggests to use passthru() to get raw output. I usually use exec() though.

    评论

报告相同问题?

悬赏问题

  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图