A
A
artemklv2016-03-28 21:24:57
linux
artemklv, 2016-03-28 21:24:57

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

7 answer(s)
V
Vlad Zhivotnev, 2016-03-28
@artemklv

incron(inotify).

S
Sergey Semenko, 2016-03-28
@abler98

Alternatively, you can write a daemon that will check the last modification time of a file, and then call the PHP script.

Z
Zakharov Alexander, 2016-03-28
@AlexZaharow

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 .

S
Saboteur, 2015-02-10
@lynnikvadim

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.

M
Maxim Grechushnikov, 2015-02-09
@maxyc_webber

api gives you the data. just use them

A
Azim Kurt, 2015-02-09
@Symphony

How is this done?

Just swapped. Here is the question, here is the answer.

I
index0h, 2015-02-09
@index0h

For starters, read what an API is in principle. There is no CMS without an API.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question