Ignore:
Timestamp:
06/04/12 09:57:19 (12 years ago)
Author:
cristiano
Message:

Ticket #2768 - Verificação de permissão na pasta config REST API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.4.1-3/prototype/api/config.php

    r6367 r6399  
    7272        public static function writeIniFile($assoc_arr, $path, $has_sections) 
    7373        { 
    74                 $content = ''; 
    75  
    76                 if (!$handle = fopen($path, 'w')) 
    77                 { 
    78                         trigger_error("Permission failure when trying to open the file: $path ", E_USER_WARNING); 
    79                         return FALSE; 
    80                 }        
    81  
     74                $content = '';   
    8275                self::_writeIniFile($content, $assoc_arr, $has_sections); 
    83  
    84                 if (!fwrite($handle, $content)) 
     76                if( file_put_contents($path, $content) === false) 
    8577                { 
    8678                        trigger_error("Permission failure when trying to write in the file: $path ", E_USER_WARNING); 
    87                 }       return FALSE; 
    88  
    89                 fclose($handle); 
    90                 return TRUE; 
     79                        return false; 
     80                } 
     81                return true; 
    9182        } 
    9283 
Note: See TracChangeset for help on using the changeset viewer.