简体   繁体   English

PHP 5.2.x,监控文件的变化,原生FAM?

[英]PHP 5.2.x, monitor a file for changes, native FAM?

I'm looking for a FAM-like solution: 我正在寻找类似FAM的解决方案:

http://www.php.net/manual/en/fam.installation.php http://www.php.net/manual/en/fam.installation.php

"This extension is considered unmaintained and dead." “这个扩展被认为是无法维护和死亡的。”

I have a file that's written to randomly, I want to loop and wait for it to change, and then kick off my process. 我有一个随机写的文件,我想循环并等待它改变,然后开始我的过程。

I don't want to loop fstat sleep if at all possible, fam_next_event blocked until updates and spoiled me. 如果可能的话,我不想循环fstat睡眠,fam_next_event被阻止直到更新并且破坏了我。 Since FAM isn't in PHP >= 5.0.5 and I don't really want to rely on something that's no longer maintained, I'm hoping someone has done something similar. 由于FAM不在PHP> = 5.0.5并且我真的不想依赖于不再维护的东西,我希望有人做了类似的事情。

Is there a FAM replacement? 有FAM替代品吗? Something better/native? 更好/原生的东西?

Maybe the Inotify extension could fullfill your needs 也许Inotify扩展可以满足您的需求

http://www.php.net/manual/en/ref.inotify.php http://www.php.net/manual/en/ref.inotify.php

have a look at it. 看看它。

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

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