Ignore:
Timestamp:
08/13/2010 01:39:36 AM (22 months ago)
Author:
ofer
Message:

blindly added eaccelerator support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/WordPress/plugin/transposh/wp/transposh_db.php

    r505 r507  
    6464            if ($rc === false) return false; 
    6565            logger('apc', 5); 
    66         } 
    67         elseif (function_exists('xcache_get')) { 
     66        } elseif (function_exists('xcache_get')) { 
    6867            $rc = xcache_isset($key); 
    6968            if ($rc === false) return false; 
    7069            $cached = xcache_get($key); 
    7170            logger('xcache', 5); 
     71        } elseif (function_exists('eaccelerator_get')) { 
     72            $cached = eaccelerator_get($key); 
     73            if ($cached === null) 
     74                    return false; //TODO - unfortunantly null storing does not work here.. 
     75 logger('eaccelerator', 5); 
    7276        } 
    7377        logger("Cached: $original", 5); 
     
    96100        } elseif (function_exists('xcache_set')) { 
    97101            $rc = xcache_set($key, $cache_entry, $ttl); 
    98         } 
     102        } elseif (function_exists('eaccelerator_put')) { 
     103            $rc = eaccelerator_put($key, $cache_entry, $ttl); 
     104        } 
     105 
    99106        if ($rc) { 
    100107            logger("Stored in cache: $original => {$translated[0]},{$translated[1]}", 3); 
     
    115122        } elseif (function_exists('xcache_unset')) { 
    116123            xcache_unset($key); 
     124        } elseif (function_exists('eaccelerator_rm')) { 
     125            eaccelerator_rm($key); 
    117126        } 
    118127    } 
     
    123132    function cache_clean() { 
    124133        if (!TP_ENABLE_CACHE) return; 
    125         if (function_exists('apc_clear_cache')) apc_clear_cache('user'); 
    126         elseif (function_exists('xcache_unset_by_prefix')) 
    127                 xcache_unset_by_prefix(); 
     134        if (function_exists('apc_clear_cache')) { 
     135            apc_clear_cache('user'); 
     136        } elseif (function_exists('xcache_unset_by_prefix')) { 
     137            xcache_unset_by_prefix(); 
     138        } 
     139        //TODO - clean on eaccelerator is not so clean... 
    128140    } 
    129141 
Note: See TracChangeset for help on using the changeset viewer.