【问题标题】:Dokeos warning: Strict StandardsDokeos 警告:严格标准
【发布时间】:2012-03-12 23:28:16
【问题描述】:

将 dokeos 2.1 安装到 htdocs 时,会显示如下警告:

Strict Standards: Declaration of SortableTableFromArray::get_table_data() should be compatible with that of SortableTable::get_table_data() in ...\dokeos\main\inc\lib\sortabletable.class.php on line 989

Strict Standards: Declaration of SortableTableFromArrayConfig::get_table_data() should be compatible with that of SortableTable::get_table_data() in ...\dokeos\main\inc\lib\sortabletable.class.php on line 1032

还有大约十个类似的警告:

Strict Standards: Only variables should be passed by reference in ...\dokeos\main\inc\lib\internationalization.lib.php on line 203

如何解决?

【问题讨论】:

  • 如果有更新的版本,请尝试升级到它。
  • dokeos 应该完全重写......意大利面条代码规则......如果你真的想使用它,你应该在你的 php conf 中禁用 display_error

标签: php warnings standards strict


【解决方案1】:

如果您有权访问 php.ini,请检查 error_reporting 选项是否包含 E_STRICT 错误级别。如果是这样,请将其删除。如果您无权访问 php.ini,请在您的应用程序代码(例如主 PHP 入口文件)中添加 error_reporting(error_reporting() & ~E_STRICT);。

【讨论】:

  • 删除错误报告是否安全?它可以正常工作吗?
  • @bagz_man 您只是从错误报告中删除 E_STRICT 消息,这些消息是建议而不是真正的错误。正如文档所说:STRICT messages will help you to use the latest and greatest suggested method of coding, for example warn you about using deprecated functions.
猜你喜欢
  • 1970-01-01
  • 2013-01-24
  • 2013-02-09
  • 2014-02-08
  • 1970-01-01
  • 2015-03-15
  • 1970-01-01
  • 2013-11-27
  • 2011-10-07
相关资源
最近更新 更多