Answer the question
In order to leave comments, you need to log in
Double write to file!?
pastebin.com/5tAcX23s
With IN_DEV = 1, i.e. debug enabled - everything works fine.
I put IN_DEV = 0, everything works fine, the log is being written, the message is displayed correctly, but the error message is written twice!
I tried to rewrite the code of lines 57-62 through SplFileObject - the same thing.
winxp sp3, php 5.3
What could be the problem?
Answer the question
In order to leave comments, you need to log in
You won't believe it... I inserted data from REQUEST_URI into the log. Received in the log:
Created the favicon.ico file - everything began to work fine. Some kind of magic... :)
--------------------------------------------------------------------------------
pewpew
Request data: /
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
pewpew
Request data: /favicon.ico
--------------------------------------------------------------------------------
For fun, I'll say that this is the 666th question with the PHP tag. The truth is somewhere near…
Try adding a line to both handlers (before handling the error):
restore_error_handler();
restore_exception_handler();
I'll even say more. If you put
file_put_contents(DEV_LOG. microtime(true), $msg. microtime(true). $sep, FILE_APPEND);
, then two files will be created :)
Maybe the problem is not in this class? What about the code above? Perhaps you are using this class in two places at the same time, so two entries?
It's been 5 days and you probably already fixed the bug, but I'll write anyway.
Are you sure the script only runs once?
There was a similar problem, I suffered and poked around for a long time, but in the end it turned out that there was some kind of crooked plugin for Firefox that performed each request 2 times.
Try testing this option.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question