#PHP extension in C

4 messages · Page 1 of 1 (latest)

ivory wedge
#

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]

empty sealBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

eager ermine
#

any specific reason it has to be a c extension ?

#

id honestly just create a wrapper for those two functions