M
M
Mikhail Osher2012-02-01 11:44:37
PHP
Mikhail Osher, 2012-02-01 11:44:37

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

6 answer(s)
M
Mikhail Osher, 2012-02-16
@miraage

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
--------------------------------------------------------------------------------

M
Mikhail Osher, 2012-02-03
@miraage

For fun, I'll say that this is the 666th question with the PHP tag. The truth is somewhere near…

D
den1n, 2012-02-01
@den1n

Try adding a line to both handlers (before handling the error):
restore_error_handler();
restore_exception_handler();

I
IngvarrT, 2012-02-02
@IngvarrT

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 :)

V
Vadim, 2012-02-05
@MisterX

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?

A
Alexey, 2012-02-06
@Alert

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 question

Ask a Question

731 491 924 answers to any question