From 2835e08ac46ab5c260978a2013ba8837222318c5 Mon Sep 17 00:00:00 2001 From: Jeroen van der Gulik Date: Sun, 4 Dec 2011 14:19:38 +0100 Subject: - Stop logger from trying to chmod on each event to safe i/o and prevent error messages popping up when the user is different then the webserver --- system/libraries/Log.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'system/libraries/Log.php') diff --git a/system/libraries/Log.php b/system/libraries/Log.php index 6ea905f73..46c5b6ed2 100644 --- a/system/libraries/Log.php +++ b/system/libraries/Log.php @@ -111,6 +111,7 @@ class CI_Log { if ( ! file_exists($filepath)) { + $newfile = TRUE; $message .= "<"."?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?".">\n\n"; } @@ -126,7 +127,10 @@ class CI_Log { flock($fp, LOCK_UN); fclose($fp); - @chmod($filepath, FILE_WRITE_MODE); + if (isset($newfile) AND $newfile === TRUE) + { + @chmod($filepath, FILE_WRITE_MODE); + } return TRUE; } @@ -134,4 +138,4 @@ class CI_Log { // END Log Class /* End of file Log.php */ -/* Location: ./system/libraries/Log.php */ \ No newline at end of file +/* Location: ./system/libraries/Log.php */ -- cgit v1.2.3-24-g4f1b