문제

We are trying to add the PHP Library PHPDocx for dynamically making Microsoft word docs through our php application. However, their code throughs several warnings and notices that are blowing up our error log. We have our error reporting set to E_STRICT for the site, and want to change the error reporting and logging to E_ERROR just for these files. Unfortunately, our custom templating system (which sets the error reporting), is loaded prior to any requires or references to the PHPDocx library.

I have tried using error_reporting(E_ERROR) and ini_set('display_errors', 0), but I am still getting the warnings and notices written into our error log. I don't know if its because all of our setup code is run first, but what I would like to do do is only write fatal errors from the PHPDocx files, but keep E_STRICT on the rest of the site.

Thanks for any help.

도움이 되었습니까?

해결책

if they are a small number of occurances, you could specifically suppress them with the @ symbol before whatever function. for example;

echo @$myunsetvariable;

다른 팁

error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
ini_set('display_errors', 1);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top