Issues with compacting messages [message #158310] |
Tue, 17 February 2009 14:42 |
JanRei
Messages: 361 Registered: October 2005 Location: Germany
Karma: 0
|
Senior Member Contributing Core Developer Translator |
|
|
Using FUDforum built from latest CVS compacting messages sometimes fail, because the message file can't be removed. I don't know the reason yet since it seems to work sometimes. In case of failure the page is automatically forced to be scrolled down (probably by JavaScript) so I can't scroll it up, which is a bit annoying.
On the page is shown;
Quote: | Disabling the forum for the duration of maintenance run
Please wait while forum is being compacted.
This may take a while depending on the size of your forum.
Compacting normal messages...
FATAL ERROR: unable to remove file F:/xampp/htdocs/FUDforum/messages/msg_10000
|
In the error log appears:
Quote: | PHP Warning: unlink(F:/xampp/htdocs/FUDforum/messages/msg_10000) [<a href='function.unlink'>function.unlink</a>]: Permission denied in F:\xampp\htdocs\forum\adm\compact.php on line 186
|
|
|
|
|
|
|
|
|
|
|
Re: Issues with compacting messages [message #158499 is a reply to message #158310] |
Fri, 27 February 2009 16:37 |
JanRei
Messages: 361 Registered: October 2005 Location: Germany
Karma: 0
|
Senior Member Contributing Core Developer Translator |
|
|
What do you think about a small modification to the error handler so that it doesn't trigger on supressed error messages?
--- F:/xampp/htdocs/forum/adm/compact_orig.php Thu Feb 26 12:44:46 2009
+++ F:/xampp/htdocs/forum/adm/compact.php Thu Feb 26 18:41:48 2009
@@ -96,12 +96,16 @@
set_error_handler ('error_handler');
function error_handler ($level, $message, $file, $line, $context) {
- echo <<<_END_
+ if (error_reporting() != 0) {
+ echo <<<_END_
<script type="text/javascript">clearInterval(intervalID);</script>
<p>An error was generated in file $file on line $line.</p>
<p><font color="red">The error message was: $message</font></p>
_END_;
- exit;
+ exit;
+ } else {
+ return;
+ }
}
function write_body_c($data, &$len, &$offset, $fid)
|
|
|
|
|