how to virtualize config file
I have a PHP script that is encrypted with Ion Cube. Since I don't want to violate the license, I can't modify anything in the script. The scri开发者_运维知识库pt makes calls to an XML based config file. I want to create a database to store the config data and then feed it to the encrypted script based on the referer URL that made the request. Basically, I want to "virtualize" the config XML file so I can feed the encrypted script the data I want based on the referer URL.
Any ideas?
You can use LD_PRELOAD and a custom library to override the php interpreter's file open of the config file and so switch it to open a different config file on demand.
精彩评论