Ticket #678: Xcache_patch.diff

File Xcache_patch.diff, 1.4 kB (added by Adura, 5 months ago)

Xcache driver patch

  • Xcache.php

    old new  
    4040 
    4141        public function delete($id, $tag = FALSE) 
    4242        { 
    43                 if ($id === TRUE) 
     43                if ($tag !== FALSE) 
    4444                { 
    4545                        Log::add('error', 'Cache: tags are unsupported by the Xcache driver'); 
    4646                        return TRUE; 
    4747                } 
    48                 elseif ($tag == FALSE) 
     48                elseif($id !== TRUE) 
     49                { 
     50                        if (xcache_isset($id)) 
     51                                return xcache_unset($id); 
     52 
     53                        return FALSE; 
     54                } 
     55                else 
    4956                { 
    5057                        // Do the login 
    5158                        $this->auth(); 
    52  
    5359                        $result = TRUE; 
    5460                        for ($i = 0, $max = xcache_count(XC_TYPE_VAR); $i < $max; $i++) 
    5561                        { 
    56                                 if ( ! xcache_clear_cache(XC_TYPE_VAR, $i)) 
     62                                if (xcache_clear_cache(XC_TYPE_VAR, $i) !== NULL) 
    5763                                { 
    5864                                        $result = FALSE; 
    5965                                        break; 
     
    6470                        $this->auth(TRUE); 
    6571                        return $result; 
    6672                } 
    67                 else 
    68                 { 
    69                         return TRUE; 
    70                 } 
     73                 
     74                return TRUE; 
     75        } 
     76 
     77        public function delete_all() 
     78        { 
     79                return TRUE; 
    7180        } 
    7281 
    7382        public function delete_expired() 
     
    104113                                        $backup[$key] = $value; 
    105114                                } 
    106115 
    107                                 $_SERVER[$key] = Config::item('cache_xcache.__'.$key); 
     116                                $_SERVER[$key] = Config::item('cache_xcache.'.$key); 
    108117                        } 
    109118                } 
    110119        } 
    111120 
    112 } // End Cache Xcache Driver 
    113  No newline at end of file 
     121} // End Cache Xcache Driver