拦截读取特定文件的请求,并生成以编程方式读取的该文件的明显输出
抱歉,标题又长又模糊!
我的一个朋友有一个在 LAMP 服务器上运行的 Flash Action 脚本,该脚本当前读取 xml 配置文件。他问我是否可以删除 xml 文件,并以某种方式用一个系统(我们称其为“自动 xml 生成器”)替换它,该系统拦截读取该文件的请求并生成输出,因此它似乎是所有意图和目的就好像该文件仍然存在并且包含实际上从我们的自动 xml 生成器返回的内容一样,
谷歌搜索时间未能找到任何有希望的线索,任何人都可以提供任何建议吗?
非常感谢!
麦克风
Sorry for the long and yet still somehow vague title!
A friend of mine has a Flash Action script running on a LAMP server that currently reads an xml config file. He's asked me if it's possible to remove the xml file, and replace it somehow with a system (lets call it an 'auto xml generator') that intercepts the request to read that file and generates an output, so it appears to all intents and purposes as if the file still exists and contains the contents that has actually been returned from our auto xml generator
Hours of Googling has failed to come up with any promising leads, can anyone offer any advice?
Thanks very much!
Mike
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当然。您的朋友可以将下载指向自动生成 XML 文件的 PHP 脚本。
此链接 看起来很有希望作为一个起点。
Sure. Your friend could instead point the download at a PHP script that generates an XML file automatically.
This link from IBM looks promising as a starting point if this is unfamiliar teritory.
这可以通过 FUSE (用户空间中的文件系统)(如果主机支持)。安装后,让它显示一个 .xml 文件,该文件(可以想象)将向每个读者返回唯一的数据视图。
它不会“拦截”系统调用,open() 正常工作。它是理解并提供魔力的底层文件系统。
该链接指向 PHP 实现所需的内容。
This could be implemented via FUSE (Filesystem in Userspace) if the host supports it. When mounted, have it show a single .xml file which would (conceivably) return a unique view of data to every reader.
Its not 'intercepting' system calls, open() works as normal. Its the underlying file system that understands and provides the magic.
The link is to what's needed for a PHP implementation.