Changeset 16479

Show
Ignore:
Timestamp:
05/27/08 23:48:13 (6 months ago)
Author:
adrenalin
Message:

Handle the creation of new file straight forward, if it doesn't exist.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.core/midcom/services/_i18n_l10n.php

    r15698 r16479  
    199199     * It will write all loaded languages to disk, regardless of changes. 
    200200     */ 
    201     function flush() { 
     201    function flush() 
     202    { 
    202203        foreach ($this->_stringdb as $lang => $table) 
    203204        { 
    204             if (!is_writable("{$this->_library_filename}.{$lang}.txt")) 
     205            $file = @fopen("{$this->_library_filename}.{$lang}.txt", 'w'); 
     206             
     207            if (!$file) 
    205208            { 
    206209                $_MIDCOM->uimessages->add("L10N Error", "Failed to open the file '{$this->_library_filename}.{$lang}.txt' for writing.", 'error'); 
     
    211214            } 
    212215         
    213             $file = fopen("{$this->_library_filename}.{$lang}.txt", 'w'); 
    214216             
    215217            fwrite($file, "---# MidCOM String Database\n");