I need a custom developed PHP extension written in C.
The extension should detect all calls to PHP file_put_contents and PHP fwrite functions and add a response header based on the used parameters in the called functions as well as the executor script and line of code.
The response header name is "X-Changed-Files" and the value format is:
[filename;filesource;filesourcelineofcode]....[filename;filesource; filesourcelineofcode]
Examples (check the attachment for the example PHP scripts):
If test1.php script is executed, the response header value should be:
X-Changed-Files: [/home/user/new.php;/home/user/test1.php;6]
If test2.php script is executed, the response header value should be:
X-Changed-Files: [/home/user/new.php;/home/user/test2.php;8]
[/home/user/new2.php;/home/user/test2.php;11]
[/home/user/new2.php;/home/user/test2.php;12]