Development

Changeset 6398

You must first sign up to be able to contribute.

Changeset 6398

Show
Ignore:
Timestamp:
12/09/07 19:45:54 (10 months ago)
Author:
fabien
Message:

fixed default log file permissions (closes #2145)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/lib/log/sfLogger/sfFileLogger.class.php

    r3329 r6398  
    4040    } 
    4141 
    42     if (!is_writable($dir) || (file_exists($options['file']) && !is_writable($options['file']))) 
     42    if (!is_writable($dir) || ($fileExists = file_exists($options['file']) && !is_writable($options['file']))) 
    4343    { 
    4444      throw new sfFileException(sprintf('Unable to open the log file "%s" for writing', $options['file'])); 
     
    4646 
    4747    $this->fp = fopen($options['file'], 'a'); 
     48    if (!$fileExists) 
     49    { 
     50      chmod($options['file'], 0666); 
     51    } 
    4852  } 
    4953