防止Joomla API记录不推荐使用的警告 [英] Prevent joomla api to log deprecated warning

查看:160
本文介绍了防止Joomla API记录不推荐使用的警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有joomla 2.5,它记录了许多已弃用的警告,例如Error::raiseNotice() is deprecated. 因此,我导致了一个大日志文件的宽度.我可以关闭此选项,仅记录自己的异常吗?

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?

推荐答案

您始终可以在index.php中放置错误报告条件,例如: error_reporting(E_ALL ^ E_DEPRECATED);

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

有关更多信息: http://php.net/manual/zh/function.error-reporting.php

或者您可以在joomla目录中编辑error.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...

这篇关于防止Joomla API记录不推荐使用的警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆