php.ini配置

时间:2012-06-25 17:26:20

标签: php-5.3

任何人都可以解释以下给定指令之间的相互关系

; Do not log repeated messages. Repeated errors must occur in same file on same
; line unless ignore_repeated_source is set true.
; http://php.net/ignore-repeated-errors
ignore_repeated_errors = off

; Ignore source of message when ignoring repeated messages. When this setting
; is On you will not log errors with repeated messages from different files or
; source lines.
; http://php.net/ignore-repeated-source
ignore_repeated_source = off

2 个答案:

答案 0 :(得分:1)

来自PHP Documentation

  

ignore_repeated_errors
  不记录重复的消息。除非ignore_repeated_source设置为true,否则必须在同一行的同一文件中发生重复错误。

     

ignore_repeated_source
  忽略重复的消息时忽略消息源。当此设置为“开”时,您将不会记录来自不同文件或源行的重复消息的错误。

ignore_repeated_errors set On会在来自同一文件的同一行时抑制多次出现相同错误。

ignore_repeated_source设置为On 以及会抑制多次出现相同错误,即使这些错误来自不同文件中的不同行。

答案 1 :(得分:1)

重复的消息是在同一文件的同一行上创建的消息。这可以是循环或函数:

for (...) {
  someFunctionThatFails();
}

通过启用第二个选项,重复的消息不需要在同一行或文件上。然后,每个请求只记录一次特定类型的消息。这将只提供一条记录消息:

someFunctionThatFails();
doSomeThingElse();
someFunctionThatFails();