简体   繁体   English

关闭梨错误

[英]Turn off PEAR Errors

I'm using PEAR's Mail_Queue and unfortunately there are many deprecation warnings (this is a common SO topic). 我正在使用PEAR的Mail_Queue,不幸的是,有很多弃用警告(这是一个常见的SO主题)。 Of course I can modify php's config to silence non-fatal errors but even then it seems that PEAR's mail_mime is outputting header information when it throws an error of any kind. 当然,我可以修改php的配置以使非致命错误静音,但是即使那样,当PEAR的mail_mime抛出任何类型的错误时,它也会输出标头信息。

Is there a simple way to turn off PEAR errors completely so that I can modify header information after making a call to mail_queue? 是否有一种简单的方法可以完全关闭PEAR错误,以便在调用mail_queue之后可以修改标头信息?

This are not "PEAR errors" that can be turned off. 这不是可以关闭的“ PEAR错误”。 As you said yourself, it's PHP spilling out the warnings, and you can only tell PHP not to output them. 正如您自己说的,这是PHP泄漏的警告,您只能告诉PHP不要输出警告。

Use the following code before using Mail_Queue to silence the warnings: 在使用Mail_Queue消除警告之前,请使用以下代码:

error_reporting(error_reporting() & ~E_DEPRECATED & ~E_STRICT);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM