click.php: fopen warning
Brought to you by:
blade1o6
In click.php the first fopen() call which tries to open a log file for append, generates a warning if the directory doesn't exist:
httpd: PHP Warning: fopen(<local path censored>/clickheat/logs/<my page title censored>/2010-08-24.log) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory in <local path censored>/clickheat/click.php on line 95
Since click.php checks via is_resource() if everything worked out as expected, it's probably enough to add a @-sign as prefix to "mute" the generated warning. I've attached a patch against the 1.10 release which includes the "be nice to your error log fix".
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Maybe I should note that I use the "per page" click statistics instead of the grouped results. Therefor, the directory name in which the log is placed is always the title/name of a subpage.
Last edit: Anonymous 2016-01-03
Hello,
I won't fix this, as it's a performance issue to use @ prefix. The fact that the error happens it most of the time not a real issue, as almost no one reads their error logs (too bad...).
The only patch that could be used is a try/catch, as this will not output the error. May be I should fix this that way.