Answer the question
In order to leave comments, you need to log in
How to intercept a write to a file in linux with a php script?
Welcome all!
Tell me if it is possible to implement the following task in linux:
So that when the server (game) writes logs to a certain file, a php script is executed that would process the received data.
I don't want to parse the file using cron for a number of reasons.
Answer the question
In order to leave comments, you need to log in
Alternatively, you can write a daemon that will check the last modification time of a file, and then call the PHP script.
Actually, the method of intercepting something to something is called the same in both linux and windows: hook.
linux file write
hook it could be adapted to your php case:
Can
a bash script be hooked to a
file do for windows - see scriptomatic topic .
API - Advanced Programmer Interface.
That is, it is a set of (documented) functions that can be called from a third-party program.
Roughly speaking, this is a special set of special URLs that return certain data. And from your billing system, you can go to these URLs and receive data in a form that is convenient for programs (and not for a regular user), for example, xml / json.
In your case, it is better to consult a specialist.
How is this done?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question