dongqi8863 2014-01-29 21:21
浏览 5

如何在Windows机器上调用带有事件的php文件?

Assume that we have a device which sends data (a file) back to the computer whenever something unexpected happens. Let's say if it detects a movement, it will send a data file to the computer.

The computer should notice and parse this file. Afterwards, it should execute a PHP file to do other stuff.

Currently we are using scheduled tasks on windows, but this checks the status minimum every 1 minute. Is there any way to detect this as soon as we received this? What can be used?

EDIT: In other words, how can I set a trigger to execute the php?

EDIT: there was a typo. I wrote pdf instead of php.

  • 写回答

2条回答 默认 最新

  • dounao1856 2014-01-29 21:31
    关注

    One thing you can do is write a simple Windows Service, which will parse the file once received.

    look into FileSystemWatcher to detect the file. this way you don't need to schedule any task.

    Now as for the PHP script you should be able to start a command line process and execute the php.

    评论

报告相同问题?

悬赏问题

  • ¥100 iOS开发关于快捷指令截屏后如何将截屏(或从截屏中提取出的文本)回传给本应用并打开指定页面
  • ¥15 unity连接Sqlserver
  • ¥15 图中这种约束条件lingo该怎么表示出来
  • ¥15 VSCode里的Prettier如何实现等式赋值后的对齐效果?
  • ¥15 流式socket文件传输答疑
  • ¥20 keepalive配置业务服务双机单活的方法。业务服务一定是要双机单活的方式
  • ¥50 关于多次提交POST数据后,无法获取到POST数据参数的问题
  • ¥15 win10,这种情况怎么办
  • ¥15 如何在配置使用Prettier的VSCode中通过Better Align插件来对齐等式?(相关搜索:格式化)
  • ¥100 在连接内网VPN时,如何同时保持互联网连接