Ticket #2145: setPermToLogFileAtCreationTime.patch
| File setPermToLogFileAtCreationTime.patch, 0.8 kB (added by Nicolas.DHOMONT, 1 year ago) |
|---|
-
/trunk/lib/log/sfLogger/sfFileLogger.class.php
old new 44 44 mkdir($dir, 0777, true); 45 45 } 46 46 47 if (!is_writable($dir) || (file_exists($options['file']) && !is_writable($options['file']))) 47 $file_exists = file_exists($options['file']); 48 49 if (!is_writable($dir) || ($file_exists && !is_writable($options['file']))) 48 50 { 49 51 throw new sfFileException(sprintf('Unable to open the log file "%s" for writing.', $options['file'])); 50 52 } … … 51 53 52 54 $this->fp = fopen($options['file'], 'a'); 53 55 56 if (!$file_exists) 57 { 58 chmod($options['file'], 0666); 59 } 60 54 61 return parent::initialize($options); 55 62 } 56 63