cvs: pear /Log file.php
| From: | Jon Parise | Date: | Wed, 16 May 2001 17:30:31 +0000 |
| Subject: | cvs: pear /Log file.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-147@lists.php.net to get a copy of this message | ||
jon Wed May 16 10:30:31 2001 EDT
Modified files:
/pear/Log file.php
Log:
Close the logfile after each write to prevent blocking due to concurrency.
Index: pear/Log/file.php
diff -u pear/Log/file.php:1.1 pear/Log/file.php:1.2
--- pear/Log/file.php:1.1 Tue May 15 18:17:34 2001
+++ pear/Log/file.php Wed May 16 10:30:31 2001
@@ -1,5 +1,5 @@
<?php
-// $Id: file.php,v 1.1 2001/05/16 01:17:34 jon Exp $
+// $Id: file.php,v 1.2 2001/05/16 17:30:31 jon Exp $
// $Horde: horde/lib/Log/file.php,v 1.4 2000/06/28 21:36:13 jon Exp $
/**
@@ -7,7 +7,7 @@
* abstract class which writes message to a text file.
*
* @author Jon Parise <jon@csh.rit.edu>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
* @since Horde 1.3
*/
class Log_file extends Log {
@@ -78,6 +78,12 @@
if ($this->fp) {
fwrite($this->fp, $entry);
+
+ /*
+ * The file must be closed immediately, or we will run into
+ * concurrency blocking issues.
+ */
+ $this->close();
}
$this->notifyAll(array('priority' => $priority, 'message' =>
$message));