Prevent joomla api to log deprecated warning

◇◆丶佛笑我妖孽 提交于 2020-01-25 07:38:04

问题


I have joomla 2.5 which log many deprecated warnings like Error::raiseNotice() is deprecated. So I result width a big log file. Can I turn off this option, and log just my own exceptions?


回答1:


You can always place an error reporting condition in your index.php like: error_reporting(E_ALL ^ E_DEPRECATED);

For more info: http://php.net/manual/en/function.error-reporting.php

Or you can edit error.php in your joomla directory, and

public static function raiseNotice($code, $msg, $info = null)
{
    // Deprecation warning.
    JLog::add('JError::raiseNotice() is deprecated.', JLog::WARNING, 'deprecated');

    //return JError::raise(E_NOTICE, $code, $msg, $info);
}

disable this function to raise deprecated warnings...



来源:https://stackoverflow.com/questions/14649052/prevent-joomla-api-to-log-deprecated-warning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!