Changeset 1918

Show
Ignore:
Timestamp:
02/04/2008 08:47:15 PM (11 months ago)
Author:
Shadowhand
Message:

Fixing the return value of Cache_File::delete()

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/drivers/Cache/File.php

    r1901 r1918  
    184184                        return FALSE; 
    185185 
     186                // Disable all error reporting while deleting 
     187                $ER = error_reporting(0); 
     188 
    186189                foreach($files as $file) 
    187190                { 
    188191                        // Remove the cache file 
    189                         @unlink($file) or Log::add('error', 'Cache: Unable to delete cache file: '.$file); 
    190                 } 
    191  
    192                 return FALSE; 
     192                        if ( ! unlink($file)) 
     193                                Log::add('error', 'Cache: Unable to delete cache file: '.$file); 
     194                } 
     195 
     196                // Turn on error reporting again 
     197                error_reporting($ER); 
     198 
     199                return TRUE; 
    193200        } 
    194201