Changeset 2939

Show
Ignore:
Timestamp:
02/15/07 17:18:58 (5 months ago)
Author:
demian
Message:

adding new cache options

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/0.6-bugfix/etc/default.conf.dist.ini

    r2886 r2939  
    6969libCacheEnabled         = false 
    7070lifetime                = 86400 ; 24 hrs in secs 
     71; 0 - automatic cache cleaning 
     72; 1 - systematic cache cleaning 
     73; x (integer) > 1 - automatic cleaning randomly 1 times on x cache write 
     74cleaningFactor          = 0 
     75; if enabled, a control key is embeded in cache file and this key is compared 
     76; with the one calculated after the reading 
     77readControl             = true 
     78; Enable write control will lightly slow the cache writing but not the 
     79; cache reading. Write control can detect some corrupt cache files but 
     80; maybe it's not a perfect control. 
     81writeControl            = true 
    7182 
    7283[debug] 
  • branches/0.6-bugfix/lib/SGL/Cache.php

    r2221 r2939  
    7676                'lifeTime'  => $conf['cache']['lifetime'], 
    7777                'caching'   => $isEnabled); 
     78            // new options are added via issets for BC 
     79            if (isset($conf['cache']['cleaningFactor'])) { 
     80                $options['automaticCleaningFactor'] = $conf['cache']['cleaningFactor']; 
     81            } 
     82            if (isset($conf['cache']['readControl'])) { 
     83                $options['readControl'] = $conf['cache']['readControl']; 
     84            } 
     85            if (isset($conf['cache']['writeControl'])) { 
     86                $options['writeControl'] = $conf['cache']['writeControl']; 
     87            } 
    7888            $instance = new Cache_Lite($options); 
    7989        }