TYPO3: how to supress deprecated warnings?

2020-02-11 06:34发布

问题:

I tried modifying the php.ini file (error_reporting = E_ALL & ~E_DEPRECATED), but with no result. There's an older TYPO3 project which I would like to examine, and all these warnings are really annoying..

Thanks in advance.

回答1:

I'm not sure if this will work on your version of Typo3 but try setting the following options in the typo3conf/localconf.php or via the Install Tool.

$TYPO3_CONF_VARS['SYS']['displayErrors']    = '0'; // or '-1' to see other errors
$TYPO3_CONF_VARS['SYS']['errorHandlerErrors']     = 22519; // E_ALL ^ E_DEPRECATED ^ E_NOTICE (everything except deprecated-msgs and notices)
$TYPO3_CONF_VARS['SYS']['syslogErrorReporting']   = 22519; // E_ALL ^ E_DEPRECATED ^ E_NOTICE (everything except deprecated-msgs and notices)
$TYPO3_CONF_VARS['SYS']['belogErrorReporting']    = 22519; // E_ALL ^ E_DEPRECATED ^ E_NOTICE (everything except deprecated-msgs and notices)