PHP Tidy:tidy_setopt() 替代方案?
因此,我尝试根据自己的喜好定制 PHP 的 Tidy,但问题出在 tidy_setopt()
函数上。
我知道 tidy 已安装并且工作得很好,并且阅读 PHP 文档,它说 tidy_setopt()
已从 2.0 开始删除(因此,由于 ob 回调工作正常,我可以放心地假设我正在运行 Tidy 2.0+)。
问题是:没有替代功能。我希望有一种方法可以解决这个问题,这样我就可以按照我想要的方式设置 ob 处理程序的设置,而无需实际编辑配置文件。
我确信如果需要的话,我的主机愿意编辑 Tidy 的配置文件,但我不想将其添加到我出于各种原因向它们发送的大量支持票中。
如果我需要为输出缓冲创建自己的回调,我可以这样做(我看到一些可能有用的方法,使用面向对象的整洁方法),但我宁愿让它尽可能精简。
So I'm trying to tailor PHP's Tidy to my liking, but the problem is with the tidy_setopt()
function.
I know tidy is installed and working just fine, and reading the PHP docs it says tidy_setopt()
has been removed as of 2.0 (So since the ob callback is working perfectly I'm safe to assume I'm running Tidy 2.0+).
Here is the problem: There is no alternative function. I'm hoping there is a way to get around this so I can set the ob handler's settings up how I want them to without actually needing to edit a configuration file.
I'm sure my hosting will be willing to edit Tidy's configuration file if needed, but I'd rather not add to the barrage of support tickets I've been sending them for various reasons as it is.
If I need to create my own callback for output buffering I can do so (I see some possibly useful methods using the OO approach to tidy) but I'd rather have it as slim as possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
而不是使用
您应该使用
另请参阅输出控制功能手册“用户定义回调函数示例"
Instead of using
You should use
Also see Output Control Functions manual for "User defined callback function example"